protected void btnUpdateAd_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["upid"])) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(Request["upid"]) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { Advertisement upNot = db.Advertisement.Single(x => x.AdID == int.Parse(Request["upid"])); upNot.AdTitle = txtTitle.Value.Trim(); upNot.Company = txtCompany.Value; upNot.AdContent = txtFckContent.Value.Trim(); if (!string.IsNullOrEmpty(HFurl.Value)) { upNot.AdImg = HFurl.Value.Trim(); } //upNot.Addtime = DateTime.Now; upNot.setindex = Convert.ToChar(drpSetIndex.SelectedValue); upNot.goodscode = txtGoodsCode.Value; db.SubmitChanges(); } } Response.Redirect("AdManager.aspx?mid=" + Request["mid"]); } }
protected void btnAddUserInfo_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { UserInfo adNot = new UserInfo(); adNot.nickname = txtNickName.Value.Trim(); adNot.name = txtName.Value.Trim();; adNot.tel = txtTel.Value.Trim();; adNot.email = txtEmail.Value.Trim();; adNot.sex = Convert.ToChar(drpSex.SelectedValue); adNot.address = txtAddress.Value.Trim();; adNot.areacity = seachprov.SelectedItem.Text + " " + seachcity.SelectedItem.Text + " " + seachdistrict.SelectedItem.Text; //txtAreacity.Value.Trim(); adNot.pass = txtPass.Value.Trim();; adNot.invitedcode = txtTel.Value.Trim(); // 20160220 del txtInvitedCode.Value.Trim(); adNot.cardno = txtCardNo.Value; adNot.plantnum = txtPlantNum.Value; adNot.homenum = txtHomeNum.Value; adNot.addtime = DateTime.Now; db.UserInfo.InsertOnSubmit(adNot); db.SubmitChanges(); } Response.Redirect("UserinfoManager.aspx"); }
protected void btnAddNotices_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { notices addNot = new notices(); addNot.title = SearchDataClass.CheckStr(txtTitle.Value.Trim());; addNot.content = txtFckContent.Value; // SearchDataClass.CheckStr(txtFckContent.Value); //addNot.validate = Convert.ToChar(drpValidate.SelectedValue); //addNot.setindex = Convert.ToChar(drpSetIndex.SelectedValue); addNot.newssort = int.Parse(drpNewsSort.SelectedValue); addNot.img = HFurl.Value.Trim(); addNot.img1 = HFurl1.Value.Trim(); addNot.img2 = HFurl2.Value.Trim(); addNot.newssource = txtSource.Value.Trim(); addNot.likenum = 0; addNot.discussnum = 0; addNot.browses = 0; addNot.addtime = DateTime.Now; db.notices.InsertOnSubmit(addNot); db.SubmitChanges(); } Response.Redirect("NewsNoticesManager.aspx?mid=" + Request["mid"]); }
protected void seachprov_SelectedIndexChanged(object sender, EventArgs e) { string pid = seachprov.SelectedItem.Value.Trim(); if (pid != "0") { //初始化 市和县级列表 //初始化市列表 seachcity.Items.Clear(); /*seachdistrict.Items.Clear(); seachdistrict.Items.Insert(0, new ListItem("请选择"));*/ using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { var getCity = (from p in db.areas where p.parentid == pid select new { p.id, p.areaname }).ToList(); if (getCity.Count == 1) { seachcity.DataTextField = "areaname"; seachcity.DataValueField = "id"; seachcity.DataSource = getCity; seachcity.DataBind(); seachcity.Items.Insert(0, new ListItem("请选择")); //var getDis = (from p in db.areas where p.parentid == getCity[0].id select new { p.id, p.areaname }).ToList(); //seachdistrict.DataTextField = "areaname"; //seachdistrict.DataValueField = "id"; //seachdistrict.DataSource = getDis; //seachdistrict.DataBind(); seachdistrict.Items.Insert(0, new ListItem("请选择")); BindCityArea(getCity[0].id, seachdistrict); } else { seachcity.DataTextField = "areaname"; seachcity.DataValueField = "id"; seachcity.DataSource = getCity; seachcity.DataBind(); seachcity.Items.Insert(0, new ListItem("请选择")); } } } }
protected void btnUpdateUserInfo_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["upid"])) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(Request["upid"]) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { UserInfo upNot = db.UserInfo.Single(x => x.Id == int.Parse(Request["upid"])); upNot.nickname = txtNickName.Value.Trim(); upNot.name = txtName.Value.Trim(); upNot.tel = txtTel.Value.Trim(); upNot.email = txtEmail.Value.Trim(); upNot.sex = Convert.ToChar(drpSex.SelectedValue); upNot.address = txtAddress.Value.Trim(); upNot.areacity = seachprov.SelectedItem.Text + " " + seachcity.SelectedItem.Text + " " + seachdistrict.SelectedItem.Text;//txtAreacity.Value.Trim(); upNot.pass = txtPass.Value.Trim(); upNot.cardno = txtCardNo.Value; upNot.plantnum = txtPlantNum.Value; upNot.homenum = txtHomeNum.Value; db.SubmitChanges(); } } Response.Redirect("UserinfoManager.aspx"); } }
protected void btnMemberExtrac_ServerClick(object sender, EventArgs e) { HttpCookie getCookies = Request.Cookies["UserLogin"]; if (getCookies != null) { if (Convert.ToDecimal(txtMemberExtrac.Value) > Convert.ToDecimal(spMoney.InnerText)) { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('提现不能超过账户余额。');</script>"); return; } else { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { memberextract ext = new memberextract(); ext.extno = DateTime.Now.ToString("yymmssffff"); ext.extmoney = Convert.ToDecimal(txtMemberExtrac.Value); ext.exttel = getCookies["ClientName"]; ext.extuserid = int.Parse(getCookies["ClientUserID"]); ext.extcontent = "提现"; ext.extcardno = txtCardNo.Value; ext.exttime = DateTime.Now; db.memberextract.InsertOnSubmit(ext); db.SubmitChanges(); ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('提现成功等待财务审核后进行手工打款。');window.location.href='MyPayMoney.aspx';</script>"); } } } }
protected void btnAddGroupBuy_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { goodstuan addTuan = new goodstuan(); addTuan.title = txtTitle.Value; addTuan.content = SearchDataClass.CheckStr(txtFckContent.Value); addTuan.starttime = Convert.ToDateTime(txtTimeSelect.Value.Split('-')[0]); var endtime = txtTimeSelect.Value.Split('-')[1] + " 23:59:59"; addTuan.endtime = Convert.ToDateTime(endtime); addTuan.validate = Convert.ToChar(drpValidate.SelectedValue); addTuan.setindex = Convert.ToChar(drpSetIndex.SelectedValue); addTuan.quantity = int.Parse(txtQuantily.Value); addTuan.price = Convert.ToDecimal(txtGoodsPrice.Value); addTuan.costprice = Convert.ToDecimal(txtGoodsCost.Value); addTuan.weight = txtWeight.Value.ToString(); //addTuan.community = int.Parse(drpCommunity.SelectedValue); //addTuan.shopid = int.Parse(drpShop.SelectedValue); addTuan.batch = txtGroupNum.Value; addTuan.img = HFurl.Value; addTuan.imgtwo = HFurl1.Value; addTuan.groupsort = int.Parse(drpGoodsSort.SelectedValue); addTuan.groupsortimg = HFurl2.Value.Trim(); addTuan.tuansummary = txtSummary.Value; addTuan.tuansummary1 = txtSummary1.Value; addTuan.tuansummary2 = txtSummary2.Value; addTuan.addtime = DateTime.Now; addTuan.selectytsort = Convert.ToChar(drpSaleGoodsSort.SelectedValue); addTuan.goodscode = txtGoodsCode.Value; addTuan.getgoodpoint = int.Parse(txtGetGoodPoint.Value); db.goodstuan.InsertOnSubmit(addTuan); db.SubmitChanges(); } Response.Redirect("GroupBuyManager.aspx?mid=" + Request["mid"] + "&type=" + Request["type"]); }
protected void btnUpdateHuoDong_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["upid"])) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(Request["upid"]) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { HuoDong upNot = db.HuoDong.Single(x => x.huodongId == int.Parse(Request["upid"])); upNot.huodongTitle = txtTitle.Value.Trim(); upNot.huodongPeople = txtPeople.Value; upNot.huodongKeyWord = txtKeyWord.Value; upNot.huodongDate = txtTimeSelect.Value; upNot.huodongContent = txtFckContent.Value.Trim(); upNot.huodongImg = HFurl.Value.Trim(); upNot.huodongsort = int.Parse(drpHuoDongSort.SelectedValue); //upNot.addTime = DateTime.Now; upNot.setindex = Convert.ToChar(drpSetIndex.SelectedValue); db.SubmitChanges(); } } Response.Redirect("HuoDongManager.aspx?mid=" + Request["mid"]); } }
public void BindShowUpInfo(string strUpid) { if (!string.IsNullOrEmpty(strUpid)) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(strUpid) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { HuoDong getNot = db.HuoDong.Single(x => x.huodongId == int.Parse(strUpid)); txtTitle.Value = getNot.huodongTitle; txtPeople.Value = getNot.huodongPeople; txtKeyWord.Value = getNot.huodongKeyWord; txtTimeSelect.Value = getNot.huodongDate.ToString(); drpSetIndex.SelectedValue = getNot.setindex.ToString(); txtFckContent.Value = getNot.huodongContent; this.hfDel.Value = getNot.huodongImg; this.HFurl.Value = getNot.huodongImg; if (!string.IsNullOrEmpty(getNot.huodongImg)) { this.iShowPhoto.Src = getNot.huodongImg; } else { this.iShowPhoto.Src = "assets/images/nophoto.gif"; } drpHuoDongSort.SelectedValue = getNot.huodongsort.ToString(); // db.SubmitChanges(); } } } }
protected void btnUpdatePlantDoctor_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["upid"])) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(Request["upid"]) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { plantdoctor upNot = db.plantdoctor.Single(x => x.Id == int.Parse(Request["upid"])); upNot.title = txtTitle.Value.Trim(); upNot.content = SearchDataClass.CheckStr(txtFckContent.Value); upNot.validate = Convert.ToChar(drpValidate.SelectedValue); upNot.setindex = Convert.ToChar(drpSetIndex.SelectedValue); upNot.plantdoctorsort = int.Parse(drpPlantDoctorSort.SelectedValue); if (!string.IsNullOrEmpty(HFurl.Value)) { upNot.img = HFurl.Value.Trim(); } upNot.addtime = DateTime.Now; db.SubmitChanges(); } } Response.Redirect("PlantDoctorManager.aspx"); } }
public void BindShowUpInfo(string strUpid) { if (!string.IsNullOrEmpty(strUpid)) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(strUpid) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { plantdoctor getNot = db.plantdoctor.Single(x => x.Id == int.Parse(strUpid)); txtTitle.Value = getNot.title; txtFckContent.Value = SearchDataClass.CheckStr(getNot.content); drpValidate.SelectedValue = getNot.validate.ToString(); drpSetIndex.SelectedValue = getNot.setindex.ToString(); this.drpPlantDoctorSort.SelectedValue = getNot.plantdoctorsort.ToString(); this.hfDel.Value = getNot.img; this.HFurl.Value = getNot.img; if (!string.IsNullOrEmpty(getNot.img)) { this.iShowPhoto.Src = getNot.img; } else { this.iShowPhoto.Src = "assets/images/nophoto.gif"; } //db.SubmitChanges(); } } } }
public void BindShowUpInfo(string strUpid) { if (!string.IsNullOrEmpty(strUpid)) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(strUpid) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { Advertisement getNot = db.Advertisement.Single(x => x.AdID == int.Parse(strUpid)); txtTitle.Value = getNot.AdTitle; txtFckContent.Value = getNot.AdContent; this.hfDel.Value = getNot.AdImg; this.HFurl.Value = getNot.AdImg; if (!string.IsNullOrEmpty(getNot.AdImg)) { this.iShowPhoto.Src = getNot.AdImg; } else { this.iShowPhoto.Src = "assets/images/nophoto.gif"; } txtCompany.Value = getNot.Company; drpSetIndex.SelectedValue = getNot.setindex.ToString(); txtGoodsCode.Value = getNot.goodscode; // db.SubmitChanges(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpCookie getCookies = Request.Cookies["UserLogin"]; if (getCookies != null) { spClientName.InnerHtml = "【" + Server.UrlDecode(getCookies["ClientName"].ToString()) + "】 Welcome To 益生联盟数据平台"; string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; var hour = string.Empty; if (DateTime.Now.Hour > 12) { hour = "下午" + DateTime.Now.Hour + "\n时"; } else { hour = "上午" + DateTime.Now.Hour + "\n时"; } spNowTime.InnerText = DateTime.Now.ToString("yyyy年MM月dd日") + "\n" + Day[Convert.ToInt16(DateTime.Now.DayOfWeek)] + "\n" + hour;; using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { var getSoStatus = from p in db.goodssort select new { p.sortId, p.sortName, p.sortFatherId, p.sortPath }; if (getSoStatus.Count() <= 0) { goodssort insert = new goodssort { sortName = "无上级分类", sortFatherId = -1, sortPath = "-1", addTime = DateTime.Now }; db.goodssort.InsertOnSubmit(insert); db.SubmitChanges(); } DataTable dtSort = SearchDataClass.ToDataTable(getSoStatus); //添加根目录 DataRow[] drs = dtSort.Select("sortFatherId=-1"); for (var i = 0; i < drs.Length; i++) { string nodeid = drs[i]["sortId"].ToString(); string text = drs[i]["sortName"].ToString(); text = "╋" + text; this.drpGoodstSort.Items.Add(new ListItem(text, nodeid)); this.drpEditGoodstSort.Items.Add(new ListItem(text, nodeid)); int sonparentid = int.Parse(nodeid); SearchDataClass.addOtherDll("", sonparentid, dtSort, 1, drpGoodstSort); SearchDataClass.addOtherDll("", sonparentid, dtSort, 1, drpEditGoodstSort); } drpGoodstSort.DataBind(); drpGoodstSort.Items.Insert(0, new ListItem("-请选择商品类型-")); drpEditGoodstSort.DataBind(); drpEditGoodstSort.Items.Insert(0, new ListItem("-请选择商品类型-")); } } else { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请登录在进行查询。');window.location.href='Login.aspx';</script>"); } } }
protected void btnAddUserRPoint_Click(object sender, EventArgs e) { //充值成功状态 var result = false; var chongzhipoint = int.Parse(txtPoint.Value); if (chongzhipoint > 0) { //积分 int addpoint = 0; using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { try { pointdetails pointadd = new pointdetails(); pointadd.userid = int.Parse(hfuserid.Value); pointadd.getpoint = chongzhipoint; pointadd.getpointreason = txtFckContent.Value; pointadd.getpointtime = DateTime.Now; db.pointdetails.InsertOnSubmit(pointadd); db.SubmitChanges(); result = true; } catch (Exception ex) { result = false; } finally { if (result) //成功后更新余额 { //检索剩余金额+刚充值金额 +积分 using (EnshineUnionDataContext dbup = new EnshineUnionDataContext()) { var userpoint = dbup.UserInfo.SingleOrDefault(x => x.Id == int.Parse(hfuserid.Value)).point; UserInfo upinfo = dbup.UserInfo.Single(x => x.Id == int.Parse(hfuserid.Value)); addpoint = int.Parse(userpoint.ToString()) + int.Parse(txtPoint.Value); upinfo.point = addpoint; dbup.SubmitChanges(); } } } } spMessage.InnerHtml = "手机号为:" + txtRecTel.Value + "充值积分成功,账户积分为:" + addpoint + "分,请等待5秒系统自动会自动跳转。<script>setTimeout(function(){window.location.href='UserRecharge.aspx';},5000);</script>"; txtFckContent.Value = ""; txtRecTel.Value = ""; txtRecMoney.Value = ""; hfuserid.Value = ""; txtPoint.Value = ""; } else { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('充值积分不能为0');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpCookie getCookies = Request.Cookies["UserLogin"]; if (getCookies != null) { spClientName.InnerHtml = "【" + Server.UrlDecode(getCookies["ClientName"].ToString()) + "】 Welcome To 益生联盟数据平台"; string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; var hour = string.Empty; if (DateTime.Now.Hour > 12) { hour = "下午" + DateTime.Now.Hour + "\n时"; } else { hour = "上午" + DateTime.Now.Hour + "\n时"; } spNowTime.InnerText = DateTime.Now.ToString("yyyy年MM月dd日") + "\n" + Day[Convert.ToInt16(DateTime.Now.DayOfWeek)] + "\n" + hour;; using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { var buyTop = (from a in db.orders join b in db.UserInfo on new { buyername = a.buyername } equals new { buyername = b.Id } where Convert.ToString(a.orderstatus) == "1" group new { b, a } by new { b.name, b.tel } into g orderby (System.Decimal?) g.Sum(p => p.a.orderprice) descending select new { SumPrice = (System.Decimal?)g.Sum(p => p.a.orderprice), OrderCount = (Int64?)g.Count(p => p.a.orderno != null), g.Key.name, g.Key.tel }).Take(50); if (buyTop.Count() > 0) { rpMemberBuyTopTotal.DataSource = buyTop; rpMemberBuyTopTotal.DataBind(); } else { liMessage2.Visible = true; } } } else { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请登录在进行查询。');window.location.href='Login.aspx';</script>"); } } }
protected void btnAddUserInfo_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { UserInfo adNot = new UserInfo(); adNot.nickname = txtNickName.Value.Trim(); adNot.name = txtName.Value.Trim();; adNot.tel = txtTel.Value.Trim();; adNot.email = txtEmail.Value.Trim();; adNot.sex = Convert.ToChar(drpSex.SelectedValue); adNot.address = txtAddress.Value.Trim();; //20161031 更新空格到逗号分割 // adNot.areacity = seachprov.SelectedItem.Text + " " + seachcity.SelectedItem.Text + " " + //seachdistrict.SelectedItem.Text; adNot.areacity = seachprov.SelectedItem.Text + "," + seachcity.SelectedItem.Text + "," + seachdistrict.SelectedItem.Text; //txtAreacity.Value.Trim(); adNot.pass = txtPass.Value.Trim();; adNot.invitedcode = txtInvitedCode.Value.Trim(); //adNot.cardno = txtCardNo.Value; //adNot.plantnum = txtPlantNum.Value; //adNot.homenum = txtHomeNum.Value; //adNot.homeinfo = txtHomeInfo.Value; //adNot.plantsort = txtPlantSort.Value; adNot.cardimg = HFurl.Value; adNot.shopset = int.Parse(drpSelectShop.SelectedValue); adNot.remarks = txtRemarks.Value; adNot.paypassword = txtPayPwd.Value; // adNot.highestgudong = txtHighstGudong.Value; adNot.housemoney = 0.00m; adNot.point = 0; var getUserID = from p in db.UserInfo where p.tel == txtInvitedCode.Value select p.Id; if (getUserID.Count() > 0) { foreach (var item in getUserID) { adNot.fenxiaoid = item; } } //20160301 add adNot.juese = txtJueSe.Value; //adNot.gudongjibie= txtGuDongJibie.Value ; //adNot.suozhangufen=txtSuoZhanGuFen.Value ; // adNot.xiangzhen=txtXiangZhen.Value; // adNot.xiangcun= txtXiangCun.Value; //adNot.shangjigudong= hfShangJiGuDong.Value;; // adNot.shangjizhanzhang = hfShangJiZhanZhang.Value; adNot.addtime = DateTime.Now; db.UserInfo.InsertOnSubmit(adNot); db.SubmitChanges(); } Response.Redirect("UserinfoManager.aspx?mid=" + Request["mid"]); }
public void BindShowUpInfo(string strUpid) { if (!string.IsNullOrEmpty(strUpid)) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(strUpid) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { notices getNot = db.notices.Single(x => x.Id == int.Parse(strUpid)); txtTitle.Value = SearchDataClass.CheckStr(getNot.title);; txtFckContent.Value = getNot.content; //SearchDataClass.CheckStr(getNot.content); //drpValidate.SelectedValue = getNot.validate.ToString(); //drpSetIndex.SelectedValue = getNot.setindex.ToString(); this.drpNewsSort.SelectedValue = getNot.newssort.ToString(); this.hfDel.Value = getNot.img; this.HFurl.Value = getNot.img; if (!string.IsNullOrEmpty(getNot.img)) { this.iShowPhoto.Src = getNot.img; } else { this.iShowPhoto.Src = "assets/images/nophoto.gif"; } this.hfDel1.Value = getNot.img1; this.HFurl1.Value = getNot.img1; if (!string.IsNullOrEmpty(getNot.img1)) { this.iShowPhoto1.Src = getNot.img1; } else { this.iShowPhoto1.Src = "assets/images/nophoto.gif"; } this.hfDel2.Value = getNot.img2; this.HFurl2.Value = getNot.img2; if (!string.IsNullOrEmpty(getNot.img2)) { this.iShowPhoto2.Src = getNot.img2; } else { this.iShowPhoto2.Src = "assets/images/nophoto.gif"; } txtSource.Value = getNot.newssource; } } } }
/// <summary> /// 共通引用部分 绑定省市区 /// //初始化 市和县级列表 ///初始化市列表 /// </summary> /// <param name="codeid"></param> /// <param name="ddlArea"></param> public void BindCityArea(string codeid, DropDownList ddlArea) { ddlArea.Items.Clear(); using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { var getDis = (from p in db.areas where p.parentid == codeid select new { p.id, p.areaname }).ToList(); ddlArea.DataTextField = "areaname"; ddlArea.DataValueField = "id"; ddlArea.DataSource = getDis; ddlArea.DataBind(); ddlArea.Items.Insert(0, new ListItem("请选择")); } }
public string PhotoUrl; //图片路径(预览用) protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpCookie getCookies = Request.Cookies["UserLogin"]; if (getCookies != null) { spClientName.InnerHtml = "【" + Server.UrlDecode(getCookies["ClientName"].ToString()) + "】 Welcome To Food Order Manager"; string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; var hour = string.Empty; if (DateTime.Now.Hour > 12) { hour = "下午" + DateTime.Now.Hour + "\n时"; } else { hour = "上午" + DateTime.Now.Hour + "\n时"; } spNowTime.InnerText = DateTime.Now.ToString("yyyy年MM月dd日") + "\n" + Day[Convert.ToInt16(DateTime.Now.DayOfWeek)] + "\n" + hour;; using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { var getSoStatus = (from p in db.goodssort select new { p.sortId, p.sortName }).ToList(); drpGoodsSort.DataTextField = "sortName"; drpGoodsSort.DataValueField = "sortId"; drpGoodsSort.DataSource = getSoStatus; drpGoodsSort.DataBind(); drpGoodsSort.Items.Insert(0, new ListItem("-请选择商品类型-")); } if (!string.IsNullOrEmpty(Request["upid"])) { if (SearchDataClass.IsNumber(Request["upid"]) == true) { this.btnUpdateGroupBuy.Attributes["onclick"] = "return GroupBuyValidate()"; } this.btnReset.Attributes["onclick"] = "return ClearGroupBuy()"; this.BindShowUpInfo(Request["upid"]); this.btnAddGroupBuy.Visible = false; this.btnUpdateGroupBuy.Visible = true; } else { this.btnAddGroupBuy.Attributes["onclick"] = "return GroupBuyValidate()"; this.btnReset.Attributes["onclick"] = "return ClearGroupBuy()"; this.btnAddGroupBuy.Visible = true; this.btnUpdateGroupBuy.Visible = false; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请登录在进行查询。');window.location.href='Login.aspx';</script>"); } } }
public void BindShowUpInfo(string strUpid) { if (!string.IsNullOrEmpty(strUpid)) { if (SearchDataClass.IsNumber(strUpid) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { goodstuan getOrderBy = db.goodstuan.Single(x => x.Id == int.Parse(strUpid)); txtTitle.Value = getOrderBy.title; txtFckContent.Value = SearchDataClass.CheckStr(getOrderBy.content); txtTimeSelect.Value = Convert.ToDateTime(getOrderBy.starttime).ToString("yyyy/MM/dd") + "-" + Convert.ToDateTime(getOrderBy.endtime).ToString("yyyy/MM/dd"); drpValidate.SelectedValue = getOrderBy.validate.ToString(); drpSetIndex.SelectedValue = getOrderBy.setindex.ToString(); txtQuantily.Value = getOrderBy.quantity.ToString(); txtGoodsPrice.Value = Convert.ToString(getOrderBy.price); txtGoodsCost.Value = Convert.ToString(getOrderBy.costprice.ToString()); txtWeight.Value = getOrderBy.weight.ToString(); // drpCommunity.SelectedValue = getOrderBy.community.ToString(); //drpShop.SelectedValue = getOrderBy.shopid.ToString(); txtGroupNum.Value = getOrderBy.batch.ToString(); txtSummary.Value = getOrderBy.tuansummary; txtSummary1.Value = getOrderBy.tuansummary1; txtSummary2.Value = getOrderBy.tuansummary2; this.hfDel.Value = getOrderBy.img; this.HFurl.Value = getOrderBy.img; this.iShowPhoto.Src = getOrderBy.img == "" ? "assets/images/nophoto.gif" : getOrderBy.img;; this.hfDel1.Value = getOrderBy.imgtwo; this.HFurl1.Value = getOrderBy.imgtwo; this.iShowPhoto1.Src = getOrderBy.imgtwo == "" ? "assets/images/nophoto.gif" : getOrderBy.imgtwo; this.hfDel2.Value = getOrderBy.groupsortimg; this.HFurl2.Value = getOrderBy.groupsortimg; if (!string.IsNullOrEmpty(getOrderBy.groupsortimg)) { this.iShowPhoto2.Src = getOrderBy.groupsortimg; } else { this.iShowPhoto2.Src = "assets/images/nophoto.gif"; } drpGoodsSort.SelectedIndex = getOrderBy.groupsort; drpSaleGoodsSort.SelectedValue = getOrderBy.selectytsort.ToString(); txtGoodsCode.Value = getOrderBy.goodscode; txtGetGoodPoint.Value = getOrderBy.getgoodpoint.ToString(); db.SubmitChanges(); } } } }
protected void btnUpdateGoods_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request["upid"])) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(Request["upid"]) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { goodspackage upNot = db.goodspackage.Single(x => x.goodsId == int.Parse(Request["upid"])); upNot.goodstitle = txtTitle.Value.Trim(); upNot.goodscontent = SearchDataClass.CheckStr(txtFckContent.Value); upNot.goodsvalidate = Convert.ToChar(drpValidate.SelectedValue); upNot.setindex = Convert.ToChar(drpSetIndex.SelectedValue); upNot.goodscode = txtGoodsCode.Value; upNot.goodsprice = Convert.ToDecimal(txtGoodsPrice.Value); upNot.goodssort = int.Parse(drpGoodsSort.SelectedValue); if (!string.IsNullOrEmpty(HFurl.Value)) { upNot.goodsimg = HFurl.Value.Trim(); } upNot.goodstock = int.Parse(txtStockNum.Value); upNot.goodsSales = Convert.ToChar(drpSales.SelectedValue); upNot.goodscost = Convert.ToDecimal(txtGoodsCost.Value); upNot.ifexchange = Convert.ToChar(drpExchangeGood.SelectedValue); if (!string.IsNullOrEmpty(txtExchangePoint.Value)) { upNot.exchangepoint = int.Parse(txtExchangePoint.Value); } if (!string.IsNullOrEmpty(txtGetGoodPoint.Value)) { upNot.getgoodpoint = int.Parse(txtGetGoodPoint.Value); } upNot.tichengpoint = ticheng.Value == "" ? "0/20/20/10" : ticheng.Value; //upNot.goodgoldprice = Convert.ToDecimal(txtGoldPrice.Value); //upNot.goodsilverprice = Convert.ToDecimal(txtSilverprice.Value); upNot.ifxiangou = Convert.ToChar(drpXianGou.SelectedValue); upNot.xiangounumber = txtXianGouNumber.Value == "" ? "0/0/0" : txtXianGouNumber.Value;; upNot.goodsspec = txtGoodsSpec.Value; upNot.goodscompany = txtGoodsCompany.Value; //upNot.iftuangou = Convert.ToChar(drpGroupBy.SelectedValue); // upNot.expiredate = Convert.ToDateTime(txtExpireDate.Value); // upNot.selectytsort = Convert.ToChar(drpSaleGoodsSort.SelectedValue); db.SubmitChanges(); } } Response.Redirect("GoodsPackageManager.aspx?mid=" + Request["mid"]); } }
protected void btnAddRole_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { userrole url = new userrole(); url.rolename = txtRoleName.Value.Trim(); url.roledescribe = txtFckContent.Value.Trim(); url.powerid = hfRole.Value.Trim().TrimEnd(','); url.addTime = DateTime.Now;; db.userrole.InsertOnSubmit(url); db.SubmitChanges(); } Response.Redirect("UserRoleManager.aspx?mid=" + Request["mid"]); }
protected void btnAddAd_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { Advertisement addNot = new Advertisement(); addNot.AdTitle = txtTitle.Value.Trim(); addNot.AdContent = txtFckContent.Value.Trim(); addNot.Company = txtCompany.Value; addNot.AdImg = HFurl.Value.Trim(); addNot.Addtime = DateTime.Now; addNot.setindex = Convert.ToChar(drpSetIndex.SelectedValue); addNot.goodscode = txtGoodsCode.Value; db.Advertisement.InsertOnSubmit(addNot); db.SubmitChanges(); } Response.Redirect("AdManager.aspx?mid=" + Request["mid"]); }
//序列化,将对象转化为JSON字符串 protected string GetJson() { //为启用 AFAX 的应用程序提供序列化和反序列化功能 System.Web.Script.Serialization.JavaScriptSerializer json = new System.Web.Script.Serialization.JavaScriptSerializer(); List <MenuList> list = new List <MenuList>(); //获取管理员模块列表 using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { list = (from p in db.menulist where p.isshow == 'Y' select new MenuList { menuid = p.menuid, menuname = p.menuname, fathermenuid = p.fathermenuid }).ToList <MenuList>(); } //将对象转换为JSON字符串 return(json.Serialize(list)); }
public void BindShowUpInfo(string strUpid) { if (!string.IsNullOrEmpty(strUpid)) { if (EnshineUnionManager.model.SearchDataClass.IsNumber(strUpid) == true) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { userrole getNot = db.userrole.Single(x => x.roleid == int.Parse(strUpid)); txtRoleName.Value = getNot.rolename; txtFckContent.Value = getNot.roledescribe; hfRole.Value = getNot.powerid; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HttpCookie getCookies = Request.Cookies["UserLogin"]; if (getCookies != null) { spClientName.InnerHtml = "【" + Server.UrlDecode(getCookies["ClientName"].ToString()) + "】 Welcome To 益生联盟数据平台"; string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; var hour = string.Empty; if (DateTime.Now.Hour > 12) { hour = "下午" + DateTime.Now.Hour + "\n时"; } else { hour = "上午" + DateTime.Now.Hour + "\n时"; } spNowTime.InnerText = DateTime.Now.ToString("yyyy年MM月dd日") + "\n" + Day[Convert.ToInt16(DateTime.Now.DayOfWeek)] + "\n" + hour;; if (getCookies["ClientName"] != null) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { if (getCookies["ClientName"] != "admin") { spMoney.InnerText = Convert.ToDecimal(db.UserInfo.Single(x => x.tel == getCookies["ClientName"]).housemoney).ToString("0.00"); } else { spMoney.InnerText = "0.00"; btnMemberExtrac.Disabled = false; } } } else { spMoney.InnerText = "0.00"; } } else { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('请登录在进行查询。');window.location.href='Login.aspx';</script>"); } } }
protected void btnAddPlantDoctorSort_ServerClick(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { //取得选择父分类的sortpath以便更新新添加分类path var sortPath = db.plantdoctorsort.Single(x => x.sortId == Convert.ToInt32(drpPlantSort.SelectedValue)).sortPath; //判断三级分类只能三级 if (sortPath.Split(',').Length <= 3) { plantdoctorsort addOk = new plantdoctorsort(); addOk.sortFatherId = int.Parse(drpPlantSort.SelectedValue); addOk.sortName = txtPlantDoctorSort.Value; // addOk.sortSonId = int.Parse(drpPlantSort.SelectedValue); //获取信息 addOk.sortImg = HFurl.Value; addOk.addTime = DateTime.Now; db.plantdoctorsort.InsertOnSubmit(addOk); db.SubmitChanges(); //取得新添加分类ID var sortId = db.plantdoctorsort.Max(x => x.sortId); //获取选择父分类的sortSonId(更新时默认本ID) //var sortSonId=db.plantdoctorsort.Single(x => // x.sortId == Convert.ToInt32(drpPlantSort.SelectedValue)).sortSonId; plantdoctorsort upSonID = db.plantdoctorsort.Single(x => x.sortId == Convert.ToInt32(drpPlantSort.SelectedValue)); upSonID.sortSonId = sortId; plantdoctorsort updateOK = db.plantdoctorsort.Single(x => x.sortId == Convert.ToInt32(sortId)); if (!string.IsNullOrEmpty(sortPath) && sortPath != "-1") { updateOK.sortPath = sortPath + "," + sortId; } else { updateOK.sortPath = drpPlantSort.SelectedValue + "," + sortId; } db.SubmitChanges(); } else { ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('不能创建超过三级的植保分类,当前为第三级。');</script>"); } } /// Response.Redirect("PlantDoctorSortManger.aspx"); }
protected void btnAddNotices_Click(object sender, EventArgs e) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { superadmin addNot = new superadmin(); addNot.name = txtlogname.Value.Trim(); addNot.pass = txtPass.Value; addNot.truename = txttruename.Value; addNot.contacttel = txtTel.Value; addNot.roleid = int.Parse(ddlrole.SelectedValue); var ifdisable = cbifdisable.Checked == true ? 'Y' : 'N'; addNot.ifdisable = ifdisable; addNot.addtime = DateTime.Now; db.superadmin.InsertOnSubmit(addNot); db.SubmitChanges(); } Response.Redirect("AdminManager.aspx?mid=" + Request["mid"]); }
public void GetFaherMenuList(string[] mid, int parentid) { using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { var getFaMenuList = //from p in db.menulist where p.fathermenuid==0 select p; from menulist in db.menulist where mid.Contains(menulist.menuid.ToString()) && menulist.fathermenuid == parentid && Convert.ToString((Convert.ToString(menulist.isshow) ?? "Y")) == "Y" orderby menulist.sortid select menulist; if (getFaMenuList.Count() > 0) { rpFatherMenu.DataSource = getFaMenuList; rpFatherMenu.DataBind(); } } }
protected void rpFatherMenu_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Repeater rptProduct = (Repeater)e.Item.FindControl("rpSonMenu"); //找到分类Repeater关联的数据项 menulist rowv = (menulist)e.Item.DataItem; //提取分类ID int CategorieId = Convert.ToInt32(rowv.menuid); using (EnshineUnionDataContext db = new EnshineUnionDataContext()) { HttpCookie getCookies = Request.Cookies["UserLogin"]; if (getCookies != null) { string[] sonRole = getCookies["UserRole"].ToString().Split(','); var getSonMenuList = //from p in db.menulist where p.fathermenuid == CategorieId select p; from menulist in db.menulist where sonRole.Contains(menulist.menuid.ToString()) && menulist.fathermenuid == CategorieId && Convert.ToString((Convert.ToString(menulist.isshow) ?? "Y")) == "Y" orderby menulist.sortid select menulist; if (getSonMenuList.Count() > 0) { //根据分类ID查询该分类下的产品,并绑定产品Repeater rptProduct.DataSource = getSonMenuList; rptProduct.DataBind(); } //else // { //var getFaMenuList = from menulist in db.menulist // where sonRole.Contains(menulist.menuid.ToString()) && // Convert.ToString((Convert.ToString(menulist.isshow) ?? "Y")) == "Y" // select menulist.fathermenuid; // } } else { return; } } } }