| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data.Common; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using Common; |
| | |
| | | /// <returns></returns> |
| | | public bool Add(GwClientProduct gcp) |
| | | { |
| | | return OracleHelper.ExecuteSql("insert into GW_Client_Product(id,client_id,product_id) values(:id,:client_id,:product_id)", OracleHelper.Connection, new OracleParameter(":id", (object)gcp.Id), new OracleParameter(":client_id", (object)gcp.ClientId), new OracleParameter(":product_id", (object)gcp.ProductId)) > 0; |
| | | return OracleHelper.ExecuteSql("insert into GW_Client_Product(id,client_id,product_id,sp_id,ACTIVATE_STATUS) values(:id,:client_id,:product_id,:sp_id,:ACTIVATE_STATUS)", |
| | | OracleHelper.Connection, new OracleParameter(":id", (object)gcp.Id), new OracleParameter(":client_id", (object)gcp.ClientId), |
| | | new OracleParameter(":product_id", gcp.ProductId),new OracleParameter(":sp_id",gcp.SpId), |
| | | new OracleParameter(":ACTIVATE_STATUS", gcp.ActivateStatus)) > 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新 |
| | | /// </summary> |
| | | /// <param name="gcp"></param> |
| | | /// <returns></returns> |
| | | public bool Update(GwClientProduct gcp) |
| | | { |
| | | return OracleHelper.ExecuteSql("update GW_Client_Product set product_id=:product_id,client_id=:client_id where sp_id=:sp_id ", |
| | | OracleHelper.Connection, new OracleParameter(":product_id", gcp.ProductId), new OracleParameter(":sp_id", gcp.SpId), |
| | | new OracleParameter(":client_id",gcp.ClientId) |
| | | ) > 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查找账号是否存在 |
| | | /// </summary> |
| | | /// <param name="spid"></param> |
| | | /// <returns></returns> |
| | | public bool FindBySp(string spid) |
| | | { |
| | | using (OracleDataReader oracleDataReader = OracleHelper.ExecuteReader(string.Format("select * from GW_Client_Product where SP_ID=:SP_ID"), OracleHelper.Connection, new OracleParameter(":SP_ID", spid))) |
| | | { |
| | | if (oracleDataReader.Read()) |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | if (bean.RouterType == 1) |
| | | { |
| | | str1 += "<td rowspan=\"1\"><span class='label label-primary'>通道</span>"; |
| | | str1 += string.Format("<div>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetOpName(bean.CmOpId), (object)this.GetOpName(bean.CtOpId), (object)this.GetOpName(bean.CuOpId)); |
| | | str1 += string.Format("<div style='margin-top:10px;'>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetOpName(bean.CmOpId), (object)this.GetOpName(bean.CtOpId), (object)this.GetOpName(bean.CuOpId)); |
| | | } |
| | | else if (bean.RouterType == 3) |
| | | { |
| | | str1 += "<td rowspan=\"1\"><span class='label label-success'>通道组</span>"; |
| | | str1 += string.Format("<div>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetGroupName(bean.CmGroupid), (object)this.GetGroupName(bean.CtGroupid), (object)this.GetGroupName(bean.CuGroupid)); |
| | | str1 += string.Format("<div style='margin-top:10px;'>移动:{0}</div><div>电信:{1}</div><div>联通:{2}</div>", (object)this.GetGroupName(bean.CmGroupid), (object)this.GetGroupName(bean.CtGroupid), (object)this.GetGroupName(bean.CuGroupid)); |
| | | } |
| | | else |
| | | { |
| | |
| | | o.CumulativeAuditTime = context.GetInt("CumulativeAuditTime"); |
| | | o.IsSyncChildSendAudit = context.GetInt("IsSyncChildSendAudit"); |
| | | |
| | | o.ProductId = context.GetString("ProductId",""); |
| | | o.ProductId = context.GetString("ProductId","");//产品ID |
| | | |
| | | if (context.GetInt("RouterType", 1) == 1) |
| | | { |
| | |
| | | o.CUGroupID = 0; |
| | | o.CTGroupID = 0; |
| | | } |
| | | o.BalanceThreshold = context.GetInt("BalanceThreshold"); |
| | | o.AlarmMobile = context.GetString("AlarmMobile"); |
| | | o.BalanceThreshold = context.GetInt("BalanceThreshold");//告警条数 |
| | | o.AlarmMobile = context.GetString("AlarmMobile");//告警号码 |
| | | o.ForceSignFlag = context.GetInt("ForceSignFlag"); |
| | | o.ForceSign = context.GetString("ForceSign"); |
| | | o.SignatureMode = context.GetInt("signatureMode"); |
| | |
| | | throw new Exception("账号密码不能为空"); |
| | | this._Dao.Update(o); |
| | | this._Dao.UpdatePattern(cTPattern, context.OperatorID); //更新账号里面的报备内容 |
| | | |
| | | //同时修改客户-产品表记录,若存在,则更新,否则新建 |
| | | bool flag = GwClientProductDao.Instance.FindBySp(o.SpID); |
| | | GwClientProduct clientProduct = new GwClientProduct() |
| | | { |
| | | ClientId = o.ClientID, |
| | | ProductId = o.ProductId, |
| | | SpId = o.SpID, |
| | | ActivateStatus = 1, |
| | | Id=Guid.NewGuid().ToString() |
| | | }; |
| | | if (flag)//存在,更新 |
| | | { |
| | | GwClientProductDao.Instance.Update(clientProduct); |
| | | } |
| | | else |
| | | { |
| | | |
| | | GwClientProductDao.Instance.Add(clientProduct); |
| | | } |
| | | |
| | | return new JsonPageResult(true, (object)("账户" + o.SpID + "修改成功!")); |
| | | } |
| | | |
| | |
| | | throw new Exception("SPID已经存在,请重新填写!"); |
| | | this._Dao.Add(o); |
| | | this._Dao.UpdatePattern(string1, @int, string2, context.OperatorID);//添加账号的时候配置报备 |
| | | |
| | | |
| | | //如果选择了产品,表示创建的时候就激活。后台创建无赠送 |
| | | if (!string.IsNullOrEmpty(o.ProductId)) |
| | | { |
| | | //同时修改客户-产品表记录,若存在,则更新,否则新建 |
| | | bool flag = GwClientProductDao.Instance.FindBySp(o.SpID); |
| | | GwClientProduct clientProduct = new GwClientProduct() |
| | | { |
| | | ClientId = o.ClientID, |
| | | ProductId = o.ProductId, |
| | | SpId = o.SpID, |
| | | ActivateStatus = 1, |
| | | Id = Guid.NewGuid().ToString() |
| | | }; |
| | | if (flag)//存在,更新 |
| | | { |
| | | GwClientProductDao.Instance.Update(clientProduct); |
| | | } |
| | | else |
| | | { |
| | | |
| | | GwClientProductDao.Instance.Add(clientProduct); |
| | | } |
| | | } |
| | | |
| | | |
| | | return new JsonPageResult(true, (object)("账户" + o.SpID + "添加成功!")); |
| | | } |
| | | |