protected void InitPage() { DAL.McManaDAL.MerInfoMaintDAL func = new DAL.McManaDAL.MerInfoMaintDAL(); int mer_id = int.Parse(Request.QueryString["mer_id"]); McBasicInfo mc = func.GetMerchantInfoByID(mer_id); MerBas_Name.Text = mc.MerName; MerBas_Intro.Text = mc.MerInfo; MerBas_Pic.ImageUrl = mc.MerPic; MerBas_Address.Text = mc.MerAddr; MerBas_Phone.Text = mc.MerPhone; MerBas_Web.Text = mc.MerWebsite; MerBas_Email.Text = mc.RegEmail; MerBas_Relat.Text = mc.RegName; MerBas_StarLevel.Text = mc.MerStarLever.ToString(); string[] city_Pro = func.GetCityAndProvin(mc.CityID); MerBas_Province.Text = city_Pro[1]; MerBas_City.Text = city_Pro[0]; int count = 0; DataSet ds = func.GetAllProductByMerID(mer_id, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex, out count); AspNetPager1.RecordCount = count; PrdRpt.DataSource = ds; PrdRpt.DataBind(); }
protected void Charge_Submit_Click(object sender, EventArgs e) { DAL.McManaDAL.MerInfoMaintDAL func = new DAL.McManaDAL.MerInfoMaintDAL(); int mem_id = int.Parse(Charge_MemID.Text); float money = float.Parse(Charge_Money.Text); int result = func.ChargeMoneyForMem(mem_id, money); Response.Write("<script>alert('充值成功')</script>"); Response.Write("<script>window.opener=null;window.close();</script>"); }
protected void AddPro_Submit_Click(object sender, EventArgs e) { int mer_id = int.Parse(Session["user_ID"].ToString()); int pageSize = 6; DAL.McManaDAL.MerInfoMaintDAL func = new DAL.McManaDAL.MerInfoMaintDAL(); McPdMaintain mcpd = new McPdMaintain(); mcpd.MerID = mer_id; mcpd.PdName = AddPro_Name.Text; mcpd.PdPrice = float.Parse(AddPro_Price.Text); mcpd.PdMemPrice = float.Parse(AddPro_MemPrice.Text); mcpd.PdInfo = AddPro_Intro.Text; mcpd.PdState = AddPro_State.SelectedValue.Equals("1") == true ? true : false; mcpd.PdNote = AddPro_Note.Text; if (uploadF.Value == null || uploadF.Equals("")) { mcpd.PdPic = ""; } else { string filename = uploadF.PostedFile.FileName; string fileExt = filename.Substring(filename.LastIndexOf('.') + 1); string newName = DateTime.Now.ToString("yyyyMMddHHmmss") + "." + fileExt; string uploadFolder = Server.MapPath("../../") + "/UpFiles" + "/prd_pic/" + newName; uploadF.PostedFile.SaveAs(uploadFolder); string databasePath = "UpFiles/prd_pic/" + newName; mcpd.PdPic = databasePath; } int pro_id = func.AddProduct(mcpd); int pageIndex = (func.ProductCountInMerchant(mer_id) / pageSize) + 1; Response.Redirect("../MerShowInfoMaintain.aspx?mer_id=" + mer_id + "&pro_id=" + pro_id + "&page_index=" + pageIndex); }