/// <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 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="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { int productUnitId = Convert.ToInt32(e.CommandArgument); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductUnit", "ProductUnitID"); //Judge the ProductUnitId whether exist by Id before delete or update int isExistCount = SetParametersBLL.ProductUnitIdIsExist(productUnitId); if (isExistCount > 0) { //Judge the ProductUnitId whether has operation by Id before delete int getCount = SetParametersBLL.ProductUnitIdWhetherHasOperation(productUnitId); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003174", "对不起,该产品单位发生了业务,因此不能删除!"))); divProductUnit.Visible = false; return; } else { //Delete the productUint information by productUnitId using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); using (SqlTransaction tran = conn.BeginTransaction()) { try { cl_h_info.AddRecordtran(tran, productUnitId.ToString()); SetParametersBLL.DelProductUnitByID(tran, productUnitId); language.RemoveTranslationRecord(tran, "ProductUnit", productUnitId); cl_h_info.DeletedIntoLogs(ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); tran.Commit(); } catch { tran.Rollback(); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003172", "删除单位失败,请联系管理员!"))); return; } Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003173", "删除单位成功!"))); } } } } else { divProductUnit.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("003171", "对不起,该产品单位不存在或者已经被删除!"))); return; } DataBindProductUnit(); }
/// <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(); }
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(); }
/// <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) { 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) { //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 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) { 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(); }
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); } }
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 GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string id = e.CommandArgument.ToString(); if (e.CommandName == "Del") { 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, id); sms.DelSMS(tran, id); cl.AddRecordtran(tran, id.ToString()); cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company65, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10); tran.Commit(); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + BLL.Translation.Translate("000008", "删除成功") + "')", true); btnSearch_Click(null, null); } catch { tran.Rollback(); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + BLL.Translation.Translate("000009", "删除失败") + "')", true); } finally { con.Close(); } } } if (e.CommandName == "AgainSend") { string info = ""; string[] AllValue = e.CommandArgument.ToString().Split(','); string CommName = e.CommandArgument.ToString(); using (SqlConnection con = new SqlConnection(DAL.DBHelper.connString)) { con.Open(); SqlTransaction tran = con.BeginTransaction(); try { BLL.MobileSMS sms = new BLL.MobileSMS(); BLL.MobileSMS.SendMsgTo(tran, AllValue[2], AllValue[2], AllValue[1], AllValue[3], out info, (Model.SMSCategory)Convert.ToInt32(AllValue[4])); sms.DelSMS(tran, AllValue[0]); tran.Commit(); //BLL.MobileSMS.SendMsgTo(tran, bianhao, bianhao, mobile, msg, out info, Model.SMSCategory.sms_ManualSent); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + info + "');", true); btnSearch_Click(null, null); } catch { tran.Rollback(); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + info + "');", true); } finally { con.Close(); } } } }