public void DataBinds() { int pageCount = 0; int Counts = 0; string JoinTableStr = " SYS_CompUser inner join Sys_Users Users on SYS_CompUser.userid=Users.id and isnull(SYS_CompUser.dr,0)=0 and isnull(Users.dr,0)=0 "; DataTable LUser = new Hi.BLL.SYS_CompUser().GetList(1, 1, "SYS_CompUser.createdate", false, " users.Tel,Identitys,Email,Address,SYS_CompUser.id,UserName,SYS_CompUser.compid,trueName,utype Type,Phone,SYS_CompUser.IsEnabled,SYS_CompUser.createdate,SYS_CompUser.DisID ,OpenID,Sex ", JoinTableStr, " and SYS_CompUser.id=" + KeyID + "", out pageCount, out Counts); if (LUser.Rows.Count > 0) { lblDisName.InnerText = Common.GetDisValue(LUser.Rows[0]["DisID"].ToString().ToInt(0), "disname").ToString(); lblUname.InnerText = LUser.Rows[0]["UserName"].ToString(); lblOpenID.InnerText = LUser.Rows[0]["OpenID"].ToString(); lblSex.InnerText = LUser.Rows[0]["Sex"].ToString(); lblPhone.InnerText = LUser.Rows[0]["Phone"].ToString(); lblTel.InnerText = LUser.Rows[0]["Tel"].ToString(); lblIdentitys.InnerText = LUser.Rows[0]["Identitys"].ToString(); lblTrueName.InnerText = LUser.Rows[0]["TrueName"].ToString(); lblIsEnabled.InnerHtml = LUser.Rows[0]["IsEnabled"].ToString().ToInt(0) == 1 ? "启用" : "<i style='color:red;'>禁用</i>"; lblEmail.InnerText = LUser.Rows[0]["Email"].ToString(); //lblAddress.InnerText = user.Address; } else { JScript.AlertMethod(this, "该用户不存在!", JScript.IconOption.错误, " function (){ location.href='DisUserList.aspx' }"); return; } }
/// <summary> /// 启用 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_Use(object sender, EventArgs e) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("top 1 *", " UserID=" + KeyID + " and Compid=" + CompID + " and ctype=1 ", ""); if (ListCompUser.Count > 0) { List <Hi.Model.SYS_Role> ListRole = new Hi.BLL.SYS_Role().GetList("RoleName,IsEnabled", " dr=0 and id=" + ListCompUser[0].RoleID + "", ""); if (ListRole.Count > 0) { if (ListRole[0].IsEnabled == 0) { JScript.AlertMsgOne(this, "请先启用该人员所在岗位(" + ListRole[0].RoleName + ")!", JScript.IconOption.错误, 2500); return; } } ListCompUser[0].IsEnabled = 1; ListCompUser[0].ts = DateTime.Now; ListCompUser[0].modifyuser = UserID; if (new Hi.BLL.SYS_CompUser().Update(ListCompUser[0])) { this.Page.ClientScript.RegisterStartupScript(Page.GetType(), "msg", "<script>window.parent.save();</script>"); } } else { JScript.AlertMethod(this, "用户不存在!", JScript.IconOption.错误, "function (){ history.go(-1) ; }"); return; } DataBinds(); }
/// <summary> /// 转账汇款审核 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSh_Click(object sender, EventArgs e) { string shId = this.hidShId.Value; //调用model,对属性进行赋值 Hi.Model.PAY_PrePayment shModel = new Hi.BLL.PAY_PrePayment().GetModel(Convert.ToInt32(shId)); shModel.AuditState = 2; //调用修改方法 Hi.BLL.PAY_PrePayment shUpdate = new Hi.BLL.PAY_PrePayment(); bool shUp = shUpdate.Update(shModel); if (shUp == bool.Parse("true")) { int hidShIds = shModel.DisID; Hi.BLL.PAY_PrePayment prePayModel = new Hi.BLL.PAY_PrePayment(); //sum代理商全部录入,冲正以及审核通过的转账汇款金额 decimal sums = prePayModel.sums(hidShIds, shModel.CompID); //修改代理商的企业钱包金额 //调用model,对属性进行赋值 Hi.Model.BD_Distributor disSumModel = new Hi.BLL.BD_Distributor().GetModel(Convert.ToInt32(hidShIds)); disSumModel.DisAccount = sums; disSumModel.ID = shModel.ID; //调用修改方法 Hi.BLL.BD_Distributor disupdate = new Hi.BLL.BD_Distributor(); bool disup = disupdate.Update(disSumModel); if (disup) { JScript.AlertMethod(this, "审核成功", JScript.IconOption.笑脸, "function (){ location.replace('" + ("PayExamineList.aspx") + "'); }"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (KeyID != 0) { try { Hi.Model.BD_DisPrice model = new Hi.BLL.BD_DisPrice().GetModel(KeyID); if (model != null) { //this.lblDisTitle.InnerText = model.Title.ToString(); //this.lblDisID.InnerText = model.DisNames.ToString(); //this.txtRemark.Value = model.Remark; } Bind(KeyID.ToString()); } catch (Exception ex) { JScript.AlertMethod(this.Page, "数据有误", JScript.IconOption.错误, "function(){location.href='GoodsPriceList.aspx';}"); return; } } } }
public string PayableSum = string.Empty; //本月应款额 protected void Page_Load(object sender, EventArgs e) { user = new Hi.BLL.SYS_Users().GetModel(this.UserID); price = Convert.ToDecimal(new Hi.BLL.PAY_PrePayment().sums(user.DisID, user.CompID)).ToString("0.00");//(decimal)dt.Rows[0]["DisAccount"]; if (user.IsFirst != 2) { if (user.IsFirst == 0) { if (user.UserPwd == Util.md5("123456")) { JScript.AlertMethod(this, "经检测,您是第一次登录,为了您的账户安全,请先修改登录密码和支付密码!", JScript.IconOption.笑脸, "function (){ location.href = 'UserPWDEdit.aspx'; }"); return; } else { user.IsFirst = 1; user.modifyuser = user.ID; user.ts = DateTime.Now; new Hi.BLL.SYS_Users().Update(user); JScript.AlertMethod(this, "经检测,您是第一次登录,为了您的账户安全,请修改支付密码!", JScript.IconOption.笑脸, "function (){ location.href = 'PayPWDEdit.aspx'; }"); return; } } } if (!IsPostBack) { InBind(); Bind(); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { try { List <int> l = new List <int>(); List <int> ll = new List <int>(); foreach (RepeaterItem row in this.rptGoods.Items) { CheckBox cb = row.FindControl("CB_SelItem") as CheckBox; if (cb != null && cb.Checked) { HiddenField fld = row.FindControl("HF_Id") as HiddenField; HiddenField fld2 = row.FindControl("HF_CateID") as HiddenField; if (fld != null) { int id = Convert.ToInt32(fld.Value); l.Add(id); int cateid = Convert.ToInt32(fld2.Value); ll.Add(cateid); } } } if (l.Count == 0) { JScript.AlertMethod(this, "请勾商品", JScript.IconOption.错误); return; } int areaid = 0; if (!Util.IsEmpty(txtDisAreaBox.areaId)) { areaid = Convert.ToInt32(txtDisAreaBox.areaId); } else { JScript.AlertMethod(this, "区域选择有误", JScript.IconOption.错误); return; } for (int i = 0; i < l.Count; i++) { Hi.Model.BD_GoodsAreas model = new Hi.Model.BD_GoodsAreas(); model.CompID = this.CompID; model.areaID = areaid; model.GoodsID = l[i]; model.CategoryID = ll[i]; model.ts = DateTime.Now; model.modifyuser = this.UserID; new Hi.BLL.BD_GoodsAreas().Add(model); } // new Hi.BLL.BD_CategoryAttribute().Updates(this.UserID.ToString(), l, this.CompID.ToString()); JScript.AlertMethod(this, "商品不可售区域设置成功", JScript.IconOption.正确, "function(){location.href='GoodsAreasList.aspx';}"); } catch (Exception ex) { JScript.AlertMethod(this, "出错了", JScript.IconOption.错误); return; } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { SqlTransaction Tran = null; try { Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); object disId = Request["disId"]; //代理商id object goodsId = Request["goodsId"]; //商品Id if (disId != null && goodsId != null) { for (int i = 0; i < disId.ToString().Split(',').Length; i++) { for (int z = 0; z < goodsId.ToString().Split(',').Length; z++) { List <Hi.Model.BD_GoodsAreas> l = new Hi.BLL.BD_GoodsAreas().GetList("", "isnull(dr,0)=0 and compId=" + this.CompID + " and disId=" + disId.ToString().Split(',')[i] + " and goodsId=" + goodsId.ToString().Split(',')[z], "", Tran); if (l.Count == 0) { Hi.Model.BD_GoodsAreas model = new Hi.Model.BD_GoodsAreas(); Hi.Model.BD_Distributor model2 = new Hi.BLL.BD_Distributor().GetModel(Convert.ToInt32(disId.ToString().Split(',')[i]), Tran); Hi.Model.BD_Goods model3 = new Hi.BLL.BD_Goods().GetModel(Convert.ToInt32(goodsId.ToString().Split(',')[z]), Tran); model.CompID = this.CompID; model.areaID = model2.AreaID; model.GoodsID = Convert.ToInt32(goodsId.ToString().Split(',')[z]); model.CategoryID = model3.CategoryID; model.ts = DateTime.Now; model.dr = 0; model.modifyuser = this.UserID; model.DisID = Convert.ToInt32(disId.ToString().Split(',')[i]); new Hi.BLL.BD_GoodsAreas().Add(model, Tran); } else { continue; } } } } Tran.Commit(); Response.Redirect("GoodsAreaList.aspx"); } catch (Exception ex) { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } } JScript.AlertMethod(this, "保存失败了", JScript.IconOption.错误, "function(){location.href='GoodsAreaList.aspx';}"); return; } finally { DBUtility.SqlHelper.ConnectionClose(); } }
protected void btn_Del(object sender, EventArgs e) { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID); if (Dis != null) { //if (Dis.AuditState == 2 && Dis.IsEnabled == 1) //{ // JScript.AlertMsgOne(this, "已审核未被禁用的代理商不允许删除!", JScript.IconOption.错误); // return; //} //Dis.dr = 1; //Dis.ts = DateTime.Now; //Dis.modifyuser = Common.UserID(); List <int> ListUserid = new List <int>(); List <int> ListDelUserid = new List <int>(); List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and DisID=" + KeyID + " and Utype in (1,5) and Ctype=2 and CompID=" + this.CompID, ""); foreach (Hi.Model.SYS_CompUser model in luser) { if (model.IsAudit == 2 && model.IsEnabled == 1) { JScript.AlertMsgOne(this, "已审核未被禁用的代理商不允许删除!", JScript.IconOption.错误); return; } if (!ListUserid.Contains(model.UserID)) { List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("id", " dr=0 and Userid=" + model.UserID + " and CompID=" + this.CompID, ""); if (ListCompUser.Count == 1) { ListDelUserid.Add(model.UserID); } ListUserid.Add(model.UserID); } model.dr = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_CompUser().Update(model); } if (ListDelUserid.Count > 0) { List <Hi.Model.SYS_Users> ListUsers = new Hi.BLL.SYS_Users().GetList("", " dr=0 and id in(" + string.Join(",", ListDelUserid) + ")", ""); foreach (Hi.Model.SYS_Users model in ListUsers) { model.dr = 1; model.ts = DateTime.Now; model.modifyuser = Common.UserID(); new Hi.BLL.SYS_Users().Update(model); } } //string Phone = Common.GetDis(Dis.ID, "Phone"); //string msg = "您所注册的代理商:" + Dis.DisName + "已注销![ " + Common.GetCompValue(CompID, "CompName") + " ]"; //Common.GetPhone(Phone, msg); JScript.AlertMethod(this, "删除成功!", JScript.IconOption.错误, "function(){ window.location.href='DisList.aspx'; }"); } }
/// <summary> /// 新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { SqlTransaction Tran = null; try { Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); List <Hi.Model.BD_GoodsPrice> llll = new List <Hi.Model.BD_GoodsPrice>(); //修改 List <Hi.Model.BD_GoodsPrice> llll2 = new List <Hi.Model.BD_GoodsPrice>(); //新增 string[] disIdList = Request["lblDisId"].Split(','); // this.hidDisId.Value.Trim();//代理商列表 string[] priceList = Request["txtPrice"].Split(','); //价格 for (int i = 0; i < disIdList.Length; i++) { List <Hi.Model.BD_GoodsPrice> lll = new Hi.BLL.BD_GoodsPrice().GetList("", "isnull(dr,0)=0 and isenabled=1 and disid = " + disIdList[i] + "and compid=" + this.CompID + " and goodsinfoid=" + goodsInfoId, "", Tran); if (lll.Count > 0) { foreach (Hi.Model.BD_GoodsPrice item2 in lll) { item2.IsEnabled = false; item2.modifyuser = this.UserID; item2.ts = DateTime.Now; item2.CompID = this.CompID; llll.Add(item2); } } //新增 Hi.Model.BD_GoodsPrice model3 = new Hi.Model.BD_GoodsPrice(); //model3.DisPriceID = 0; model3.DisID = Convert.ToInt32(disIdList[i]); model3.CompID = this.CompID; model3.GoodsInfoID = goodsInfoId; model3.TinkerPrice = Convert.ToDecimal(priceList[i]); model3.IsEnabled = true; model3.CreateUserID = this.UserID; model3.CreateDate = DateTime.Now; model3.ts = DateTime.Now; model3.modifyuser = this.UserID; llll2.Add(model3); } new Hi.BLL.BD_GoodsPrice().Update(llll, Tran); new Hi.BLL.BD_GoodsPrice().Add(llll2, Tran); Tran.Commit(); ClientScript.RegisterStartupScript(this.GetType(), "msg2", "<script>$(function(){ window.parent.layerCommon.layerClose('hid_Alert');})</script>"); } catch (Exception) { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } } JScript.AlertMethod(this, "价格调整失败", JScript.IconOption.错误); return; } }
/// <summary> /// 新建冲正企业钱包 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { //定义冲正的变量 string txtPayCorrectDis = string.Empty; string txtPayCorrectPrice = string.Empty; //string txtPayCorrectDate = string.Empty; string txtPayCorrectType = string.Empty; string txtPayCorrectRemark = string.Empty; //获取冲正输入的数据 txtPayCorrectDis = this.txtPayCorrectDis.Value.Trim().ToString(); txtPayCorrectPrice = this.txtPayCorrectPrice.Value.Trim().ToString(); //txtPayCorrectDate = this.txtPayCorrectDate.Value.Trim().ToString(); txtPayCorrectType = this.txtPayCorrectType.Value.Trim().ToString(); txtPayCorrectRemark = this.txtPayCorrectRemark.Value.Trim().ToString(); //调用model,对属性进行赋值 Hi.Model.PAY_PrePayment prepaymentmodel = new Hi.Model.PAY_PrePayment(); prepaymentmodel.CompID = 1; prepaymentmodel.DisID = Convert.ToInt32(txtPayCorrectDis); prepaymentmodel.Start = 1; prepaymentmodel.PreType = Convert.ToInt32(txtPayCorrectType); prepaymentmodel.price = -Convert.ToDecimal(txtPayCorrectPrice); prepaymentmodel.Paytime = DateTime.Now; prepaymentmodel.CreatDate = DateTime.Now; prepaymentmodel.CrateUser = 1; prepaymentmodel.AuditState = 0; prepaymentmodel.IsEnabled = 1; prepaymentmodel.ts = DateTime.Now; prepaymentmodel.dr = 1; prepaymentmodel.modifyuser = 1; prepaymentmodel.vdef1 = txtPayCorrectRemark; //调用保存方法 Hi.BLL.PAY_PrePayment prepaymentsave = new Hi.BLL.PAY_PrePayment(); int reslut = prepaymentsave.Add(prepaymentmodel); //判断返回值int if (reslut > 0) { //sum代理商全部录入,冲正金额 //decimal sums = prepaymentsave.sums(txtPayCorrectDis); //修改代理商的企业钱包金额 //调用model,对属性进行赋值 //Hi.Model.BD_Distributor dismodel = new Hi.BLL.BD_Distributor().GetModel(Convert.ToInt32(txtPayCorrectDis)); //dismodel.DisAccount = sums; //调用修改方法 //Hi.BLL.BD_Distributor disupdate = new Hi.BLL.BD_Distributor(); //bool disup = disupdate.Update(dismodel); JScript.AlertMethod(this, "冲正成功!", JScript.IconOption.笑脸, "function (){ location.replace('" + ("PayCorrectList.aspx") + "'); }"); } else { JScript.AlertMethod(this, "冲正失败!", JScript.IconOption.哭脸, "function (){ location.replace('" + ("PayCorrectList.aspx") + "'); }"); } }
protected void btn_NUse(object sender, EventArgs e) { List <Hi.Model.SYS_Role> ListRole = new Hi.BLL.SYS_Role().GetList("", " dr=0 and id=" + KeyID + " and DisID=" + DisID + " ", ""); if (ListRole.Count > 0) { if (ListRole[0].RoleName == "企业管理员") { JScript.AlertMsgOne(this, "代理商管理员岗位不允许禁用!", JScript.IconOption.错误); return; } } else { JScript.AlertMsgOne(this, "禁用的岗位不存在!", JScript.IconOption.错误); return; } SqlTransaction Tran = null; try { Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and RoleID=" + ListRole[0].ID + " and Disid=" + DisID + " and Ctype=2 ", ""); foreach (Hi.Model.SYS_CompUser model in ListCompUser) { model.IsEnabled = 0; model.ts = DateTime.Now; model.modifyuser = UserID; new Hi.BLL.SYS_CompUser().Update(model, Tran); } Tran.Commit(); } catch { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } JScript.AlertMethod(this, "操作失败!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }"); } } ListRole[0].IsEnabled = 0; ListRole[0].ts = DateTime.Now; ListRole[0].modifyuser = UserID; if (new Hi.BLL.SYS_Role().Update(ListRole[0])) { Response.Redirect("RoleList.aspx"); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { //定义冲正的变量 string txtPayCorrectDis = string.Empty; string txtPayCorrectPrice = string.Empty; //string txtPayCorrectDate = string.Empty; string txtPayCorrectType = string.Empty; string txtPayCorrectRemark = string.Empty; //获取补录金额,输入的数据 txtPayCorrectPrice = Common.NoHTML(this.txtPayCorrectPrice.Value.Trim()); if (Convert.ToDecimal(txtPayCorrectPrice) <= 0) { JScript.AlertMethod(this, "操作失败,补录金额不能小于或等于零!", JScript.IconOption.错误, "function (){ location.replace(); }");//'" + ("PayCreateAdd.aspx?UID="+Uid) + "' return; } txtPayCorrectRemark = Common.NoHTML(this.txtRemark.Value.Trim()); txtPayCorrectDis = Common.NoHTML(this.hidDisUserID.Value);// this.DisListID.Disid;//获取代理商ID //调用model,对属性进行赋值 Hi.Model.PAY_PrePayment prepaymentmodel = new Hi.Model.PAY_PrePayment(); prepaymentmodel.CompID = this.CompID; prepaymentmodel.PreType = 2; prepaymentmodel.vdef3 = this.ddltype.Value;//来源 prepaymentmodel.DisID = Convert.ToInt32(txtPayCorrectDis); prepaymentmodel.Start = 1; prepaymentmodel.price = Convert.ToDecimal(txtPayCorrectPrice); prepaymentmodel.Paytime = DateTime.Now; prepaymentmodel.CreatDate = DateTime.Now; prepaymentmodel.CrateUser = this.UserID; prepaymentmodel.AuditState = 2;//2已审,0 未审 prepaymentmodel.IsEnabled = 1; prepaymentmodel.ts = DateTime.Now; prepaymentmodel.dr = 0; prepaymentmodel.modifyuser = this.UserID; prepaymentmodel.vdef1 = txtPayCorrectRemark; prepaymentmodel.vdef5 = hrOrderFj.Value; //保存附件的名称 prepaymentmodel.vdef6 = ddlPaytype.Value; //支付方式 //调用保存方法 Hi.BLL.PAY_PrePayment prepaymentsave = new Hi.BLL.PAY_PrePayment(); int reslut = prepaymentsave.Add(prepaymentmodel); //判断返回值int if (reslut > 0) { Utils.AddSysBusinessLog(this.CompID, "PrePayment", reslut.ToString(), "预收款补录新增", prepaymentmodel.vdef1); // JScript.AlertMsg(this, "操作成功", "PayCreateInfo.aspx?KeyID=" + reslut); Response.Redirect("PayCreateInfo.aspx?KeyID=" + Common.DesEncrypt(reslut.ToString(), Common.EncryptKey)); } else { JScript.AlertMethod(this, "操作失败!", JScript.IconOption.错误, "function (){ location.replace(); }");//'" + ("PayCreateInfo.aspx") + "' } }
protected void btn_NUse(object sender, EventArgs e) { Hi.Model.BD_Distributor Dis = new Hi.BLL.BD_Distributor().GetModel(KeyID); string sql = "select * from SYS_CompUser where ISNULL(dr,0)=0 and DisID=" + KeyID; DataTable userDT = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0]; if (userDT.Rows.Count > 0) { SqlTransaction Tran = null; try { Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); for (int i = 0; i < userDT.Rows.Count; i++) { Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(Convert.ToInt32(userDT.Rows[i]["ID"].ToString())); user.IsEnabled = 0; user.ts = DateTime.Now; user.modifyuser = UserID; new Hi.BLL.SYS_CompUser().Update(user, Tran); } Tran.Commit(); } catch { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } JScript.AlertMethod(this, "操作失败!", JScript.IconOption.错误, "function(){ window.location.href=window.location.href; }"); } } } if (Dis != null) { Dis.IsEnabled = 0; Dis.ts = DateTime.Now; Dis.modifyuser = UserID; if (new Hi.BLL.BD_Distributor().Update(Dis)) { if (Request["nextstep"] + "" == "1") { Response.Redirect("DisList.aspx?nextstep=1"); } else { Response.Redirect("DisInfo.aspx?KeyID=" + KeyID.ToString() + "&type=2"); } } } }
public bool IsFind() { int pageCount = 0; int Counts = 0; string JoinTableStr = " BD_RebateDetail join Dis_order as Dorder on Dorder.id=BD_RebateDetail.orderid "; DataTable LRobate = new Hi.BLL.BD_RebateDetail().GetList(1, 1, " BD_RebateDetail.createdate ", true, " ReceiptNo,BD_RebateDetail.Amount,BD_RebateDetail.CreateDate ", JoinTableStr, " and RebateID=" + KeyID + " and BD_RebateDetail.dr=0 ", out pageCount, out Counts); if (LRobate.Rows.Count > 0) { JScript.AlertMethod(this, "返利已被使用,不允许修改", JScript.IconOption.错误, "function(){ history.go(-1); }"); } return(LRobate.Rows.Count > 0); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { user = this.CompUser; if (user.UserPwd == Util.md5("123456")) { JScript.AlertMethod(this, "检测到您的登录密码为系统默认密码,请先修改您的登录密码!", JScript.IconOption.错误, "function(){location.href='ChangePwd.aspx?IsDpwd=1'}"); return; } } }
protected void btn_Del(object sender, EventArgs e) { Hi.Model.SYS_CompUser user = new Hi.BLL.SYS_CompUser().GetModel(KeyID); if (user != null) { user.dr = 1; user.modifyuser = UserID; user.ts = DateTime.Now; if (new Hi.BLL.SYS_CompUser().Update(user)) { JScript.AlertMethod(this, "用户删除成功!", JScript.IconOption.正确, "function(){ window.location.href='DisUserList.aspx'; }"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (HttpContext.Current.Session["DisTable"] != null) { DataTable dt = HttpContext.Current.Session["DisTable"] as DataTable; rptDis.DataSource = dt; rptDis.DataBind(); } else { JScript.AlertMethod(this, "请先导入", JScript.IconOption.错误, "function(){location.href='ImportGoods.aspx'}"); } } }
public void Bind() { Hi.Model.PAY_PrePayment prepayM = new Hi.BLL.PAY_PrePayment().GetModel(KeyID); if (prepayM == null) { JScript.AlertMethod(this, "该记录无效!", JScript.IconOption.错误, "function (){ location.replace('" + ("PrePayList.aspx") + "'); }"); return; } //支付金额小于0,直接支付失败 if (prepayM.price <= 0) { Response.Redirect("Error.aspx?type=" + Common.DesEncrypt("2", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)); return; } if (prepayM.Start == 1) { Response.Redirect("Error.aspx?type=" + Common.DesEncrypt("2", Common.EncryptKey) + "&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey)); return; } this.hidKeyID.Value = Convert.ToString(KeyID); this.lblOrderNO.InnerText = prepayM.guid; // KeyID.ToString(); this.lblPrice.InnerText = prepayM.price.ToString("0.00");; string username = this.UserName; string strWhere = string.Empty; if (this.DisID != 0) { strWhere += " DisID = '" + this.DisID + "' "; } else { JScript.AlertMsgOne(this, "操作员没有对应的代理商!", JScript.IconOption.错误); return; } strWhere += " and Start = 1 and vdef6 = 0 and isnull(dr,0)=0"; List <Hi.Model.PAY_FastPayMent> fastList = new Hi.BLL.PAY_FastPayMent().GetList("", strWhere, ""); this.rptQpay.DataSource = fastList; this.rptQpay.DataBind(); List <Hi.Model.PAY_BankInfo> BankL = new Hi.BLL.PAY_BankInfo().GetList("", " vdef1=0", ""); this.rptOtherBank.DataSource = BankL; this.rptOtherBank.DataBind(); }
protected void btnEdit_Click(object sender, EventArgs e) { string Typename = Common.NoHTML(txtTypeNames.Value.Trim()); string id = Common.NoHTML(hideTypeIds.Value.Trim()); //string sortid = txtSortIndexs.Value.Trim(); //string typecode = txtTypecodes.Value.Trim(); int Result = 0; if (string.IsNullOrEmpty(Typename)) { JScript.AlertMethod(this, "分类名称不能为空", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } if (IsExistsType("TypeName", Typename, id)) { JScript.AlertMethod(this, "此分类名已存在", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } if (int.TryParse(id, out Result)) { Hi.Model.BD_DisType DisType = new Hi.BLL.BD_DisType().GetModel(Result); if (DisType != null) { DisType.TypeName = Typename; //DisType.SortIndex = sortid; //DisType.TypeCode = typecode; DisType.ts = DateTime.Now; DisType.modifyuser = 0; if (new Hi.BLL.BD_DisType().Update(DisType)) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Result2", "<script>location.href='DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "&lefttype=" + Request["lefttype"] + "&type=" + Request["type"] + "';</script>"); } } else { JScript.AlertMethod(this, "此分类不存在", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } } else { JScript.AlertMethod(this, "分类ID错误", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } }
protected void btnAdd_Click(object sender, EventArgs e) { string Typename = Common.NoHTML(txtTypeName.Value.Trim()); string Parentid = Common.NoHTML(hideTypeId.Value.Trim()); string sortid = NewCateId().ToString(); //string Typecode = txtTypecode.Value.Trim(); Hi.Model.BD_DisType DisType = new Hi.Model.BD_DisType(); int Result = 0; if (string.IsNullOrEmpty(Typename)) { JScript.AlertMethod(this, "分类名称不能为空", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } if (IsExistsType("TypeName", Typename)) { JScript.AlertMethod(this, "此分类名已存在", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } if (string.IsNullOrEmpty(Parentid) || !int.TryParse(Parentid, out Result)) { DisType.ParentId = 0; } else { DisType.ParentId = Result; } DisType.CompID = CompID; DisType.TypeName = Typename; //DisType.TypeCode = Typecode; DisType.SortIndex = sortid; DisType.CreateDate = DateTime.Now; DisType.CreateUserID = 0; DisType.ts = DateTime.Now; DisType.modifyuser = 0; if (new Hi.BLL.BD_DisType().Add(DisType) > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Result", "<script>location.href='DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "&lefttype=" + Request["lefttype"] + "&type=" + Request["type"] + "';</script>"); } else { JScript.AlertMethod(this, "添加失败", JScript.IconOption.错误, "function (){ location.replace('" + ("DisTypeList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); } }
public void DataBinds() { ////string strTitle = "角色新增"; //if (Request["title"] == "1") //{ // atitle.InnerText = "我要开通"; // btitle.InnerText = "设置岗位权限"; //} //int RoleID = Convert.ToInt32(Session["RoleID"]); if (KeyID != 0) { try { //strTitle = "角色编辑"; this.btnAdd.Text = "确定"; Hi.Model.SYS_Role role = new Hi.BLL.SYS_Role().GetModel(KeyID); if (role != null) { txtRoleName.Text = role.RoleName; if (role.RoleName == "企业管理员") { txtRoleName.Enabled = false; } txtRemark.Value = role.Remark; txtSortIndex.Value = role.SortIndex; if (role.IsEnabled != 1) { rdAuditNo.Checked = true; rdAuditYes.Checked = false; } } else { JScript.AlertMethod(this, "数据不存在!", JScript.IconOption.错误, "function (){ location.replace('" + ("RoleList.aspx") + "'); }"); return; } } catch (Exception ex) { throw ex; } } //lblTitle.InnerText = strTitle; }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { DataTable dt = Common.GoodsIsExist(this.CompID.ToString()); if (dt.Rows.Count != 0) { string strmsg = string.Empty; foreach (RepeaterItem row in this.rptGoodsInfo.Items) { CheckBox cb = row.FindControl("CB_SelItem") as CheckBox; if (cb != null && cb.Checked) { HiddenField fld = row.FindControl("HF_GoodsName") as HiddenField; HiddenField fld2 = row.FindControl("HF_Id") as HiddenField; if (fld != null) { string name = fld.Value; int id = Convert.ToInt32(fld2.Value); for (int i = 0; i < dt.Rows.Count; i++) { if (id == Convert.ToInt32(dt.Rows[i]["goodsInfoid"])) { strmsg += "-" + name + "\\r\\n"; } } } } } if (!Util.IsEmpty(strmsg)) { JScript.AlertMethod(this, strmsg + "已有订单存在商品,不能删除", JScript.IconOption.错误); return; } else { DelGoods(); } } else { DelGoods(); } Bind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (HttpContext.Current.Session["GoodsTable"] != null) { DataTable dt = HttpContext.Current.Session["GoodsTable"] as DataTable; int cg = 0; //导入成功的条数 int sb = 0; //导入失败的条数 string errorli = string.Empty; //错误列表 for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["chkstr"].ToString() == "数据正确!") { cg++; } else { sb++; errorli += "<li>" + dt.Rows[i]["chkstr"] + "</li>"; } } string str = string.Empty;//是否显示导入成功 if (cg == dt.Rows.Count) { str = " $(\".imNo\").eq(1).show();$(\".imNo\").eq(0).hide();"; } else { str = " $(\".imNo\").eq(0).show();$(\".imNo\").eq(1).hide();"; } //var result= from p in dt.AsEnumerable() select new { rowcount = p.Field<int>("rowcount"),count= p.Field<int>("count") }; ClientScript.RegisterClientScriptBlock(this.GetType(), "daoru", "<script>$(function(){$(\".oclor2\").text(" + dt.Rows.Count + ");$(\".oclor1\").text(" + cg + ");$(\".oclor3\").text(" + sb + ");" + str + " $(\".le2\").html(\"" + errorli + "\");})</script>"); HttpContext.Current.Session["GoodsTable2"] = null; HttpContext.Current.Session["GoodsTable2"] = dt; HttpContext.Current.Session["GoodsTable"] = null; } else { JScript.AlertMethod(this, "请先导入", JScript.IconOption.错误, "function(){location.href='ImportGoods.aspx'}"); } } }
protected void btnModify_Click(object sender, EventArgs e) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(UserID); string OldLoginPwd = this.txtOldPassWord.Value.Trim().ToString(); string NewLoginPwd = this.txtNewPassWord.Value.Trim().ToString(); string ConfrimNewPassWord = this.txtConfrimNewPassWord.Value.Trim(); //修改的密码,两次填写不一致 if (ConfrimNewPassWord == NewLoginPwd) { if (User.UserPwd.ToString() == OldLoginPwd) { if (OldLoginPwd == NewLoginPwd) { JScript.AlertMsgOne(this, "新密码不能跟老密码一样,请重新输入!", JScript.IconOption.错误); return; } else if (NewLoginPwd == Util.md5("123456")) { JScript.AlertMsgOne(this, "新密码不能设置为系统默认密码,请重新输入!", JScript.IconOption.错误); return; } else { if (new Hi.BLL.SYS_Users().UpdatePassWord(NewLoginPwd, UserID.ToString())) { ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>$(window.parent.leftFrame.document).find('.menuson').css('display','none');</script>"); JScript.AlertMethod(this, "修改成功", JScript.IconOption.正确, "function(){ window.location.href='jsc.aspx'; }"); } } } else { JScript.AlertMsgOne(this, "原始密码错误,请重新输入!", JScript.IconOption.错误); return; } } else { JScript.AlertMsgOne(this, "密码填写不一致!", JScript.IconOption.错误); return; } }
protected void btnAdd_Click(object sender, EventArgs e) { string Areaname = Common.NoHTML(txtAreaName.Value.Trim()); string Parentid = Common.NoHTML(hideAreaId.Value.Trim()); string sortid = Common.NoHTML(txtSortIndex.Value.Trim()); //string areacode = txtAreacode.Value.Trim(); Hi.Model.BD_DisArea DisArea = new Hi.Model.BD_DisArea(); int Result = 0; if (string.IsNullOrEmpty(Areaname)) { JScript.AlertMethod(this, "分类名称不能为空", JScript.IconOption.错误, "function (){ location.replace('" + ("DisAreaList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } if (IsExistsArea("AreaName", Areaname)) { JScript.AlertMethod(this, "此分类名已存在!", JScript.IconOption.错误, "function (){ location.replace('" + ("DisAreaList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); return; } if (string.IsNullOrEmpty(Parentid) || !int.TryParse(Parentid, out Result)) { DisArea.ParentID = 0; } else { DisArea.ParentID = Result; } DisArea.CompanyID = CompID; DisArea.AreaName = Areaname; //DisArea.Areacode = areacode; DisArea.SortIndex = sortid; DisArea.ts = DateTime.Now; DisArea.modifyuser = 0; if (new Hi.BLL.BD_DisArea().Add(DisArea) > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "Result", "<script>location.href='DisAreaList.aspx?page=" + Pager.CurrentPageIndex + "&lefttype=" + Request["lefttype"] + "&type=" + Request["type"] + "';</script>"); } else { JScript.AlertMethod(this, "添加失败!", JScript.IconOption.错误, "function (){ location.replace('" + ("DisAreaList.aspx?page=" + Pager.CurrentPageIndex + "") + "'); }"); } }
/// <summary> /// 取消删除最新插入 /// </summary> /// <param name="id"></param> /// <returns></returns> public string DelAttr(int id) { SqlTransaction Tran = Tran = DBUtility.SqlHelper.CreateStoreTranSaction(); try { Hi.Model.BD_Attribute model = new Hi.BLL.BD_Attribute().GetModel(id, Tran); model.dr = 1; model.modifyuser = this.UserID; model.ts = DateTime.Now; new Hi.BLL.BD_Attribute().Update(model, Tran); List <Hi.Model.BD_AttributeValues> l = new Hi.BLL.BD_AttributeValues().GetList("", "isnull(dr,0)=0 and compid=" + this.CompID + " and attributeid=" + id, "", Tran); if (l.Count > 0) { foreach (Hi.Model.BD_AttributeValues item in l) { Hi.Model.BD_AttributeValues model2 = new Hi.BLL.BD_AttributeValues().GetModel(item.ID, Tran); model2.dr = 1; model2.modifyuser = this.UserID; model2.ts = DateTime.Now; new Hi.BLL.BD_AttributeValues().Update(model2, Tran); } } Tran.Commit(); return("cg"); } catch (Exception ex) { if (Tran != null) { if (Tran.Connection != null) { Tran.Rollback(); } } JScript.AlertMethod(this, "失败", JScript.IconOption.错误); return(""); } finally { DBUtility.SqlHelper.ConnectionClose(); } }
/// <summary> /// 编辑属性 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnEdit_Click(object sender, EventArgs e) { try { //赋值 string attributeName = Common.NoHTML(txtAttributeNames.Value.Trim()); //属性名称 string memo = Common.NoHTML(txtMemos.Value.Trim()); //属性备注 Hi.Model.BD_Attribute attribute = new Hi.BLL.BD_Attribute().GetModel(Convert.ToInt32(hideAttrId.Value)); var list = new Hi.BLL.BD_Attribute().GetList("", "id<>" + hideAttrId.Value + " and attributename='" + attributeName + "' and ISNULL(dr,0)=0 and compid=" + this.CompID, ""); if (list.Count > 0) { JScript.AlertMethod(this, "属性名称已存在", JScript.IconOption.错误); return; } else { attribute.AttributeName = attributeName; } attribute.AttributeName = attributeName; attribute.Memo = memo; attribute.CreateUserID = this.UserID; attribute.ts = DateTime.Now; attribute.CompID = this.CompID; attribute.modifyuser = this.UserID; attribute.IsEnabled = 1; /*****执行*****/ bool k = new Hi.BLL.BD_Attribute().Update(attribute); if (k) { Bind(); txtAttributeNames.Value = string.Empty; } else { JScript.AlertMethod(this, "属性编辑失败", JScript.IconOption.错误); return; } } catch (Exception ex) { throw ex; } }
protected void A_DLT(object sender, EventArgs e) { HtmlAnchor adefat = sender as HtmlAnchor; string dltID = adefat.Attributes["deleteid"]; if (!string.IsNullOrEmpty(dltID)) { Hi.Model.BD_DisAddr disaddr = new Hi.BLL.BD_DisAddr().GetModel(int.Parse(dltID)); if (disaddr != null) { disaddr.dr = 1; disaddr.ts = DateTime.Now; disaddr.modifyuser = this.UserID; if (new Hi.BLL.BD_DisAddr().Update(disaddr)) { JScript.AlertMethod(this, "删除成功", JScript.IconOption.正确, "function (){ location.replace('" + ("DeliveryList.aspx") + "'); }"); } } } }
protected void btnSave_Click(object sender, EventArgs e) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(CompID); if (comp != null) { comp.Tel = Common.NoHTML(txtTel.Value.Trim()); comp.Fax = Common.NoHTML(txtFax.Value.Trim()); comp.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); comp.Address = Common.NoHTML(txtAddress.Value.Trim()); if (txtPhone.Value.Trim() != "") { comp.Phone = Common.NoHTML(txtPhone.Value.Trim()); } else { List <Hi.Model.SYS_CompUser> User2 = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and utype=4 and CompID=" + CompID + "", ""); if (User2.Count > 0) { Hi.Model.SYS_Users User = new Hi.BLL.SYS_Users().GetModel(User2[0].UserID); if (User != null) { comp.Phone = Common.NoHTML(User.Phone); } } } comp.BrandInfo = Common.NoHTML(this.BrandIfon.Value.Trim()); comp.CompLogo = Common.NoHTML(HDCompPath.Value); comp.CustomCompinfo = txtCustomInfo.Text; if (new Hi.BLL.BD_Company().Update(comp)) { if (Request["nextstep"] + "" == "1") { JScript.AlertMethod(this, "恭喜您成功入驻医站通,您的商城您做主,尽情享受您的电商之旅吧!", JScript.IconOption.笑脸, "function () { onlinkOrder('../newOrder/orderBuy.aspx', 'dkxd') }"); } else { Response.Redirect("CompInfo.aspx"); } } } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { DataTable dt = Common.GoodsIsExist2(this.CompID.ToString()); if (dt.Rows.Count != 0) { string strmsg = string.Empty; foreach (RepeaterItem row in this.rptGoods.Items) { CheckBox cb = row.FindControl("CB_SelItem") as CheckBox; if (cb != null && cb.Checked) { HiddenField fld = row.FindControl("HF_GoodsName") as HiddenField; HiddenField fld2 = row.FindControl("HF_Id") as HiddenField; if (fld != null) { string name = fld.Value; int id = fld2.Value.ToInt(0); DataRow[] rows = dt.Select(" GoodsID ='" + id + "'"); if (rows.Length > 0) { strmsg += "商品名:" + name + "<br>"; } } } } if (!Util.IsEmpty(strmsg)) { JScript.AlertMethod(this, strmsg + "已有订单存在商品,不能删除", JScript.IconOption.错误); } else { DelGoods(); } } else { DelGoods(); } Bind(); }