protected void Button1_Click(object sender, EventArgs e) { DataTable dt = RemittancesBLL.Quertystore(ViewState["table"].ToString(), ViewState["condition"].ToString()); if (dt == null) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("000053", "没有数据,不能导出Excel!") + "')</script>"); return; } if (dt.Rows.Count < 1) { Page.ClientScript.RegisterStartupScript(GetType(), "", "<script language='javascript'>alert('" + GetTran("000053", "没有数据,不能导出Excel!") + "')</script>"); return; } foreach (DataRow row in dt.Rows) { row[2] = Encryption.Encryption.GetDecipherName(row[2].ToString()); //解密姓名 row[3] = Encryption.Encryption.GetDecipherName(row[3].ToString()); //解密店铺姓名 CityModel info = CommonDataDAL.GetCPCCode(row[5].ToString()); row[4] = info.Country + info.Province + info.City + Encryption.Encryption.GetDecipherAddress(row[4].ToString());//解密店铺地址 } Excel.OutToExcel(dt, GetTran("000388", "店铺"), new string[] { "id=ID", "StoreID=" + GetTran("000150", "店铺编号"), "Name=" + GetTran("000107", "姓名"), "StoreName=" + GetTran("000040", "店铺名称"), "StoreAddress=" + GetTran("001038", "店铺地址") }); }
/// <summary> /// 编辑帐户信息 /// </summary> public void edilblBank() { lblEbankname.Visible = true; //开户名 lblEbank.Visible = false; //开户银行 lblEbanknumber.Visible = false; //银行卡号 lblEbankaddress.Visible = false; //银行地址 CcpEbankaddress.Visible = true; plEbank.Visible = true; //开户银行 txtEbanknumber.Visible = true; //银行卡号 txtEbankaddress.Visible = true; //银行地址 CountryCityPCode2.Visible = true; //默认的会员编号是8888888888s MemberInfoModel model = MemInfoEditBLL.getMemberInfo(ViewState["membernumberE"].ToString()); txtEbank.Text = model.Bankbranchname; ViewState["bankcode"] = model.BankCode; txtEbanknumber.Text = Encryption.Encryption.GetDecipherCard(model.BankCard); CityModel cityM = CommonDataDAL.GetCPCCode(model.BCPCCode); CountryCityPCode2.SelectCountry(cityM.Country, cityM.Province, cityM.City, cityM.Xian); txtEbankaddress.Text = Encryption.Encryption.GetDecipherAddress(model.BankAddress); BindCountry(); }
/// <summary> /// 查询全部的供应商信息 /// </summary> /// <param name="pageindex"></param> /// <param name="pagesize"></param> /// <param name="RecordCount"></param> /// <param name="PageCount"></param> /// <returns></returns> public static IList <ProviderInfoModel> GetProviderInfoAll(int pageindex, int pagesize, out int RecordCount, out int PageCount) { string conuls = "ID, Number, Name, ForShort, LinkMan, Mobile, Telephone, Fax, Email, Url, Address, BankName, BankAddress, BankNumber, DutyNumber, Remark, Status, PermissionMan, OperateIP, OperateNum"; DataTable table = CommonDataDAL.GetDataTablePage_Sms(pageindex, pagesize, "ProviderInfo", conuls, "", "ID", out RecordCount, out PageCount); IList <ProviderInfoModel> list = new List <ProviderInfoModel>(); foreach (DataRow row in table.Rows) { ProviderInfoModel pro = new ProviderInfoModel(); pro.Address = row["Address"].ToString(); pro.BankAddress = row["BankAddress"].ToString(); pro.BankName = row["BankName"].ToString(); pro.BankNumber = row["BankNumber"].ToString(); pro.DutyNumber = row["DutyNumber"].ToString(); pro.Email = row["Email"].ToString(); pro.Fax = row["Fax"].ToString(); pro.ForShort = row["ForShort"].ToString(); //pro.ID = Convert.ToInt32(row["ID"]); pro.LinkMan = row["LinkMan"].ToString(); pro.Mobile = row["Mobile"].ToString(); pro.Name = row["Name"].ToString(); pro.Number = row["Number"].ToString(); pro.OperateIP = row["OperateIP"].ToString(); pro.OperateNum = row["OperateNum"].ToString(); pro.PermissionMan = row["PermissionMan"].ToString(); pro.Remark = row["Remark"].ToString(); pro.Status = Convert.ToInt32(row["Status"]); pro.Telephone = row["Telephone"].ToString(); pro.Url = row["Url"].ToString(); list.Add(pro); } return(list); }
/// <summary> /// 修改仓库信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtnWareHouseEdit_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; } this.tab1.Style.Add("display", ""); //this.tr1.Style.Add("display", "none"); trWareHouse.Visible = true; ViewState["WareHouseID"] = e.CommandArgument; ViewState["AddOrEdit"] = 1; ///1表示是修改事件 ///获取指定的仓库信息 DataTable dt = SetParametersBLL.GetWareHouseInfoByWareHouseID(Convert.ToInt32(e.CommandArgument)); if (dt.Rows.Count == 1) { ddlCountry1.SelectedValue = dt.Rows[0][0].ToString(); txtWareHuseName.Text = dt.Rows[0][1].ToString(); txtWareHouseForShort.Text = dt.Rows[0][2].ToString(); txtWareHousePrincipal.Text = dt.Rows[0][3].ToString(); txtWareHouseAddress.Text = dt.Rows[0][4].ToString(); txtWareHouseDescr.Text = dt.Rows[0][5].ToString(); string CPCCode = dt.Rows[0]["CPCCode"].ToString(); CityModel cpccode = CommonDataDAL.GetCPCCode(CPCCode); this.CountryCity1.SelectCountry(cpccode.Country, cpccode.Province, cpccode.City, cpccode.Xian); } }
/// <summary> /// 加入黑名单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Add_blackList_Click(object sender, EventArgs e) { //验证用户填写黑名单区域管辖 string country = CountryCity1.Country; string p = CountryCity1.Province; string city = CountryCity1.City; string xian = CountryCity1.Xian; if (!this.CountryCity1.CheckFill()) { ScriptHelper.SetAlert(out msg, GetTran("000886", "必须提供有效的区域")); CountryCity1.SelectCountry(country, p, city, xian); return; } string area = country + "," + p + "," + city + "," + xian; area = area.Replace(" ", ""); string[] areas = area.Split(','); if (areas.Length != 4) { ScriptHelper.SetAlert(out msg, GetTran("000887", "必须提供有效的区域!")); CountryCity1.SelectCountry(country, p, city, xian); return; } //判断是否已经存在该黑名单区域管辖 3代表区域管辖类型 string cpcode = CommonDataDAL.GetCPCCode(country, p, city, xian); if (BlackGroupBLL.HasBlackGroup(cpcode, 3)) { //提示已经存在,无需填写 ScriptHelper.SetAlert(out msg, GetTran("000890", "指定的黑名单区域已经存在,无法增加!")); CountryCity1.SelectCountry(country, p, city, xian); return; } BlackGroupModel blackGroup = new BlackGroupModel(); //区域管辖类型 blackGroup.IntGroupType = 3; blackGroup.IntGroupValue = cpcode; string operateIP = Request.UserHostAddress.ToString(); string operateNum = Session["Company"].ToString(); switch (BlackGroupBLL.AddBlackGroup(blackGroup, operateIP, operateNum)) { case 1: ScriptHelper.SetAlert(out msg, GetTran("000891", "添加成功!")); PageSet(); break; default: ScriptHelper.SetAlert(out msg, GetTran("000893", "执行发生错误")); break; } }
/// <summary> /// 对期数的各种判断 /// </summary> /// <returns></returns> public string Check(string orderId, string number, int exceptNum) { if (ChangeExceptDAL.SelectMemberAndOrder(orderId, number) == 0) { return(BLL.Translation.Translate("006028", "对不起,您输入的订单号或会员编号有误!")); } //该会员注册期数 int memberRegisExce = changeExceptDAL.GetRegisExce(number); //获取报单期数 int orderExcept = changeExceptDAL.GetOrderExcept(orderId); //获取报单是否是首次报单 int isfirst = ChangeExceptDAL.SelectIsAgain(orderId); //获取当前期 int exceptNow = CommonDataDAL.getMaxqishu(); //判断是否又修改到了当前期 if (exceptNum == exceptNow) { return(BLL.Translation.Translate("005784", "当前期报单不能调整到当前期!")); } //只能修改当前期 if (orderExcept != exceptNow) { return(BLL.Translation.Translate("002069", "只能调整当前期报单期数!")); } if (isfirst == 0) { //首次报单 不能改到推荐 if (exceptNum < ChangeExceptDAL.SelectTJQiShu(number) || exceptNum < ChangeExceptDAL.SelectAZQiShu(number)) { return(BLL.Translation.Translate("005791", "首次报单不可以调整到推荐或安置人注册期数之前!")); } } else { //如果该报单期数小于该会员注册期数 if (memberRegisExce > exceptNum) { return(BLL.Translation.Translate("002070", "报单期数不能小于该会员注册期数!")); } } return(""); }
/// <summary> /// 获取所有的资源库下的字典表 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_Get() { ICache cache = CacheFactory.Create(); if (!cache.Exists(string.Empty, "ResourceDict")) { List <ResourceDict> resourcedictlist = CommonDataDAL.ResourceDict_List(); cache.Set(string.Empty, "ResourceDict", resourcedictlist); return(resourcedictlist); } else { return(cache.Get <List <ResourceDict> >(string.Empty, "ResourceDict")); } }
protected void Page_Load(object sender, EventArgs e) { type = Request.QueryString["type"] == "" ? "" : Request.QueryString["type"]; url = Request.QueryString["url"] == "" ? "" : Request.QueryString["url"]; bzCurrency = CommonDataBLL.GetStandard(); //i = (AjaxClass.GetCurrency(Convert.ToInt32(bzCurrency), Convert.ToInt32(Session["Default_Currency"].ToString()))); Permissions.ThreeRedirect(Page, "../member/" + Permissions.redirUrl); luo.SetVlaue(); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxMemShopCart)); AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass)); if (!IsPostBack) { GetTotalPrice(); var member = Session["Member"]; if (member != null) { var cinfo = MemberInfoModifyBll.getconsigneeInfo(member.ToString(), true); if (cinfo != null) { //lbConsignee.Text = cinfo.Consignee; //lbMoblieTele.Text = cinfo.MoblieTele; //labName.Text = "收货人:"; var city = CommonDataDAL.GetCPCCode(cinfo.CPCCode); if (city != null) { //lbaddress.Text = city.Province + city.City + city.Xian + cinfo.Address; } } else { //labName.Text = "+新建收货地址"; } } labrealparice.Text = (Convert.ToDouble(labCarryMoney.Text) + Convert.ToDouble(lbtotalPrice.Text)).ToString("0.00"); if (labCarryMoney.Text == "0.00" || labCarryMoney.Text == "0") { labCarryMoney.Text = "包邮"; } else { labCarryMoney.Text = "0.00"; } } }
protected string GetArea(object obj, int i) { if (obj == null) { return(""); } else { CityModel model = CommonDataDAL.GetCPCCode(obj.ToString()); string areas = model.Country + "," + model.Province + "," + model.City + "," + model.Xian; string[] area = areas.Split(','); if (area.Length != 4) { return(""); } return(area[i]); } }
/// <summary> /// 给仓库模型层赋值 /// </summary> private void SetValueWareHouseModel() { int maxWareControl = SetParametersBLL.GetMaxWareControlFromWareHouse(); wareHouseModel.WareHouseID = ViewState["WareHouseID"] == null ? 0 : int.Parse(ViewState["WareHouseID"].ToString()); wareHouseModel.CountryCode = ddlCountry1.SelectedValue; wareHouseModel.WareHouseName = txtWareHuseName.Text.Trim(); wareHouseModel.WareHouseForShort = txtWareHouseForShort.Text.Trim(); wareHouseModel.WareHousePrincipal = txtWareHousePrincipal.Text.Trim(); wareHouseModel.WareHouseAddress = txtWareHouseAddress.Text.Trim(); wareHouseModel.WareHouseDescr = txtWareHouseDescr.Text.Trim(); wareHouseModel.WareControl = maxWareControl + 1; string country = this.CountryCity1.Country; string province = this.CountryCity1.Province; string city = this.CountryCity1.City; string cpccode = CommonDataDAL.GetCPCCode(country, province, city); wareHouseModel.CPCCode = cpccode; }
/// <summary> /// 保存银行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSBank_Click(object sender, EventArgs e) { if (!Page.IsValid) { return; } ChangeLogs cl = new ChangeLogs("MemberInfo", "ltrim(rtrim(Number))"); cl.AddRecord(ViewState["membernumberE"].ToString()); MemberInfoModel info = new MemberInfoModel(); info.BankBook = Encryption.Encryption.GetEncryptionName(this.lblEname.Text.ToString().Trim()); info.Number = ViewState["membernumberE"].ToString(); info.BankCard = Encryption.Encryption.GetEncryptionCard(this.txtEbanknumber.Text.ToString().Trim()); info.BankAddress = Encryption.Encryption.GetEncryptionAddress(this.txtEbankaddress.Text.ToString().Trim()); info.Bankbranchname = this.txtEbank.Text.ToString().Trim(); info.Bank.BankName = this.DdlBank.SelectedValue.ToString().Trim(); string Country = this.CountryCityPCode2.Country; string Province = this.CountryCityPCode2.Province; string City = this.CountryCityPCode2.City; info.BCPCCode = CommonDataDAL.GetCPCCode(Country, Province, City, CountryCityPCode2.Xian); if (MemInfoEditBLL.UpdmemBank(info)) { cl.AddRecord(info.Number); cl.ModifiedIntoLogs(ChangeCategory.Order, info.Number, ENUM_USERTYPE.objecttype5); System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001401", "操作成功!") + "');", true); this.btnSBank.Visible = false; this.btnCBank.Visible = false; this.btnEBank.Visible = true; SellblBank(); return; } else { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001541", "操作失败!") + "');", true); return; } }
/// <summary> /// 执行存储过程UP_MemberOrder_ADD /// </summary> /// <param name="model"></param> /// <returns>返回成功与否</returns> public int AddOrder(MemberOrderModel model, SqlTransaction tran) { SqlParameter[] para = { new SqlParameter("@Number", model.Number), new SqlParameter("@OrderID", model.OrderId), new SqlParameter("@StoreID", model.StoreId), new SqlParameter("@TotalMoney", model.TotalMoney), new SqlParameter("@TotalPv", model.TotalPv), new SqlParameter("@PayExpect", model.PayExpect), new SqlParameter("@OrderExpect", model.OrderExpect), new SqlParameter("@IsAgain", model.IsAgain), new SqlParameter("@OrderDate", model.OrderDate), new SqlParameter("@Err", model.Err), new SqlParameter("@Remark", model.Remark), new SqlParameter("@DefrayState", model.DefrayState), new SqlParameter("@PayCurrency", model.PayCurrency), new SqlParameter("@PayMoney", model.PayMoney), new SqlParameter("@StandardCurrency", model.StandardCurrency), new SqlParameter("@StandardCurrencyMoney", model.StandardcurrencyMoney), new SqlParameter("@OperateIP", model.OperateIp), new SqlParameter("@OperateNumber", model.OperateNumber), new SqlParameter("@DefrayType", model.DefrayType), new SqlParameter("@CarryMoney", model.CarryMoney), //new SqlParameter("@RemittancesId",model.RemittancesId), //new SqlParameter("@ElectronicAccountId",model.ElectronicaccountId), new SqlParameter("@ordertype", model.OrderType), new SqlParameter("@CCPCCode", CommonDataDAL.GetCPCCode(model.ConCity)), new SqlParameter("@ConAddress", model.ConAddress), new SqlParameter("@ConTelphone", model.ConTelPhone), new SqlParameter("@ConMobilPhone", model.ConMobilPhone), new SqlParameter("@ConPost", model.ConPost), new SqlParameter("@Consignee", model.Consignee), new SqlParameter("@ConZipCode", model.ConZipCode), new SqlParameter("@ElectronicaccountId", model.ElectronicaccountId) }; return(DBHelper.ExecuteNonQuery(tran, "UP_MemberOrder_ADD2", para, CommandType.StoredProcedure)); }
/// <summary> /// 查询全部未审核的店铺 /// </summary> /// <param name="storeid"></param> /// <param name="storename"></param> /// <param name="ExpectNum"></param> /// <param name="pageindex"></param> /// <param name="pagesize"></param> /// <param name="RecordCount"></param> /// <param name="pagecount"></param> /// <returns></returns> public static DataTable GetAll(string storeid, string storename, int ExpectNum, int pageindex, int pagesize, out int RecordCount, out int pagecount) { string columns = ""; StringBuilder sb = new StringBuilder(); sb.Append(" 1=1 "); if (storeid.Length > 0) { sb.Append("and StoreId='" + storeid + "'"); } if (storename.Length > 0) { sb.Append(" and StoreName='" + storename + "'"); } if (ExpectNum > 0) { sb.Append(" and ExpectNum=" + ExpectNum); } string wheres = sb.ToString(); DataTable table = CommonDataDAL.GetDataTablePage_Sms(pageindex, pagesize, "UnauditedStoreInfo", columns, wheres, "ID", out RecordCount, out pagecount); return(table); }
/// <summary> /// 查看帐户信息 /// </summary> public void SellblBank() { lblEbankname.Visible = true; //开户名 lblEbank.Visible = true; //开户银行 lblEbanknumber.Visible = true; //银行卡号 lblEbankaddress.Visible = true; //银行地址 CcpEbankaddress.Visible = false; plEbank.Visible = false; //开户银行 txtEbanknumber.Visible = false; //银行卡号 txtEbankaddress.Visible = false; //银行地址 CountryCityPCode2.Visible = false; //默认的会员编号是 MemberInfoModel model = MemInfoEditBLL.getMemberInfo(ViewState["membernumberE"].ToString()); lblEbankname.Text = Encryption.Encryption.GetDecipherName(model.BankBook); lblEbank.Text = MemInfoEditBLL.GetbankStr(ViewState["membernumberE"].ToString()); lblEbanknumber.Text = Encryption.Encryption.GetDecipherCard(model.BankCard); //lblEbankaddress.Text = Encryption.Encryption.GetDecipherAddress(model.BankAddress); CityModel cityM = CommonDataDAL.GetCPCCode(model.BCPCCode); lblEbankaddress.Text = cityM.Country + " " + cityM.Province + " " + cityM.City + " " + cityM.Xian + " " + Encryption.Encryption.GetDecipherAddress(model.BankAddress); }
//换货调用存储过程来生成各种订单并修改相应数据库 public string UpdateReplacementUseProc(string displaceOrderId, string outStorageOrderId, string storeOrderId, string refundmentOrderID, string storeID, int expectNum) { string procName = "procCheckDisplaceGoods"; SqlParameter[] HHpara = { new SqlParameter("@OutStorageOrderId", SqlDbType.VarChar, 20), new SqlParameter("@StoreOrderId", SqlDbType.VarChar, 20), new SqlParameter("@DisplaceOrderID", SqlDbType.VarChar, 20), new SqlParameter("@RefundmentOrderID", SqlDbType.VarChar, 20), new SqlParameter("@StoreID", SqlDbType.VarChar, 20), new SqlParameter("@ExpectNum", SqlDbType.Int), }; HHpara[0].Value = outStorageOrderId; HHpara[1].Value = storeOrderId; HHpara[2].Value = displaceOrderId; HHpara[3].Value = refundmentOrderID; HHpara[4].Value = storeID; HHpara[5].Value = CommonDataDAL.GetMaxExpect(); SqlParameter[] outparam = new SqlParameter[] { new SqlParameter("@rval", SqlDbType.NVarChar, 50) }; object[] obj = DBHelper.ExecuteNonQuery(procName, CommandType.StoredProcedure, HHpara, outparam); return(obj[0].ToString()); }
public string AddLsOrderAddress() { luo.SetVlaue(); var curstr = new StringBuilder(""); try { var cinfo = MemberInfoModifyBll.getconsigneeInfo(luo.MemBh, true); if (cinfo == null) { curstr.Append(@"<a href='PhoneSettings/SetConAddress.aspx?type=AddLsOrder' style='display: block;text-decoration: none;'>+新建收货地址"); curstr.Append(@"<i class='glyphicon glyphicon-chevron-right' style='padding-right: 1rem'></i>"); curstr.Append(@"</a>"); } else { curstr.Append(@"<a href='PhoneSettings/SetConAddress.aspx?type=AddLsOrder&&url=AddLsOrder'>"); curstr.Append(@"<p>收货人:"); curstr.Append(@"" + cinfo.Consignee + " "); curstr.Append(@"" + cinfo.MoblieTele + " </p>"); var city = CommonDataDAL.GetCPCCode(cinfo.CPCCode); if (city != null) { var strvalue = city.Province + city.City + city.Xian + cinfo.Address; curstr.Append(@"<span>" + strvalue + "</span>"); } curstr.Append(@"</a>"); } } catch (Exception) { return(curstr.ToString()); } return(curstr.ToString()); }
/// <summary> /// 获取知识点掌握程度 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_Requirement_Get() { return(CommonDataDAL.ResourceDict_List().Where(x => x.source.Equals("Ken.Requirement")).ToList <ResourceDict>()); }
/// <summary> /// 获取浏览权限 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_ShareRange_Get() { return(CommonDataDAL.ResourceDict_List().Where(x => x.source.Equals("ShareRange")).ToList <ResourceDict>()); }
//-------------------------保存 /// <summary> /// 保存基本信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSbasic_Click(object sender, EventArgs e) { if (!Page.IsValid) { return; } string dirName = ""; //string oldFilePath = this.fude.PostedFile.FileName.Trim(); string oldFileName = ""; string newFileName = ""; string filepath = ""; int photoW = 0, photoH = 0; //string newFilePath = string.Empty; //try //{ // if (oldFilePath != string.Empty) // { // if (!Directory.Exists(Server.MapPath("Store\\H_image\\"))) //如果文件夹不存在则创建 // { // Directory.CreateDirectory(Server.MapPath("Store\\H_image\\")); // } // //检查目录是否存在 // dirName = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString(); // oldFileName = System.IO.Path.GetFileName(oldFilePath); // string fileExtName = string.Empty; // try // { // fileExtName = System.IO.Path.GetExtension(oldFilePath); // } // catch // { // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000823", "上传文件格式不正确!") + "');", true); // return; // } // if (fileExtName.ToLower() != ".icon" && fileExtName.ToLower() != ".jpg" && fileExtName.ToLower() != ".gif" && fileExtName.ToLower() != ".ico") // { // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('上传文件格式不正确,只能上传.icon、.jpg、.gif或者.ico格式的照片!');", true); // return; // } // if (this.fude.PostedFile.ContentLength > 51200) // { // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000824", "上传文件不能大于50K!") + "');", true); // return; // } // //System.Drawing.Image img = System.Drawing.Image.FromStream(fude.PostedFile.InputStream); // //int width = img.Width; // //int hight = img.Height; // //if (width > 50 || hight > 50) // //{ // // Response.Write("<script>alert('" + GetTran("006034", "图片宽度和高度太大!") + "');</script>"); // // this.Button1.Enabled = true; // // return ""; // //} // System.Random rd = new Random(0); // newFileName = DateTime.Now.Year.ToString() + rd.Next(10).ToString() // + DateTime.Now.Month.ToString() + rd.Next(10).ToString() // + DateTime.Now.Day.ToString() + rd.Next(10).ToString() // + DateTime.Now.Second.ToString() // + fileExtName; // newFilePath = Server.MapPath("Store\\H_image\\") + newFileName; // string LevelIcon = new MemberInfoModifyBll().GetMemberPhoto(this.txtEnumber.Text.ToString()) + ""; // if (System.IO.File.Exists(Server.MapPath(LevelIcon))) // { // System.IO.File.Delete(Server.MapPath(LevelIcon)); // } // this.fude.PostedFile.SaveAs(newFilePath); // try // { // System.Drawing.Image myIma = System.Drawing.Image.FromFile(newFilePath); // photoH = myIma.Height; // photoW = myIma.Width; // } // catch (Exception ex1) // { // if (System.IO.File.Exists(newFilePath)) // { // System.IO.File.Delete(newFilePath); // } // Response.Write("<script>alert('" + GetTran("006895", "图片格式转换错误!") + "');</script>"); // return; // } // filepath = @"\Store\H_image\" + newFileName; // } //} //catch (Exception ex1) //{ // return; //} MemberInfoModel model = new MemberInfoModel(); BLL.Registration_declarations.RegistermemberBLL registermemberBLL = new BLL.Registration_declarations.RegistermemberBLL(); if (this.txtEname.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000131", "对不起,会员姓名不能为空!") + "');", true); return; } if (this.txtEstore.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006706", "对不起,购货店铺不能为空!") + "');", true); return; } if (!MemInfoEditBLL.GetStorenumber(this.txtEstore.Text.Trim())) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006707", "对不起,购货店铺编号不存在!") + "');", true); return; } //if (this.txtEcode.Text == "") //{ // System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000134", "对不起,邮编不能为空!") + "');", true); // return; //} if (this.txtEnickname.Text == "") { this.txtEnickname.Text = this.txtEname.Text; } if (this.txtEidnumber.Text == "" && this.txtEIdtype.SelectedValue.Trim() != "P000") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000140", "对不起,证件号码不能为空!") + "');", true); return; } UserControl_CountryCityPCode ucontry = Page.FindControl("CountryCityPCode1") as UserControl_CountryCityPCode; DropDownList dllcountry = ucontry.FindControl("ddlCountry") as DropDownList; if (dllcountry.SelectedIndex == 0) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000143", "请选择国家!") + "');", true); return; } DropDownList dllP = ucontry.FindControl("ddlP") as DropDownList; if (dllP.SelectedIndex == 0) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000144", "请选择省份!") + "');", true); return; } DropDownList dllcity = ucontry.FindControl("ddlCity") as DropDownList; if (dllcity.SelectedIndex == 0) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000145", "请选择城市!") + "');", true); return; } if (this.txtEaddress.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000146", "对不起,地址不能为空!") + "');", true); return; } //检查会员生日 if (this.txtEIdtype.SelectedValue.Trim() != "P001") { if (registermemberBLL.CheckBirthDay(this.txtEbirthday.Text) == "error") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + GetTran("000148", "对不起,请选择正确的出生日期!") + "');", true); return; } } //验证年龄是否大于18岁 if (this.txtEIdtype.SelectedValue.Trim() != "P001") { string alert = registermemberBLL.AgeIs18(this.txtEbirthday.Text.Trim()); if (alert != null) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + alert + "');", true); return; } } //检测身份证需要新方法 string birthdaysex = ""; if (this.txtEIdtype.SelectedValue.Trim() == "P001") { string result = BLL.Registration_declarations.CheckMemberInfo.CHK_IdentityCard(CommonDataBLL.quanjiao(this.txtEidnumber.Text.Trim())); if (result.IndexOf(",") <= 0) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + result + "');", true); return; } else { birthdaysex = result; } } string Number = this.txtEnumber.Text.ToString(); string Name = Encryption.Encryption.GetEncryptionName(this.txtEname.Text.ToString().Trim()); string PetName = this.txtEnickname.Text.ToString(); DateTime Birthday = DateTime.Parse(this.txtEbirthday.Text.ToString()); string Country = this.CountryCityPCode1.Country; string Province = this.CountryCityPCode1.Province; string City = this.CountryCityPCode1.City; string xian = this.CountryCityPCode1.Xian; int Sex = 0; if (this.txtEIdtype.SelectedValue.Trim() == "P001") { Sex = birthdaysex.Substring(birthdaysex.IndexOf(",") + 1).Trim() == GetTran("000094", "男") ? (1) : (0); Birthday = Convert.ToDateTime(birthdaysex.Substring(0, birthdaysex.IndexOf(","))); //验证年龄是否大于18岁 string alert = registermemberBLL.AgeIs18(Birthday.ToString()); if (alert != null) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + alert + "');", true); return; } } else { Birthday = DateTime.Parse(this.txtEbirthday.Text.ToString()); if (this.txtEsex.SelectedValue.ToString() == "0") { Sex = 0; } else { Sex = 1; } } string PostalCode = this.txtEcode.Text.ToString(); ChangeLogs cl = new ChangeLogs("MemberInfo", "ltrim(rtrim(Number))"); cl.AddRecord(Number); MemberInfoModel info = new MemberInfoModel(); info.Number = Number; info.Name = Name; info.PetName = PetName; info.Birthday = Birthday; info.Sex = Sex; info.PostalCode = PostalCode; if (string.IsNullOrEmpty(filepath)) { info.PhotoPath = ViewState["Ephtot"].ToString().Trim(); } else { info.PhotoPath = filepath; } info.StoreID = txtEstore.Text.ToString().Trim(); info.Papertypecode = this.txtEIdtype.SelectedValue.ToString().Trim(); info.PaperNumber = Encryption.Encryption.GetEncryptionNumber(this.txtEidnumber.Text.ToString().Trim()); info.CPCCode = CommonDataDAL.GetCPCCode(Country, Province, City, xian); info.Address = Encryption.Encryption.GetEncryptionAddress(this.txtEaddress.Text.ToString().Trim()); info.BankBook = Name; //BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberinfo", "ltrim(rtrim(number))");//申明日志对象 if (MemInfoEditBLL.Updmemberbasic(info)) { cl.AddRecord(info.Number); cl.ModifiedIntoLogs(ChangeCategory.Order, info.Number, ENUM_USERTYPE.objecttype5); System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001401", "操作成功!") + "');", true); this.btnSbasic.Visible = false; this.btnCbasic.Visible = false; this.btnEbasic.Visible = true; SelLblBasic(); return; } else { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("001541", "操作失败!") + "');", true); return; } }
//根据换货单号更新店铺换货为已审 public void UpdateReplacement(SqlTransaction tran, string DisplaceOrderId, string storeOrderId, string refundmentOrderID, string storeID, int expectNum, string warehouseId, string depotSeatId) { //@OutStorageOrderId varchar(20) ,----生成的出库单号 //@StoreOrderId varchar(20),--------生成的订单号 //@DisplaceOrderID varchar(20), -----换货单号 //@RefundmentOrderID varchar(20), -------生成的退货单号 //@StoreID varchar(20), ------------换货的店号 //@ExpectNum int ---------------换货的期数 string updateDisplaceOrderSql = @"Update Replacement Set StoreOrderId=@num, RefundmentOrderID=@num1, AuditingDate=@num2, StateFlag='Y' Where DisplaceOrderId= @num3"; SqlParameter[] sPara = new SqlParameter[] { new SqlParameter("@num", SqlDbType.VarChar, 20), new SqlParameter("@num1", SqlDbType.VarChar, 20), new SqlParameter("@num2", SqlDbType.SmallDateTime), new SqlParameter("@num3", SqlDbType.VarChar, 20) }; sPara[0].Value = storeOrderId; sPara[1].Value = refundmentOrderID; sPara[2].Value = Model.Other.MYDateTime.GetCurrentDateTime().ToString(); sPara[3].Value = DisplaceOrderId; DBHelper.ExecuteNonQuery(tran, updateDisplaceOrderSql, sPara, CommandType.Text); //更新公司逻辑库存--换出 DataTable dt = DBHelper.ExecuteDataTable("select OutQuantity as Quantity,ProductID as productId From ReplacementDetail where DisplaceOrderID = @DisplaceOrderID", new SqlParameter[] { new SqlParameter("@DisplaceOrderID", DisplaceOrderId) }, CommandType.Text); foreach (DataRow dr in InventoryDocDAL.GetNewOrderDetail(dt).Rows) { string sqlUpdateLogicProduct = "update LogicProductInventory set Totalin=Totalin+@totalOut where productid=@productid"; SqlParameter[] paraLogicProduct = new SqlParameter[] { new SqlParameter("@totalOut", dr["Quantity"]), new SqlParameter("@productid", dr["productId"]) }; DBHelper.ExecuteNonQuery(sqlUpdateLogicProduct, paraLogicProduct, CommandType.Text); DBHelper.ExecuteNonQuery(tran, @"Update ProductQuantity Set Totalin= Totalin +(" + dr["Quantity"].ToString() + @") Where ProductID =" + dr["productId"].ToString() + @" And DepotSeatId =" + depotSeatId + @" and warehouseid =" + warehouseId, null, CommandType.Text); } //更新公司逻辑库存--换入 dt = DBHelper.ExecuteDataTable("select InQuantity as Quantity,ProductID as productId From ReplacementDetail where DisplaceOrderID = @DisplaceOrderID", new SqlParameter[] { new SqlParameter("@DisplaceOrderID", DisplaceOrderId) }, CommandType.Text); foreach (DataRow dr in InventoryDocDAL.GetNewOrderDetail(dt).Rows) { string sqlUpdateLogicProduct = "update LogicProductInventory set totalout=totalout+@totalin where productid=@productid"; SqlParameter[] paraLogicProduct = new SqlParameter[] { new SqlParameter("@totalin", dr["Quantity"]), new SqlParameter("@productid", dr["productId"]) }; DBHelper.ExecuteNonQuery(sqlUpdateLogicProduct, paraLogicProduct, CommandType.Text); //更新公司实际库存 } //在此调用GeneBillAndUpdateStorageandMoney存储过程 SqlParameter[] HHpara = { new SqlParameter("@StoreOrderId", SqlDbType.VarChar, 20), new SqlParameter("@DisplaceOrderID", SqlDbType.VarChar, 20), new SqlParameter("@RefundmentOrderID", SqlDbType.VarChar, 20), new SqlParameter("@StoreID", SqlDbType.VarChar, 20), new SqlParameter("@ExpectNum", SqlDbType.Int), new SqlParameter("@datenow", SqlDbType.DateTime), }; HHpara[0].Value = storeOrderId; HHpara[1].Value = DisplaceOrderId; HHpara[2].Value = refundmentOrderID; HHpara[3].Value = storeID; HHpara[4].Value = CommonDataDAL.GetMaxExpect(); HHpara[5].Value = DateTime.Now.ToUniversalTime(); DBHelper.ExecuteNonQuery(tran, "GeneBillAndUpdateStorageandMoney", HHpara, CommandType.StoredProcedure); }
protected void btn_Save_Click(object sender, EventArgs e) { #region 验证用户输入 if (Request["type"] != "huifu" && txtBianhao.Text.Trim() == "" && this.RadioBianhao.Checked) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(\"" + GetTran("001607", "请输入收件人编号") + "!!!\");</script>"); return; } if (txtTitle.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001609", "请输入标题") + "!!!');</script>"); Literal1.Text = ""; return; } if (this.content1.Value.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请输入邮件内容") + "!!!');</script>"); return; } if (this.content1.Value.Trim().Length > 4000) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000863", "您输入的信息过长") + "!!!');</script>"); return; } double from = 0; double to = 0; if (this.RadioRange.Checked && this.ChkBonus.Checked) { try { from = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); to = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } if (from >= to) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } } if (this.drop_LoginRole.SelectedValue.Equals("2") && this.RadioRange.Checked && this.ChkNet.Checked) { if (this.TxtLeader.Text.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请指定团队首领编号") + "!!!');</script>"); return; } else { if (!MessageSendBLL.CheckNumber(2, this.TxtLeader.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "指定的团队首领不存在") + "!!!');</script>"); return; } } } #endregion StringBuilder sb = new StringBuilder(); //if (Request["type"] != null) //{ if (Request["type"] == "huifu") { MessageSendModel messagesend = new MessageSendModel(); //邮件保存 messagesend.Content = this.content1.Value.Trim(); messagesend.DropFlag = 0; messagesend.InfoTitle = txtTitle.Text.Trim().Replace("<", "<").Replace(">", ">"); messagesend.LoginRole = drop_LoginRole.SelectedItem.Value; messagesend.ReadFlag = 0; messagesend.Sender = Session["Company"].ToString(); messagesend.SenderRole = "0"; messagesend.LanguageCode = this.DropDownList2.SelectedValue; messagesend.CountryCode = this.DropDownList1.SelectedValue; messagesend.MessageType = 'm'; messagesend.SetNoCondition(); int hfid; try { hfid = Convert.ToInt32(Request["hfid"]); if (hfid < 0) { return; } } catch (Exception) { return; } messagesend.ReplyFor = hfid; System.Data.SqlClient.SqlDataReader dr = DAL.DBHelper.ExecuteReader("select Sender,ClassID from MessageReceive where ID=@id", new System.Data.SqlClient.SqlParameter("@id", hfid), CommandType.Text); if (dr.Read()) { messagesend.Receive = dr["Sender"].ToString(); messagesend.MessageClassID = Convert.ToInt32(dr["ClassID"]); } else { ScriptHelper.SetAlert(Page, GetTran("001589", "对不起发件人不存在") + "!!!"); return; } if (MessageSendBLL.Addsendaffiche(messagesend)) { string href = "ManageMessage_Recive.aspx" + (Request["ClassID"] == null ? "" : "?ClassID=" + Request["ClassID"]); ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001587", "邮件回复成功") + "!!!');location.href='" + href + "';</script>"); } else { ScriptHelper.SetAlert(Page, GetTran("001588", "邮件回复失败") + "!!!"); } } else//信息 { if (Request["Id"] != null) { int id = Convert.ToInt32(Request["Id"]); //还没改 MessageSendBLL.DelMessageSendById(id); sb.Append(GetTran("001590", "邮件修改")); } else { Response.Cache.SetExpires(DateTime.Now); Permissions.CheckManagePermission(EnumCompanyPermission.ManageMessage); sb.Append(GetTran("001592", "邮件发送")); } MessageSendModel messagesend = new MessageSendModel(); //邮件保存 messagesend.Content = this.content1.Value.Trim(); messagesend.DropFlag = 0; messagesend.InfoTitle = txtTitle.Text.Trim().Replace("<", "<").Replace(">", ">"); messagesend.LoginRole = drop_LoginRole.SelectedItem.Value; messagesend.ReadFlag = 0; messagesend.Sender = Session["Company"].ToString(); messagesend.SenderRole = "0"; messagesend.LanguageCode = this.DropDownList2.SelectedValue; messagesend.CountryCode = this.DropDownList1.SelectedValue; messagesend.Qishu = CommonDataDAL.getMaxqishu(); messagesend.MessageType = 'm'; messagesend.SetNoCondition(); if (this.RadioBianhao.Checked) //指定了编号 { if (txtBianhao.Text.Trim().Length > 0) { if (!txtBianhao.Text.Trim().Equals("*")) { //验证编号是否存在 string[] strArray = txtBianhao.Text.Trim().Split(new char[] { ',' }); foreach (string strNO in strArray) { if (strNO != "") { int id = Convert.ToInt32(drop_LoginRole.SelectedValue); //验证编号是否存在 if (!MessageSendBLL.CheckNumber(id, strNO)) { Response.Write("<script>alert('" + strNO + GetTran("001584", "不存在") + "');</script>"); return; } } } } } else { ScriptHelper.SetAlert(Page, GetTran("001594", "请输入收件人") + "!!!"); return; } messagesend.Receive = DisposeString.DisString(txtBianhao.Text.Trim()); } else //指定了Range { messagesend.Receive = "*"; //if (this.ChkLevel.Checked) //{ // messagesend.ConditionLevel = Convert.ToInt16(this.DropLevel.SelectedValue); //} if (this.ChkBonus.Checked) { messagesend.ConditionBonusFrom = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); messagesend.ConditionBonusTo = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); } if (this.ChkNet.Checked) { messagesend.ConditionRelation = Convert.ToChar(this.DropRelation.SelectedValue); messagesend.ConditionLeader = this.TxtLeader.Text.Trim(); } } if (MessageSendBLL.Addsendaffiche(messagesend)) { sb.Append(GetTran("001600", "成功") + "!!!"); ScriptHelper.SetAlert(Page, sb.ToString()); } else { sb.Append(GetTran("001541", "失败") + "!!!"); ScriptHelper.SetAlert(Page, sb.ToString()); } } this.txtTitle.Text = ""; this.TextBox1.Text = ""; this.content1.Value = ""; }
protected void btn_Save_Click(object sender, EventArgs e) { #region 验证用户输入 if (txtBianhao.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(\"" + GetTran("001607", "请输入收件人编号") + "!!!\");</script>"); return; } if (txtTitle.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001609", "请输入标题") + "!!!');</script>"); Literal1.Text = ""; return; } if (this.content1.Value.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请输入公告内容") + "!!!');</script>"); return; } if (this.content1.Value.Trim().Length > 4000) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000863", "您输入的信息过长") + "!!!');</script>"); return; } double from = 0; double to = 0; if (this.ChkBonus.Checked) { if (string.IsNullOrEmpty(this.TxtBonusFrom.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 起始奖金不能为空!');</script>"); return; } if (string.IsNullOrEmpty(this.TxtBonusTo.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 未尾奖金不能为空!');</script>"); return; } try { from = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); to = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); if (from <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 起始奖金不能为负数!');</script>"); return; } if (from <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 未尾奖金不能负数!');</script>"); return; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } if (from >= to) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } } if (this.drop_LoginRole.SelectedValue.Equals("2") && this.ChkNet.Checked) { if (this.TxtLeader.Text.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请指定团队领导人编号") + "!!!');</script>"); return; } else { if (!MessageSendBLL.CheckNumber(2, this.TxtLeader.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "指定的团队领导人不存在") + "!!!');</script>"); return; } } } #endregion StringBuilder sb = new StringBuilder(); if (Request["Id"] != null) { int id = Convert.ToInt32(Request["Id"]); ChangeLogs cl = new ChangeLogs("MessageSend", "ltrim(rtrim(id))"); cl.AddRecord(id); ChangeLogs clsend = new ChangeLogs("MessageReceive", "ltrim(rtrim(messagesendid))"); clsend.AddRecord(id); BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); bll.delGongGao(id); cl.ModifiedIntoLogs(ChangeCategory.company19, Session["Company"].ToString(), ENUM_USERTYPE.objecttype10); clsend.ModifiedIntoLogs(ChangeCategory.company19, Session["Company"].ToString(), ENUM_USERTYPE.objecttype10); this.btn_Save.Text = GetTran("000259", "修改"); sb.Append(GetTran("001621", "公告修改")); } else { sb.Append(GetTran("001620", "公告发布")); } MessageSendModel messagesend = new MessageSendModel(); //messagesend.Content = TextBox1.Text.Trim(); messagesend.Content = this.content1.Value.Trim(); messagesend.DropFlag = 0; messagesend.InfoTitle = txtTitle.Text.Trim().Replace("<", "<").Replace(">", ">"); messagesend.LoginRole = drop_LoginRole.SelectedItem.Value; messagesend.ReadFlag = 0; messagesend.Sender = Session["Company"].ToString(); messagesend.SenderRole = "0"; messagesend.Receive = "*"; messagesend.CountryCode = this.DropDownList1.SelectedValue; messagesend.LanguageCode = this.DropDownList2.SelectedValue; //if (this.ChkLevel.Checked) //{ // messagesend.ConditionLevel = Convert.ToInt16(this.DropLevel.SelectedValue); //} //else //{ // messagesend.ConditionLevel = -1; //} if (this.ChkBonus.Checked) { messagesend.ConditionBonusFrom = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); messagesend.ConditionBonusTo = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); } else { messagesend.ConditionBonusFrom = -1; messagesend.ConditionBonusTo = -1; } if (this.ChkNet.Checked) { messagesend.ConditionRelation = Convert.ToChar(this.DropRelation.SelectedValue); messagesend.ConditionLeader = this.TxtLeader.Text.Trim(); } else { messagesend.ConditionLeader = ""; messagesend.ConditionRelation = '0'; } messagesend.Qishu = CommonDataDAL.getMaxqishu(); messagesend.MessageType = 'a'; if (MessageSendBLL.Addsendaffiche(messagesend)) { BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); if (this.drop_LoginRole.SelectedValue == "1") { bll.UpdateStore(); } else if (this.drop_LoginRole.SelectedValue == "2") { bll.UpdateMember(); } sb.Append(GetTran("001600", "成功") + "!!!"); ScriptHelper.SetAlert(Page, sb.ToString()); } else { sb.Append(GetTran("001618", "失败")); ScriptHelper.SetAlert(Page, sb.ToString()); } txtTitle.Text = ""; TextBox1.Text = ""; content1.Value = ""; }
/// <summary> /// 获取资源的文件类型 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_FileType_Get() { return(CommonDataDAL.ResourceDict_List().Where(x => x.source.Equals("File.FileType")).ToList <ResourceDict>()); }
/// <summary> /// 获取难度系统 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_Diffcult_Get() { return(CommonDataDAL.ResourceDict_List().Where(x => x.source.Equals("Exercise.Diffcult")).ToList <ResourceDict>()); }
/// <summary> /// 通过网络图删除会员 /// </summary> /// <param name="member">会员编号</param> /// <returns></returns> public string DelMembersDeclarationTreeNet(string member) { string info = ""; //判断该会员是否当前期注册 int regQishu = browsememberordersDAL.GetMemberRegisterQS(member); int maxExcept = Convert.ToInt32(CommonDataDAL.GetMaxExpect()); if (regQishu < maxExcept) { info = "对不起,该会员不是当前期注册的,不可以删除!"; return(info); } //判断该会员是否有复效单 int result = browsememberordersDAL.GetHasOrderAgain(member); if (result > 0) { info = "对不起!该会员有重复消费请先删除重复消费!"; return(info); } //int tjCount = browsememberordersDAL.GetTuiJianCount(member,false); //if (tjCount > 0) //{ // info = "对不起!该会员已经推荐了其他会员,不能删除!"; // return info; //} //int azCount = browsememberordersDAL.GetTuiJianCount(member, true); //if (azCount > 0) //{ // info = "对不起!该会员已经安置了其他会员,不能删除!"; // return info; //} int xh = browsememberordersDAL.GetXHanzhi(member); if (xh > 0) { info = "对不起!删除该会员后安置人数以超过2人,请将上级位置空出后再操作。!"; return(info); } string orderId = browsememberordersDAL.GetOrderID(member); string storeId = browsememberordersDAL.GetStoreID(member); using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { //删除后 下面的人紧缩上来 (用循环调网其下面的人) browsememberordersDAL.XunHuanTW(member, maxExcept, tran); browsememberordersDAL.DelNew(member, maxExcept, tran); addOrderDataDAL.Del_Horder(tran, orderId, storeId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); tran.Commit(); info = "删除成功"; } catch (Exception) { info = "抱歉!系统异常,删除失败!"; tran.Rollback(); conn.Close(); return(info); } finally { conn.Close(); conn.Dispose(); } } return(info); }
/// <summary> /// 获取答题卡的题型 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_CardExerciseType_Get() { return(CommonDataDAL.ResourceDict_List().Where(x => x.source.Equals("Exercise.ExerciseAnswercardType")).ToList <ResourceDict>()); }
protected void BtnUpdate_Click1(object sender, EventArgs e) { BLL.Registration_declarations.RegistermemberBLL registermemberBLL = new BLL.Registration_declarations.RegistermemberBLL(); if (this.Number.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000129", "对不起,会员编号不能为空!") + "');", true); return; } if (this.Name.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000131", "对不起,会员姓名不能为空!") + "');", true); return; } if (MoblieTele.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000000", "移动电话不能为空!") + "');", true); return; } else { if (MoblieTele.Text.Length != 11) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000000", "移动电话格式不正确!") + "');", true); return; } } if (this.PostolCode.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000134", "对不起,邮编不能为空!") + "');", true); return; } if (this.PetName.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000136", "对不起,会员昵称不能为空!") + "');", true); return; } if (this.PaperNumber.Text == "" && this.PaperType.SelectedValue.Trim() != "P000") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000140", "对不起,证件号码不能为空!") + "');", true); return; } if (this.Address.Text == "") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("000146", "对不起,地址不能为空!") + "');", true); return; } //检查会员生日 if (this.PaperType.SelectedValue.Trim() != "P001") //如果证件类型不是身份证 则判断会员生日是否输入 { if (registermemberBLL.CheckBirthDay(this.Birthday.Text) == "error") { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + GetTran("000148", "对不起,请选择正确的出生日期!") + "');", true); return; } //验证年龄是否大于18岁 string alert = registermemberBLL.AgeIs18(this.Birthday.Text.Trim()); if (alert != null) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + alert + "');", true); return; } } //检测身份证需要新方法 string birthdaysex = ""; if (this.PaperType.SelectedValue.Trim() == "P001") { string result = BLL.Registration_declarations.CheckMemberInfo.CHK_IdentityCard(CommonDataBLL.quanjiao(this.PaperNumber.Text.Trim())); if (result.IndexOf(",") <= 0) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + result + "');", true); return; } else { birthdaysex = result; // 从身份证号中取到生日和性别组成的字符串用逗号分隔 } } string oldChangeInfo = ""; bool flag = false; StringBuilder changeInfo = new StringBuilder(); ChangeLogs cl = new ChangeLogs("MemberInfo", "ltrim(rtrim(Number))"); cl.AddRecord(ViewState["Number"].ToString()); MemberInfoModel mem = MemInfoEditBLL.getMemberInfo(ViewState["Number"].ToString()); oldChangeInfo = mem.ChangeInfo.ToString(); changeInfo.Append(mem.ChangeInfo.ToString()); changeInfo.Append(GetTran("000151", "管理员 ")); changeInfo.Append(Session["Company"]); changeInfo.Append(GetTran("000153", " 在 ")); changeInfo.Append(DateTime.Now.ToString()); changeInfo.Append(GetTran("000156", " 第 ")); changeInfo.Append(Session["ExpectNum"].ToString()); changeInfo.Append(GetTran("000157", " 期 ")); changeInfo.Append(GetTran("000161", " 修改了如下内容") + ":"); //判断用户是否修改了姓名 if (this.Name.Text != Encryption.Encryption.GetDecipherName(mem.Name.ToString().Trim())) { flag = true; changeInfo.Append("\n" + GetTran("000164", " 修改了姓名,原姓名") + ":"); changeInfo.Append(mem.Name.ToString()); changeInfo.Append(";" + GetTran("000166", " 新姓名") + ":"); changeInfo.Append(this.Name.Text.ToString()); } //判断用户是否修改了昵称 if (this.PetName.Text != mem.PetName.ToString()) { flag = true; changeInfo.Append("\n" + GetTran("000168", " 修改了昵称,原昵称") + ":"); changeInfo.Append(mem.PetName.ToString()); changeInfo.Append(";" + GetTran("000170", " 新昵称") + ":"); changeInfo.Append(this.PetName.Text.ToString()); } //判断是否更改了证件号码和证件类型 if ((this.PaperType.SelectedValue.ToString() != mem.Papertypecode) || (this.PaperNumber.Text.Trim() != Encryption.Encryption.GetDecipherNumber(mem.PaperNumber.Trim()))) { if (this.PaperType.ToString().Trim() != "") { flag = true; changeInfo.Append("\n" + GetTran("000202", " 修改了证件类型或证件号码,原证件类型") + ":"); changeInfo.Append(mem.PaperType.ToString()); changeInfo.Append("," + GetTran("000203", " 原证件号码") + ":"); changeInfo.Append(mem.PaperNumber.ToString()); changeInfo.Append(";" + GetTran("000206", " 新证件类型") + ":"); changeInfo.Append(this.PaperType.ToString()); changeInfo.Append("," + GetTran("000207", " 新证件号码") + ":"); changeInfo.Append(this.PaperNumber.ToString()); } } //判断用户是否修改了开户行 if (this.MemberBank.SelectedValue.ToString() != mem.Bank.ToString()) { flag = true; changeInfo.Append("\n" + GetTran("000210", " 修改了开户行,原开户行") + ":"); changeInfo.Append(mem.Bank.ToString()); changeInfo.Append(";" + GetTran("000211", " 新开户行") + ":"); changeInfo.Append(this.MemberBank.SelectedValue.ToString()); } //判断用户是否修改了银行帐号 if (this.BankNum.Text.ToString() != mem.BankCard.ToString()) { flag = true; changeInfo.Append("\n" + GetTran("000212", " 修改了银行帐号,原银行帐号") + ":"); changeInfo.Append(mem.BankCard.ToString()); changeInfo.Append(";" + GetTran("000216", " 新银行帐号") + ":"); changeInfo.Append(this.BankNum.Text.ToString()); changeInfo.Append("\n"); } string Number = this.Number.Text.ToString(); string Placement = this.Placement.Text.ToString(); string Direct = this.Recommended.Text.ToString(); string Name = Encryption.Encryption.GetEncryptionName(this.Name.Text.ToString().Trim()); string PetName = this.PetName.Text.ToString(); DateTime Birthday = DateTime.Parse(this.Birthday.Text.ToString()); int Sex = 0; if (this.PaperType.SelectedValue.Trim() == "P001") { Sex = birthdaysex.Substring(birthdaysex.IndexOf(",") + 1).Trim() == GetTran("000094", "男") ? (1) : (0); Birthday = Convert.ToDateTime(birthdaysex.Substring(0, birthdaysex.IndexOf(","))); //验证年龄是否大于18岁 string alert = registermemberBLL.AgeIs18(Birthday.ToString()); if (alert != null) { System.Web.UI.ScriptManager.RegisterStartupScript(Page, this.GetType(), "", "alert('" + alert + "');", true); return; } } else { Birthday = DateTime.Parse(this.Birthday.Text.ToString()); if (this.Sex.SelectedValue.ToString() == "0") { Sex = 0; } else { Sex = 1; } } //邮编号 string PostalCode = this.PostolCode.Text.ToString(); //家庭电话号码 string HomeTele = this.Txtjtdh.Text.Trim() == "电话号码" ? "" : Encryption.Encryption.GetEncryptionTele(this.Txtjtdh.Text.ToString().Trim()); //办公电话号码 string OfficeTele = this.Txtbgdh.Text.Trim() == "电话号码" ? "" : Encryption.Encryption.GetEncryptionTele(this.Txtbgdh.Text.ToString().Trim()); //传真电话号 string FaxTele = this.Txtczdh.Text.Trim() == "电话号码" ? "" : Encryption.Encryption.GetEncryptionTele(this.Txtczdh.Text.ToString().Trim()); //手机号 string MobileTele = Encryption.Encryption.GetEncryptionTele(this.MoblieTele.Text.ToString().Trim()); string Country = this.CountryCity1.Country; //国家 string Province = this.CountryCity1.Province; //省份 string City = this.CountryCity1.City; //城市 string Xian = this.CountryCity1.Xian; //详细地址 string Address = Encryption.Encryption.GetEncryptionAddress(this.Address.Text.ToString().Trim()); string PaperNumber = Encryption.Encryption.GetEncryptionNumber(this.PaperNumber.Text.ToString().Trim()); //证件号 string PaperType = this.PaperType.SelectedValue.ToString().Trim(); //证件类型 string Bank = this.MemberBank.SelectedValue.ToString(); //银行名称 string BankAddress = Encryption.Encryption.GetEncryptionAddress(this.BankAdderss.Text.ToString().Trim()); //银行地址 //银行所属国家 string BankCountry = this.CountryCity2.Country; string BankProvince = this.CountryCity2.Province; //银行所属省份 string BankCity = this.CountryCity2.City; //银行所属城市 string BankCard = Encryption.Encryption.GetEncryptionCard(this.BankNum.Text.ToString().Trim()); //银行卡号 string BankBook = Encryption.Encryption.GetEncryptionName(this.Name.Text.ToString().Trim()); //开户名 //当前期数 int ExpectNum = Convert.ToInt32(this.ExpectNum.Text.ToString()); if (this.Remark.Text.Length > 500) //备注在500字以内 { System.Web.UI.ScriptManager.RegisterStartupScript(Page, GetType(), "success2", "alert('" + GetTran("006708", "对不起,备注输入的字符太多,最多500个字符!") + "');", true); return; } ; string Remark = this.Remark.Text.ToString(); string OrderId = this.OrderID.Text.ToString(); string ChangeInfo = ""; if (flag == true) { ChangeInfo = changeInfo.ToString(); //修改信息提示 } else { ChangeInfo = oldChangeInfo; } // string OperateIp = HttpContext.Current.Request.UserHostAddress.ToString(); string OperaterNum = CommonDataBLL.OperateBh; MemberInfoModel info = new MemberInfoModel(); info.Number = Number; info.Placement = ViewState["Placement"].ToString(); info.Direct = ViewState["Direct"].ToString(); info.Name = Name; info.PetName = PetName; info.Birthday = Birthday; info.Sex = Sex; info.PostalCode = PostalCode; info.StoreID = "8888888888"; info.HomeTele = HomeTele; info.OfficeTele = OfficeTele; info.MobileTele = MobileTele; info.FaxTele = FaxTele; info.CPCCode = CommonDataDAL.GetCPCCode(Country, Province, City, Xian); info.Address = Address; info.Papertypecode = PaperType; info.PaperNumber = PaperNumber; info.BankCode = Bank; info.BankAddress = BankAddress; info.BankCard = BankCard; info.BankBook = BankBook; info.ExpectNum = ExpectNum; info.Remark = Remark; info.OrderID = OrderId; info.ChangeInfo = changeInfo.ToString(); info.OperateIp = OperateIp; info.OperaterNum = OperaterNum; info.BCPCCode = CommonDataDAL.GetCPCCode(BankCountry, BankProvince, BankCity); info.Bankbranchname = this.txtEbank.Text; info.PhotoPath = ""; int jjtx = Convert.ToInt32(this.rbtJj.SelectedValue); updMemberInfo(info); // 修改信息 cl.AddRecord(info.Number); //记录操作 //记录日志 cl.ModifiedIntoLogs(ChangeCategory.company0, info.Number, ENUM_USERTYPE.objecttype5); }
/// <summary> /// 获取上传时间的设置 /// </summary> /// <returns></returns> public static List <ResourceDict> Resource_Dict_TimePass_Get() { return(CommonDataDAL.ResourceDict_List().Where(x => x.source.Equals("CycleTime")).ToList <ResourceDict>()); }
//根据换货单号得到换货单详细 /// <summary> /// 根据换货单号得到换货单详细 /// </summary> /// <returns></returns> public void SaveReplacementlModelByDisplaceOrderID(string displaceOrderID, string number, ReplacementModel replacementModel, ArrayList displaceList) { using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { //得到制单人 CommonDataDAL commonDataDAL = new CommonDataDAL(); string makeman = commonDataDAL.GetNameByAdminID(number); //删除原来的明细 SqlParameter[] sPara = new SqlParameter[] { new SqlParameter("@num", SqlDbType.VarChar, 20) }; sPara[0].Value = displaceOrderID; DBHelper.ExecuteNonQuery(tran, "delete from ReplacementDetail where displaceOrderID =@num", sPara, CommandType.Text); foreach (ReplacementDetailModel replacementDetailModel in displaceList) { replacementDetailModel.DisplaceOrderID = replacementModel.DisplaceOrderID; } CreateReplacementDetails(tran, displaceList, displaceOrderID); //更新原来的换货单信息 string SQL_UPDATE_DisplaceGoodsOrder = @"UPDATE Replacement SET MakeDocPerson = @MakeDocPerson, ExpectNum = @ExpectNum, OutTotalMoney = @OutTotalMoney, OutTotalPV = @OutTotalPV, InTotalMoney = @InTotalMoney, InTotalPV = @InTotalPV, InceptAddress = @InceptAddress, InceptPerson = @InceptPerson, PostalCode = @PostalCode, Telephone = @Telephone,remark=@remark WHERE DisplaceOrderID = @DisplaceOrderID" ; SqlParameter[] para = { new SqlParameter("@MakeDocPerson", replacementModel.MakeDocPerson), new SqlParameter("@ExpectNum", replacementModel.ExpectNum), new SqlParameter("@OutTotalMoney", replacementModel.OutTotalMoney), new SqlParameter("@OutTotalPV", replacementModel.OutTotalPV), new SqlParameter("@InTotalMoney", replacementModel.InTotalMoney), new SqlParameter("@InTotalPV", replacementModel.InTotalPV), new SqlParameter("@InceptAddress", replacementModel.InceptAddress), new SqlParameter("@InceptPerson", replacementModel.InceptPerson), new SqlParameter("@PostalCode", replacementModel.PostalCode), new SqlParameter("@Telephone", replacementModel.Telephone), new SqlParameter("@DisplaceOrderID", replacementModel.DisplaceOrderID), new SqlParameter("@remark", replacementModel.Remark) }; int a = DBHelper.ExecuteNonQuery(tran, SQL_UPDATE_DisplaceGoodsOrder, para, CommandType.Text); tran.Commit(); } catch (Exception err) { tran.Rollback(); throw err; } finally { conn.Close(); } } }