/// <summary> /// 删除发货单方法 /// </summary> /// <param name="storeId"></param> /// <returns></returns> public static Boolean DelGoodsOrder(string storeOrderID) { Boolean temp = true; string connString = DBHelper.connString; SqlTransaction tr = null; SqlConnection conn = new SqlConnection(connString); conn.Open(); tr = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("StoreOrder", "storeOrderID"); cl_h_info.AddRecordtran(tr, storeOrderID); cl_h_info.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.Order, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.Company); StockDAL.DelGoodsOrder(tr, OrderDetailDAL.GetOrderDetail(storeOrderID), StoreOrderDAL.GetStoreIdByOrderId(storeOrderID)); //还原店库存 OrderDetailDAL.DelOrderDetailItem(tr, storeOrderID); //明细表删除失败回滚 StoreOrderDAL.DelStoreOrder(storeOrderID, tr); //订单表删除失败回滚 tr.Commit(); } catch { temp = false; tr.Rollback(); } finally { // tr.Connection.Close(); tr.Dispose(); conn.Close(); } return(temp); }
/// <summary> /// 删除国家 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gvCountry_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "DelCountry") { int Id = Convert.ToInt32(e.CommandArgument); //Judge the CountryCode whether has operation before delete by Id int getCount = SetRateBLL.CountryCodeWhetherHasOperation(Id); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002151", "该国家已经发生了业务,因此不能删除!"))); return; } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Country", "Id"); cl_h_info.AddRecord(Id); ///删除指定的国家记录 int delCount = SetRateBLL.DelCountryByID(Id); if (delCount > 0) { cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company38, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002154", "删除国家成功!"))); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002156", "删除国家失败,请联系管理员!"))); } } GetCountryInfo(); } }
/// <summary> /// 删除会员自由购物信息 /// </summary> /// <param name="CommandArgument"></param> private void Delete(string CommandArgument) { //ispay判断是否确认过 string isPay = null; string[] parms = CommandArgument.Split('|'); double totalPV = new AddFreeOrderDAL().GetTotalPV(parms[2], out isPay); double lackproductmoney = new AddFreeOrderDAL().GetTotalmoney(parms[2]); int maxExcept = BLL.CommonClass.CommonDataBLL.getMaxqishu(); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类 cl_h_info.AddRecord(parms[2]); //添加日志,修改前记录原来数据 string result = auditingMemberagainBLL.DelMembersDeclaration(parms[2], totalPV, parms[0], maxExcept, parms[3], lackproductmoney); if (result == null) { cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.store3, Session["Store"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype5);//插入日志 ScriptHelper.SetAlert(Page, GetTran("000749", "删除成功!")); //重新绑定 BindData(); } else { ScriptHelper.SetAlert(Page, result); } }
/// <summary> /// 删除指定的适用人群信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { int productSexTypeId = Convert.ToInt32(e.CommandArgument); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSexType", "ProductSexTypeID"); //Judge the ProductSexTypeId whether exist by Id before delete or update int isExistCount = SetParametersBLL.ProductSexTypeIdIsExist(productSexTypeId); if (isExistCount > 0) { //Judge the ProductSexTypeId whether has operation before delete by Id int getCount = SetParametersBLL.ProductSexTypeIdWhetherHasOperation(productSexTypeId); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002220", "对不起,该适用人群已经发生了业务,因此不能删除!"))); divProductSexType.Visible = false; return; } else { //Delete the ProductSexType information by productSexTypeId using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); using (SqlTransaction tran = conn.BeginTransaction()) { try { cl_h_info.AddRecordtran(tran, productSexTypeId.ToString()); SetParametersBLL.DelProductSexTypeByID(tran, productSexTypeId); language.RemoveTranslationRecord(tran, "ProductSexType", productSexTypeId); cl_h_info.DeletedIntoLogstran(tran, ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); tran.Commit(); } catch { tran.Rollback(); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002223", "删除适用人群失败,请联系管理员!"))); return; } Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002222", "删除适用人群成功!"))); } } } } else { divProductSexType.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002219", "对不起,该适用人群不存在或者已经被删除!"))); return; } DataBindProductSexType(); }
/// <summary> /// 删除复消单 /// </summary> public string DelOredrAgain(string orderId, double totalPv, string number, int except, string storeId) { double totalMoney = AddOrderDataDAL.GetTotalMoneyByOrderId(orderId); MemberOrderModel order = MemberOrderDAL.GetMemberOrder(orderId); string info = null; using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类 cl_h_info.AddRecordtran(tran, orderId); //添加日志,修改前记录原来数据 //如果该订单不存在 if (!BrowsememberordersDAL.CheckOrderIdExists(orderId)) { info = BLL.Translation.Translate("001661", "抱歉,该订单不存在!"); tran.Rollback(); conn.Close(); return(info); } if (order.DefrayState == 1) { if (totalMoney > 0) { D_AccountBLL.AddAccount(storeId, totalMoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金扣添加,订单号为【" + orderId + "】", tran); if (order.DefrayType == 2) { IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.TotalMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单删除现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.TotalMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单删除现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } int result = addOrderDataDAL.Js_delfuxiao(number, totalPv, except, 1, tran); } //删除复消单 addOrderDataDAL.Del_Horder(tran, orderId, storeId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); cl_h_info.DeletedIntoLogstran(tran, BLL.CommonClass.ChangeCategory.store1, orderId, BLL.CommonClass.ENUM_USERTYPE.objecttype5);//插入日志 tran.Commit(); } catch { info = BLL.Translation.Translate("000417", "删除失败!"); tran.Rollback(); } finally { conn.Close(); conn.Dispose(); } } return(info); }
public void reset() { if (newPassword.Text != "" && newPassword2.Text != "" && oldPassword.Text != "") { if (newPassword.Text.Trim().Length < 4 || newPassword.Text.Trim().Length > 10) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001361", "密码长度必须在4到10之间!") + "')</script>"); return; } if (newPassword.Text != newPassword2.Text) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001617", "两次密码不一样!") + "')</script>"); return; } string Member = Session["Member"].ToString(); string NewPass = Encryption.Encryption.GetEncryptionPwd(this.newPassword.Text.ToString(), Session["Member"].ToString()); string oldPass = Encryption.Encryption.GetEncryptionPwd(this.oldPassword.Text.ToString(), Session["Member"].ToString()); int n = PwdModifyBLL.check(Member, oldPass, int.Parse(this.passtype.SelectedValue)); string str = ""; if (int.Parse(this.passtype.SelectedValue) == 0) { str = GetTran("006057", "一级密码"); } else { str = GetTran("006056", "二级密码"); } if (n > 0) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Memberinfo", "ltrim(rtrim(number))"); cl_h_info.AddRecord(Member); int i = 0; i = PwdModifyBLL.updateMemberPass(Member, NewPass, int.Parse(this.passtype.SelectedValue)); if (i > 0) { cl_h_info.AddRecord(Member); cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.member3, Session["Member"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype6); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + GetTran("000222", "修改成功") + "')</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + GetTran("000225", "修改失败!") + "')</script>"); } } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001624", "原始密码不正确,请准确填写!") + "')</script>"); return; } } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001626", "密码不能为空!") + "')</script>"); return; } }
/// <summary> /// 行触发命令 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void givProviderInfo_RowCommand(object sender, GridViewCommandEventArgs e) { string name = e.CommandName; int id = Convert.ToInt32(e.CommandArgument); int isExistCount = ProviderManageBLL.ProviderIdIsExist(id); if (isExistCount > 0) { if (name == "Del") { Permissions.CheckManagePermission(EnumCompanyPermission.CustomerProviderViewEditDelete); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProviderInfo", "(ltrim(rtrim(id)))"); cl_h_info.AddRecord(Convert.ToInt32(id)); int getCount = ProviderManageBLL.ProviderIdWhetherHasOperation(id); if (getCount > 0) { msg = Transforms.ReturnAlert(GetTran("001356", "对不起,该供应商已经发生了业务,因此不能删除!")); return; } else { int delCount = ProviderManageBLL.Delprivider(id); if (delCount > 0) { cl_h_info.AddRecord(Convert.ToInt32(id)); //不能放到事务中 修改数据后 cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company6, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype4); //不能放到事务中 msg = Transforms.ReturnAlert(GetTran("000749", "删除成功!")); } else { msg = Transforms.ReturnAlert(GetTran("001387", "删除失败,请联系管理员!")); return; } } } else if (name == "Edit") { Response.Redirect("AddProvider.aspx?id=" + id); } } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001146", "对不起,该供应商不存在或者已经被删除!"))); } btnSearch_Click(null, null); }
/// <summary> /// Delete WareHouse by Id /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtnWareHouseDelete_Command(object sender, CommandEventArgs e) { bool isExists = DAL.WareHouseDAL.WareHouseisPermission(Session["Company"].ToString(), DAL.WareHouseDAL.GetWareControlByWareHoseID(int.Parse(e.CommandArgument.ToString()))); if (!isExists) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + GetTran("001702", "对不起,你没有权限") + "');</script>"); return; } int wareHouseId = Convert.ToInt32(e.CommandArgument); //Judge the WareHouseId whether exist by Id before delete or update int isExistCount = SetParametersBLL.WareHouseIdIsExist(wareHouseId); if (isExistCount > 0) { //Judge the WareHouseId whether has operation by Id before delete int getCount = SetParametersBLL.WareHouseIdWhetherHasOperation(wareHouseId); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001703", "对不起,该仓库已经发生了业务,因此不能删除!"))); return; } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("WareHouse", "WareHouseID"); cl_h_info.AddRecord(wareHouseId); //删除指定仓库信息 int delCount = SetParametersBLL.DelWareHouseByWareHouseID(wareHouseId); if (delCount > 0) { cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001704", "删除仓库成功!"))); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001705", "删除仓库失败,请联系管理员!"))); return; } } } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001699", "对不起,该仓库不存在或者已经被删除!"))); return; } DataBindWareHouseInfo(); }
public void reset() { var passtype = 0; var str = ""; if (inlineRadio1.Checked) { passtype = 0; str = "登录密码"; } else { passtype = 1; str = "支付密码"; } var member = Session["Member"]; if (member != null) { var number = member.ToString(); var NewPass = Encryption.Encryption.GetEncryptionPwd(this.newPassword.Text.ToString(), number); var oldPass = Encryption.Encryption.GetEncryptionPwd(this.oldPassword.Text.ToString(), number); int n = PwdModifyBLL.check(number, oldPass, passtype); if (n > 0) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("Memberinfo", "ltrim(rtrim(number))"); cl_h_info.AddRecord(number); int i = 0; i = PwdModifyBLL.updateMemberPass(number, NewPass, passtype); if (i > 0) { cl_h_info.AddRecord(number); cl_h_info.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.member3, number, BLL.CommonClass.ENUM_USERTYPE.objecttype6); Response.Redirect("SettingsIndex.aspx?res=success&&type=fanhui"); Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + "修改成功" + "')</script>"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('" + str + "修改失败!" + "')</script>"); } } else { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('原始密码不正确,请准确填写!')</script>"); return; } } }
/// <summary> /// 删除指定的产品规格信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { int productSpecId = Convert.ToInt32(e.CommandArgument); //Judge the ProductSpecId whether exist by Id before delete or update int isExistCount = SetParametersBLL.ProductSpecIdIsExist(productSpecId); if (isExistCount > 0) { //Judge the ProductSpecId whether has operation before delete by Id int getCount = SetParametersBLL.ProductSpecIdWhetherHasOperation(productSpecId); if (getCount > 0) { divProductSpec.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002277", "对不起,该规格已经发生了业务,因此不能删除!"))); return; } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSpec", "ProductSpecID"); cl_h_info.AddRecord(productSpecId); //删除指定产品规格信息 int delCount = SetParametersBLL.DelProductSpecByID(productSpecId); if (delCount > 0) { cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002278", "删除规格成功!"))); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002279", "删除规格失败,请联系管理员!"))); return; } } } else { divProductSpec.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002280", "对不起,该规格不存在或者已经被删除!"))); return; } DataBindProductSpec(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { Application.Lock(); if (e.CommandName == "D") { Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageDelete); int manageId = 0; try { manageId = int.Parse(e.CommandArgument.ToString()); } catch (FormatException) { ScriptHelper.SetAlert(Page, GetTran("001074", "管理员编号不存在!")); return; } ManageModel manageModel = ManagerBLL.GetManage(manageId); if (manageModel == null) { ScriptHelper.SetAlert(Page, GetTran("001076", "该记录已经被删除")); return; } string manageId1 = BLL.CommonClass.CommonDataBLL.getManageID(1); if (manageModel.Number.Trim() == manageId1) { ScriptHelper.SetAlert(Page, GetTran("001079", "不允许删除该记录!")); return; } string number = Session["Company"].ToString(); if (number != manageId1) { if (!DeptRoleBLL.CheckAllot(number, manageModel.RoleID)) { ScriptHelper.SetAlert((Control)sender, GetTran("001080", "不能对该管理员进行操作,没有权限!")); return; } } BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("manage", "id"); cl.AddRecord(manageId); if (ManagerBLL.DelManage(manageId) > 0) { cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company26, GetTran("001082", "管理员:") + manageModel.Number.Trim(), BLL.CommonClass.ENUM_USERTYPE.objecttype7); ScriptHelper.SetAlert((Control)sender, GetTran("000749", "删除成功!")); this.Pager1.PageBind(); } } Application.UnLock(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Del") { int id = Convert.ToInt32(e.CommandArgument); string managerID = Request.QueryString["manageID"].ToString(); BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("viewmanage", "id"); cl.AddRecord(id); if (ManagerBLL.DelViewManage(id) > 0) { cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company25, "管理员:" + managerID, BLL.CommonClass.ENUM_USERTYPE.objecttype7); msg = "<script>alert('删除成功!');</script>"; } PageSet(); } }
/// <summary> /// 删除指定的会员使用银行信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { int memberBankId = Convert.ToInt32(e.CommandArgument); //Judge the MemberBankId whether exist by Id before delete or update int isExistCount = SetParametersBLL.MemberBankIdIsExist(memberBankId); if (isExistCount > 0) { //Juage the MemberBankId whether has operation before delete by Id int getCount = SetParametersBLL.MemberBankIdWhetherHasOperation(memberBankId); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005387", "对不起,该银行发生了业务,因此不能删除!"))); divMemberBank.Visible = false; return; } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberBank", "BankID"); cl_h_info.AddRecord(memberBankId); //删除指定会员使用银行信息 int delCount = SetParametersBLL.DelMemberBankByID(memberBankId); if (delCount > 0) { cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005388", "删除银行成功!"))); divMemberBank.Visible = false; } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005389", "删除银行失败,请联系管理员!"))); return; } } } else { divMemberBank.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005390", "对不起,该银行不存在或者已经被删除!"))); return; } DataBindMemberBank(); }
/// <summary> /// 删除指定的单据类型信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { //Judge the DocTypeID whether exist by DocTypeID before delete or update int docTypeId = Convert.ToInt32(e.CommandArgument); int isExistCount = SetParametersBLL.DocTypeIDIsExist(docTypeId); if (isExistCount > 0) { int getCount = SetParametersBLL.DocTypeIDWhetherHasOperation(docTypeId); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005399", "对不起,该单据发生了业务,因此不能删除!"))); divDocTypeTable.Visible = false; return; } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("DocTypeTable", "DocTypeID"); cl_h_info.AddRecord(docTypeId); //删除指定单据类型信息 int delCount = SetParametersBLL.DelDocTypeTableByID(docTypeId); if (delCount > 0) { cl_h_info.AddRecord(docTypeId); cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005400", "删除单据类型成功!"))); divDocTypeTable.Visible = false; } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005401", "删除单据类型失败,请联系管理员!"))); return; } } } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("005402", "对不起,该单据不存在或该单据已经被删除!"))); return; } DataBindDocTypeTable(); }
/// <summary> /// 删除指定的城市信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { int cityID = Convert.ToInt32(e.CommandArgument); //Judge the CityId whether has operation by Id before delete int getCount = SetParametersBLL.CityIdWhetherHasOperation(cityID); if (getCount > 0) { divCity.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003250", "对不起,该城市已经发生了业务,因此不能删除!"))); return; } else { //Judge the CityID whether exist by Id before delete or update int isExistCount = SetParametersBLL.CityIdIsExist(cityID); if (isExistCount > 0) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("City", "ID"); cl_h_info.AddRecord(cityID); ///删除指定城市信息 int delCount = SetParametersBLL.DelCityByID(cityID); if (delCount > 0) { cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003249", "删除城市成功!"))); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003248", "删除城市失败,请联系管理员!"))); return; } } else { divCity.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003244", "对不起,该城市不存在或者已经被删除!"))); return; } } DataBindCity(); }
/// <summary> /// 更新仓库信息 /// </summary> private void UpdWareHouseInfo() { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("WareHouse", "WareHouseID"); cl_h_info.AddRecord(wareHouseModel.WareHouseID); ///更新指定的仓库信息 int updCount = SetParametersBLL.UpdWareHouseByWareHouseID(wareHouseModel); if (updCount > 0) { cl_h_info.AddRecord(wareHouseModel.WareHouseID); cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001693", "修改仓库信息成功!"))); } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("001694", "修改仓库信息失败,请联系管理员!"))); } }
/// <summary> /// 删除订单方法 /// </summary> /// <param name="storeId"></param> /// <returns></returns> public static Boolean DelStoreOrderItem(string storeOrderID) { Boolean temp = true; string connString = DBHelper.connString; SqlTransaction tr = null; SqlConnection conn = new SqlConnection(connString); conn.Open(); tr = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("OrderGoods", "ordergoodsID"); cl_h_info.AddRecordtran(tr, storeOrderID); BLL.CommonClass.ChangeLogs cl_h_info2 = new BLL.CommonClass.ChangeLogs("OrderGoodsDetail", "ordergoodsID"); cl_h_info2.AddRecordtran(tr, storeOrderID); StoreOrderDAL.DelStoreOrderItemProc(tr, storeOrderID); //StockDAL.DelStoreOrder(tr, OrderDetailDAL.GetOrderGoodsDetail(storeOrderID), StoreOrderDAL.GetStoreIdByGoodsId(storeOrderID));//还原店库存 //OrderDetailDAL.DelOrderGoodsDetail(tr, storeOrderID);//明细表删除失败回滚 //StoreOrderDAL.DelOrderGoods(storeOrderID, tr); //订单表删除失败回滚 cl_h_info.AddRecordtran(tr, storeOrderID); cl_h_info.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.store10, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.objecttype2); cl_h_info2.AddRecordtran(tr, storeOrderID); cl_h_info2.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.store10, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.objecttype2); tr.Commit(); } catch { temp = false; tr.Rollback(); } finally { // tr.Connection.Close(); tr.Dispose(); conn.Close(); } return(temp); }
protected void givSearchStoreInfo_RowCommand(object sender, GridViewCommandEventArgs e) { int ID = Convert.ToInt32(e.CommandArgument.ToString()); if (e.CommandName == "del") { GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer; string storeid = row.Cells[1].Text; int k = StoreInfoEditBLL.getMemberCount(storeid); if (k == 0) { int i = 0; StoreInfoEditBLL seb = new StoreInfoEditBLL(); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "(ltrim(rtrim(id)))"); cl_h_info.AddRecord(ID); i = seb.DelStore(ID); cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company4, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype2); if (i > 0) { //Response.Write("<script language='javascript'>alert('删除成功!')</script>"); this.msg = "<script language='javascript'>alert('" + GetTran("000749", "删除成功!") + "')</script>"; BtnSeach_Click(null, null); } else { //Response.Write("<script language='javascript'>alert('删除失败!')</script>"); this.msg = "<script language='javascript'>alert('" + GetTran("000417", "删除失败!") + "')</script>"; return; } } else { this.msg = "<script language='javascript'>alert('" + GetTran("000756", "对不起,该店铺已经发生了业务关系,不能删除!") + "')</script>"; return; } } else { BtnSeach_Click(null, null); } }
/// <summary> /// 修改城市信息 /// </summary> protected void UpdCityInfo() { ///修改指定城市信息 BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("City", "ID"); cl_h_info.AddRecord(cityModel.Id); int updCount = SetParametersBLL.UpdCityByID(cityModel); if (updCount > 0) { cl_h_info.AddRecord(cityModel.Id); cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003234", "修改城市成功!"))); divCity.Visible = false; } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003233", "修改城市失败,请联系管理员!"))); } }
protected void Button1_Click(object sender, EventArgs e) { for (int i = 0; i < this.GridView1.Rows.Count; i++) { if ((this.GridView1.Rows[i].FindControl("CheckBox1") as CheckBox).Checked) { string ss = ((HiddenField)GridView1.Rows[i].FindControl("HiddenField1")).Value; using (SqlConnection con = new SqlConnection(DAL.DBHelper.connString)) { con.Open(); SqlTransaction tran = con.BeginTransaction(); try { BLL.MobileSMS sms = new BLL.MobileSMS(); BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("h_mobileMsg", "ltrim(rtrim(str(id)))"); cl.AddRecordtran(tran, ss); sms.DelSMS(tran, ss); cl.AddRecordtran(tran, ss); cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company65, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10); tran.Commit(); } catch { tran.Rollback(); } finally { con.Close(); } } } } btnSearch_Click(null, null); }
protected void gvDeptRoless_RowCommand(object sender, GridViewCommandEventArgs e) { Application.Lock(); if (e.CommandName == "D") { Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightManageDelete); string number = Session["Company"].ToString(); int roleId = int.Parse(e.CommandArgument.ToString()); string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1);//返回当前登录管理员的编号,主要为了防止不超时 if (number != manageId) { if (!DeptRoleBLL.CheckAllot(number, roleId)) { ScriptHelper.SetAlert((Control)sender, GetTran("000975", "不能对该角色进行操作,没有权限!")); return; } } if (DeptRoleBLL.GetCountByRoleId(roleId) > 0) { ScriptHelper.SetAlert((Control)sender, GetTran("000977", "该角色下还存在管理员,请先删除该角色下的管理员!")); return; } else { BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("deptRole", "id"); cl.AddRecord(roleId); string msg = DeptRoleBLL.DelDeptRole(HttpContext.Current, int.Parse(e.CommandArgument.ToString())); if (msg == "删除角色成功.") { ScriptHelper.SetAlert((Control)sender, msg, "DeptRolesManage.aspx"); cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company25, GetTran("000981", "角色:") + int.Parse(e.CommandArgument.ToString()), BLL.CommonClass.ENUM_USERTYPE.objecttype7); } ScriptHelper.SetAlert((Control)sender, msg); PageSet(); } } Application.UnLock(); }
protected void givMessageSend_RowCommand(object sender, GridViewCommandEventArgs e) { BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); string name = e.CommandName; int id = Convert.ToInt32(e.CommandArgument.ToString()); if (name == "Del") { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MessageSend", "ltrim(rtrim(id))"); cl_h_info.AddRecord(id); cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company19, id.ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10); if (bll.delGongGao(id) > 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000008", "删除成功") + "!!!');</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000009", "删除失败") + "!!!');</script>"); } btnseach_Click(null, null); } else if ("Distal" == name) { Response.Redirect("ShowMessage.aspx?id=" + id); } else if ("GO" == name) { Response.Redirect("MessageContent.aspx?id=" + e.CommandArgument.ToString() + "&T=messagesend&source=ManageQueryGongGao.aspx"); } else { Response.Redirect("ManageAffiche.aspx?id=" + id); } }
protected void gvCompanyDepts_RowCommand(object sender, GridViewCommandEventArgs e) { Application.Lock(); if (e.CommandName == "D") { Permissions.CheckManagePermission(Model.Other.EnumCompanyPermission.SafeRightDpetManage); if (CompanyDeptBLL.GetDeptRoleCount(int.Parse(e.CommandArgument.ToString()))) { BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("companydept", "id"); cl.AddRecord(int.Parse(e.CommandArgument.ToString())); //部门是否存在 if (!CompanyDeptBLL.IsHaaveCompanyDept(int.Parse(e.CommandArgument.ToString()))) { ClientScript.RegisterStartupScript(this.GetType(), "提示", "alert('部门已经被删除!');", true); return; } if (CompanyDeptBLL.DelCompanyDept(int.Parse(e.CommandArgument.ToString()))) { cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company24, "部门:" + int.Parse(e.CommandArgument.ToString()), BLL.CommonClass.ENUM_USERTYPE.objecttype7); ScriptHelper.SetAlert(this.Page, "删除部门成功!"); PageSet(); } else { ScriptHelper.SetAlert(this.Page, "该部门已经删除,无法重复执行!"); PageSet(); } } else { ScriptHelper.SetAlert(this.Page, "该部门下已经安排有角色,请先删除角色再删除部门!"); } } Application.UnLock(); }
protected void BtnModify_Click(object sender, EventArgs e) { int id = (int)ViewState["id"]; if (this.txtDept.Text.Trim() == "") { ScriptHelper.SetAlert(this.Page, GetTran("001043", "请填写部门名称")); } else if (this.txtDept.Text.Trim().Length < 3) { ScriptHelper.SetAlert((Control)sender, GetTran("001034", "部门名称必须3个字符以上!")); } else { if (CompanyDeptBLL.CheckName(this.txtDept.Text.Trim(), id)) //是否重名,重名不能添加 { ScriptHelper.SetAlert(this.Page, GetTran("001036", "部门名称存在!")); } else { CompanyDeptModel comDept = new CompanyDeptModel(id); comDept.Dept = this.txtDept.Text.Trim(); BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("companyDept", "id"); cl.AddRecord(id); if (CompanyDeptBLL.UptCompanyDept(comDept)) { cl.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company24, GetTran("001047", "部门:") + id, BLL.CommonClass.ENUM_USERTYPE.objecttype7); ScriptHelper.SetAlert(this.Page, GetTran("001050", "修改部门成功"), "CompanyDeptManage.aspx"); } else { ScriptHelper.SetAlert(this.Page, GetTran("001052", "修改部门失败!"), "CompanyDeptManage.aspx"); } } } }
/// <summary> /// 提交事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { bool flag = SetValueProductSizeModel(); if (flag) { if ((int)ViewState["ID"] == 1) { ///获取指定产品尺寸的行数 int getCount = SetParametersBLL.GetProductSizeCountByName(txtProductSizeName.Text.Trim()); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002261", "该尺寸已经存在!"))); } else { //添加尺寸信息 int addCount = SetParametersBLL.AddProductSize(productSizeModel); if (addCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002263", "添加尺寸成功!"))); divProductSize.Visible = false; } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002264", "添加尺寸失败,请联系管理员!"))); } } } if ((int)ViewState["ID"] == 2) { ///获取指定产品尺寸的行数 int getCount = SetParametersBLL.GetProductSizeCountByIDName(Convert.ToInt32(ViewState["ProductSizeID"]), txtProductSizeName.Text.Trim()); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002261", "该尺寸已经存在!"))); } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSize", "ProductSizeID"); cl_h_info.AddRecord(productSizeModel.ProductSizeID); ///修改指定产品尺寸信息 int updCount = SetParametersBLL.UpdProductSizeByID(productSizeModel); if (updCount > 0) { cl_h_info.AddRecord(productSizeModel.ProductSizeID); cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002265", "修改尺寸成功!"))); divProductSize.Visible = false; } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002266", "修改尺寸失败,请联系管理员!"))); } } } DataBindProductSize(); } else { return; } }
/// <summary> /// 修改角色的操作事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUpt_Click(object sender, EventArgs e) { Application.Lock(); if (ViewState["roleid"] == null) { Response.Redirect("DeptRolesManage.aspx"); } if (txtRoleName.Text.Trim() == "") { ScriptHelper.SetAlert((Control)sender, GetTran("001183", "请输入角色名称!")); return; } else { if (this.txtRoleName.Text.Trim().Length < 3) { ScriptHelper.SetAlert((Control)sender, GetTran("000999", "角色名称必须3个字符以上!")); return; } } if (txtRoleName.Text != ViewState["Name"].ToString()) { if (DeptRoleBLL.CheckDeptRoleName(this.txtRoleName.Text.Trim(), (int)ViewState["roleid"]) != null) { ScriptHelper.SetAlert((Control)sender, GetTran("001001", "角色名称已经存在!")); return; } } int roleId = (int)ViewState["roleid"]; string number = Session["Company"].ToString(); string manageId = BLL.CommonClass.CommonDataBLL.getManageID(1); if (number != manageId) { if (!DeptRoleBLL.CheckAllot(number, roleId)) { ScriptHelper.SetAlert((Control)sender, GetTran("000975", "不能对该角色进行操作,没有权限!")); return; } } DeptRoleModel deptRole = new DeptRoleModel(roleId); deptRole.DeptID = int.Parse(this.ddlDepts.SelectedValue); string ids = Request.Form["qxCheckBox"]; //获取所有选中的菜单的值(pmID),在生成的页面可以查看(后台拼接而成),qxCheckBox是菜单的name(checkbox的name) string[] id = ids.Split(','); Hashtable htb = (Hashtable)Session["permission"]; htb = DeptRoleBLL.GetAllPermission(Session["Company"].ToString()); Hashtable htb2 = new Hashtable(); int i = -1; if (number != manageId) { foreach (string n in id) { if (htb.Contains(int.Parse(n))) { htb2.Add(n, "0"); } else { i = 0; } } } else { foreach (string n in id) { if (htb.Contains(int.Parse(n))) { htb2.Add(n, "0"); } } } if (i == -1) { BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("deptRole", "id"); cl.AddRecord(roleId); deptRole.htbPerssion = htb2; deptRole.Name = this.txtRoleName.Text.Trim(); deptRole.Allot = ((CheckBox)this.UCPermission1.FindControl("chkAllot")).Checked ? 1 : 0; if (DeptRoleBLL.UptDeptRole(deptRole)) //修改角色 { cl.AddRecord(roleId); cl.ModifiedIntoLogs(BLL.CommonClass.ChangeCategory.company25, "角色:" + deptRole.Name, BLL.CommonClass.ENUM_USERTYPE.objecttype7); ScriptHelper.SetAlert((Control)sender, GetTran("000001", "修改成功."), "DeptRolesManage.aspx"); } else { ScriptHelper.SetAlert((Control)sender, GetTran("000002", "修改失败."), "DeptRolesManage.aspx"); } } else { ScriptHelper.SetAlert((Control)sender, GetTran("001003", "异常数据"), "DeptRolesManage.aspx"); return; } Application.UnLock(); }
public static string UpdateMemberOrder(string OrderId, IList <MemberDetailsModel> list, MemberOrderModel memberOrderModel, string StoreID) { SqlConnection conn = new SqlConnection(DBHelper.connString); MemberOrderModel order = MemberOrderBLL.GetMemberOrder(memberOrderModel.OrderId); SqlTransaction tran = null; try { conn.Open(); tran = conn.BeginTransaction(); SqlCommand cmd = new SqlCommand(); cmd.Transaction = tran; cmd.Connection = conn; DataTable dhpv = DBHelper.ExecuteDataTable(tran, "select totalpv,LackProductMoney from MemberOrder where OrderID='" + OrderId + "'"); if (memberOrderModel.PayExpect != -1 && memberOrderModel.DefrayState == 1) { if (Convert.ToDecimal(dhpv.Rows[0]["totalpv"]) != memberOrderModel.TotalPv) { //修改后需重新结算 cmd.CommandText = "update config set jsflag='0' where ExpectNum>='" + memberOrderModel.PayExpect + "'"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } if (memberOrderModel.DefrayState == 1) { decimal oldlackproductmoney = Convert.ToDecimal(dhpv.Rows[0]["LackProductMoney"]); if (memberOrderModel.LackProductMoney != oldlackproductmoney) { D_AccountBLL.AddAccount(StoreID, Convert.ToDouble(oldlackproductmoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "店铺[" + StoreID + "]修改订单[" + order.OrderId + "]退回钱[" + oldlackproductmoney + "]", tran); //D_AccountBLL.AddAccount(StoreID, Convert.ToDouble(memberOrderModel.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "店铺[" + StoreID + "]修改订单[" + memberOrderModel.OrderId + "]扣除钱[" + memberOrderModel.LackProductMoney + "]", tran); if (order.DefrayType == 2) { new MemberOrderBLL().IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单修改现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } } int res = 0; SqlParameter[] del_parm = { new SqlParameter("@OrderID", OrderId), new SqlParameter("@StoreID", StoreID), new SqlParameter("@Type", 1), new SqlParameter("@res", res), new SqlParameter("@opnum", memberOrderModel.OperateNumber), new SqlParameter("@opip", memberOrderModel.OperateIp), }; BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberOrder", "ltrim(rtrim(OrderID))"); cl_h_info.AddRecordtran(tran, OrderId); BLL.CommonClass.ChangeLogs cl_h_info1 = new BLL.CommonClass.ChangeLogs("MemberDetails", "ltrim(rtrim(OrderID))"); cl_h_info1.AddRecordtran(tran, OrderId); DBHelper.ExecuteNonQuery(tran, "Delete_H_Order", del_parm, CommandType.StoredProcedure); if (Convert.ToInt32(del_parm[3].Value) == 0) { //添加订单 new AddOrderBLL().SaveHOrder(tran, list, memberOrderModel); cl_h_info.AddRecordtran(tran, OrderId); cl_h_info1.AddRecordtran(tran, OrderId); if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar(tran, "select count(1) from MemberDetails where OrderId='" + OrderId + "'", CommandType.Text)) > 0) { cl_h_info.ModifiedIntoLogstran(tran, ChangeCategory.Order, OrderId, ENUM_USERTYPE.objecttype5); cl_h_info1.ModifiedIntoLogstran(tran, ChangeCategory.Order, OrderId, ENUM_USERTYPE.objecttype5); } tran.Commit(); return("1"); } else { tran.Rollback(); return("-2"); } } catch (Exception ee) { tran.Rollback(); return("-2"); } finally { conn.Close(); conn.Dispose(); } }
/// <summary> /// 确认订单按钮 /// </summary> /// <param name="storeId"></param> /// <returns></returns> public Boolean OrderSubmit(string storeId, List <OrderDetailModel> orderDetails, OrderGoodsMedel storeItem, bool IsEdit) { using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tr = conn.BeginTransaction();//开启事务 try { if (IsEdit) //如果是修改订单,先删除原来的订单并还原原来的信息 { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("OrderGoods", "OrderGoodsID"); //实例日志类 cl_h_info.AddRecordtran(tr, storeItem.OrderGoodsID); //添加日志,修改前记录原来数据 StoreOrderDAL.DelStoreOrderItemProc(tr, storeItem.OrderGoodsID); //StockDAL.DelStoreOrder(tr, OrderDetailDAL.GetOrderGoodsDetail(storeItem.StoreorderId), storeItem.StoreId);//还原店库存 //OrderDetailDAL.DelOrderGoodsDetail(tr, storeItem.StoreorderId);//明细表删除失败回滚 //StoreOrderDAL.DelOrderGoods(storeItem.StoreorderId, tr); //订单表删除失败回滚 cl_h_info.AddRecordtran(tr, storeItem.OrderGoodsID); //添加日志,修改后记录原来数据 cl_h_info.ModifiedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.store10, storeItem.OrderGoodsID, BLL.CommonClass.ENUM_USERTYPE.objecttype2); //插入日志 } //插入订单 if (new StoreOrderDAL().AddOrderGoods(storeItem, tr)) { //订单表插入成功插入明细表 foreach (OrderDetailModel orderDetailItem in orderDetails) { if (!OrderDetailDAL.AddOrderGoodsDetail(tr, orderDetailItem, storeItem.OrderGoodsID)) { tr.Rollback(); return(false); } } //修改库存信息(预订数量) foreach (OrderDetailModel orderDetailItem in orderDetails) { if (!StockDAL.UpdStockHasOrderCount(tr, storeItem.StoreId, orderDetailItem.ProductId, orderDetailItem.Quantity)) { tr.Rollback(); return(false); } } tr.Commit();//插入订单信息完成 } else {//订单插入失败回滚数据 tr.Rollback(); return(false); } } catch { //订单插入失败回滚数据 tr.Rollback(); return(false); } finally { conn.Close(); } } return(true); }
protected void btn_ok_Click(object sender, EventArgs e) { string newpass = getpass(); if (this.RadioButtonList1.SelectedValue == "4") { if (newpass.Length < 6 || newpass.Length > 10) { msg = "<script>alert('密码必须是6到10位!');</script>"; return; } } //判断是否选择修改密码 bool flag = false; foreach (ListItem lst in chkPass.Items) { if (lst.Selected) { flag = true; break; } } if (!flag) { msg = "<script>alert('请选择要修改的密码类型!');</script>"; return; } int count = 0; string type = Request.QueryString["type"].ToString();//类型 string id = ""; if (GetType() != "3") { id = Request.QueryString["ID"].ToString();//店铺编号 } string number = Request.QueryString["number"].ToString();//会员编号 if (type.Length > 0 && number.Length > 0) { if (type == "1") { foreach (ListItem lst in chkPass.Items) { if (lst.Selected) { if (lst.Value == "one") { switch (this.RadioButtonList1.SelectedValue.ToString()) { case "1": count = mb.updateMemberPass(number, 0); break; //手机 case "2": count = MemberInfoDAL.updateMemberPass1(number, newpass); break; //邮件 case "3": count = MemberInfoDAL.updateMemberPass1(number, newpass); break; //商店 case "4": count = MemberInfoDAL.updateMemberPass1(number, newpass); break; //手动 } } else { switch (this.RadioButtonList1.SelectedValue.ToString()) { case "1": count = mb.updateMemberPass(number, 1); break; case "2": count = MemberInfoDAL.updateMemberPass2(number, newpass); break; case "3": count = MemberInfoDAL.updateMemberPass2(number, newpass); break; case "4": count = MemberInfoDAL.updateMemberPass2(number, newpass); break; } } } } } else if (type == "2") { foreach (ListItem lst in chkPass.Items) { if (lst.Selected) { if (lst.Value == "one") { switch (this.RadioButtonList1.SelectedValue.ToString()) { case "1": count = StoreInfoDAL.StorePassReset(id, newpass); break; //店铺编号 case "2": count = StoreInfoDAL.StorePassReset(id, newpass); break; //邮件 case "3": count = StoreInfoDAL.StorePassReset(id, id); break; //服务机构 case "4": count = StoreInfoDAL.StorePassReset(id, newpass); break; } } else { switch (this.RadioButtonList1.SelectedValue.ToString()) { case "1": count = StoreInfoDAL.StorePassReset1(id, newpass); break; case "2": count = StoreInfoDAL.StorePassReset1(id, newpass); break; case "3": count = StoreInfoDAL.StorePassReset1(id, id); break; case "4": count = StoreInfoDAL.StorePassReset1(id, newpass); break; } } } } } else if (type == "3") { if (RadioButtonList1.SelectedValue == "1") { count = ManageDAL.UpdateManagePass(number, number); } else { count = ManageDAL.UpdateManagePass(number, newpass); } } if (count > 0) { if (type == "1") { cl_h_info = new BLL.CommonClass.ChangeLogs("memberinfo", "number"); cl_h_info.AddRecord(number); } else if (type == "2") { cl_h_info = new BLL.CommonClass.ChangeLogs("storeinfo", "storeid"); cl_h_info.AddRecord(id); } else if (type == "3") { cl_h_info = new BLL.CommonClass.ChangeLogs("Manage", "Number"); cl_h_info.AddRecord(number); } string mess = ""; if (type == "1") { foreach (ListItem lst in chkPass.Items) { if (lst.Selected) { if (lst.Value == "one") { mess = GetTran("006589", "您好,您的会员一级密码重置成功,密码为:") + newpass; } else { if (mess.Contains("您好")) { mess += GetTran("000000", ",您的会员二级密码重置成功,密码为:") + newpass; } else { mess = GetTran("006590", "您好,您的会员二级密码重置成功,密码为:") + newpass; } } } } } else if (type == "2") { foreach (ListItem lst in chkPass.Items) { if (lst.Selected) { if (lst.Value == "one") { mess = GetTran("006680", "您好,您的店铺一级密码重置成功,密码为:") + newpass; } else { if (mess.Contains("您好")) { mess += GetTran("000000", ",您的店铺二级密码重置成功,密码为:") + newpass; } else { mess = GetTran("006588", "您好,您的店铺二级密码重置成功,密码为:") + newpass; } } } } } if (this.RadioButtonList1.SelectedValue.ToString() == "3") { SqlTransaction tran = null; SqlConnection con = DAL.DBHelper.SqlCon(); con.Open(); tran = con.BeginTransaction(); try { string outInfo = string.Empty; if (type == "1" || type == "2") { BLL.MobileSMS.SendMsgTo(tran, number, "", this.txt_1.Text.ToString(), mess, out outInfo, Model.SMSCategory.sms_menberPassRest); } if (type == "3" || type == "4") { BLL.MobileSMS.SendMsgTo(tran, number, "", this.txt_1.Text.ToString(), mess, out outInfo, Model.SMSCategory.sms_storePassRest); } tran.Commit(); } catch { tran.Rollback(); } finally { con.Close(); con.Dispose(); } } else if (this.RadioButtonList1.SelectedValue.ToString() == "2") { string title = ""; title = type == "1" ? "会员密码重置" : "服务机构密码重置"; if (send(mess, title)) { msg = "<script language='javascript'>alert('" + GetTran("006681", "重置成功,请到邮箱查阅密码!") + "');this.close();</script>"; return; } } else { if (type == "1") { PublicClass.SendMsg(3, number, mess); } else if (type == "2") { PublicClass.SendMsg(4, number, mess); } } if (type == "1" || type == "2") { cl_h_info.AddRecord(id); cl_h_info.ModifiedIntoLogs(ChangeCategory.company5, id, ENUM_USERTYPE.objecttype6); } else if (type == "3" || type == "4") { cl_h_info.AddRecord(number); cl_h_info.ModifiedIntoLogs(ChangeCategory.company1, number, ENUM_USERTYPE.objecttype6); } msg = "<script language='javascript'>alert('" + GetTran("000506", "重置成功!") + "');this.close();</script>"; } else { msg = "<script language='javascript'>alert('" + GetTran("000507", "重置失败!") + "');this.close();</script>"; } } }
/// <summary> /// 提交事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { bool flag = SetValueProductSexTypeModel(); if (flag) { if ((int)ViewState["ID"] == 1) { //获取指定产品适用人群的行数 int getCount = SetParametersBLL.GetProductSexTypeCountByName(txtProductSexTypeName.Text.Trim()); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002226", "该适用人群已经存在!"))); } else { //添加适用人群信息 using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { int id; conn.Open(); using (SqlTransaction tran = conn.BeginTransaction()) { try { SetParametersBLL.AddProductSexType(tran, productSexTypeModel, out id); language.AddNewTranslationRecord(tran, "ProductSexType", "ProductSexTypeName", id, txtProductSexTypeName.Text.Trim(), txtProductSexTypeName.Text.Trim()); language.AddNewTranslationRecord(tran, "ProductSexType", "ProductSexTypeDescr", id, txtProductSexTypeDescr.Text.Trim(), txtProductSexTypeDescr.Text.Trim()); tran.Commit(); } catch { tran.Rollback(); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002229", "添加适用人群失败,请联系管理员!"))); return; } Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002227", "添加适用人群成功!"))); divProductSexType.Visible = false; } } } } if ((int)ViewState["ID"] == 2) { ///获取指定产品适用人群的行数 int getCount = SetParametersBLL.GetProductSexTypeCountByIDName(Convert.ToInt32(ViewState["ProductSexTypeID"]), txtProductSexTypeName.Text.Trim()); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002226", "该适用人群已经存在!"))); return; } else { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSexType", "ProductSexTypeID"); cl_h_info.AddRecord(productSexTypeModel.ProductSexTypeID); ///修改指定产品适用人群信息 int updCount = SetParametersBLL.UpdProductSexTypeByID(productSexTypeModel); if (updCount > 0) { cl_h_info.AddRecord(productSexTypeModel.ProductSexTypeID); cl_h_info.ModifiedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002230", "修改适用人群成功!"))); divProductSexType.Visible = false; } else { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002231", "修改适用人群失败,请联系管理员!"))); } } } DataBindProductSexType(); } else { return; } }