protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); Forms model = db.Forms.Where(s => s.Id.Equals(tmpid) && s.Type.Equals(27)).FirstOrDefault(); if (model != null) { model.Status = 2; db.SaveChanges(); } } if (!string.IsNullOrEmpty(Request["jeid"]) && WebUtil.IsDigit(Request["jeid"])) { int tmpid = Convert.ToInt32(Request["jeid"]); Forms model = db.Forms.Where(s => s.Id.Equals(tmpid) && s.Type.Equals(27)).FirstOrDefault(); if (model != null) { model.Status = 1; db.SaveChanges(); } } } BindRepeater(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); IList <AccountUnionPage> xList = db.AccountUnionPage.Where(a => a.AccountID.Equals(tmpid)).ToList(); if (xList.Count > 0) { foreach (var a in xList) { db.AccountUnionPage.DeleteObject(a); db.SaveChanges(); } } WXEF.SysAccount model = db.SysAccount.Where(s => s.AccountID.Equals(tmpid)).FirstOrDefault(); if (model != null) { db.SysAccount.DeleteObject(model); db.SaveChanges(); } } } RptBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); Forms model = //DbSession.Default.From<Article>().Where(s => s.AritcleID.Equals(tmpid)).ToFirstDefault(); db.Forms.Where(s => s.Id.Equals(tmpid)).FirstOrDefault(); if (model != null) { //model.Attach(); db.Forms.DeleteObject(model); //model. = 2; //model.UpdateTime = DateTime.Now; // int ts = DbSession.Default.Update<Article>(model); db.SaveChanges(); } } } BindRepeater(); } }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { using (WXDBEntities db = new WXDBEntities()) { ModuleItem xModuleItem = new ModuleItem(); xModuleItem.ModuleName = txtModuleName.Text; xModuleItem.DefaultUrl = txtDefaultUrl.Text; if (upPicPath.HasFile) { // 开始保存文件信息("~/UploadedImages/"); string _img = Guid.NewGuid().ToString() + Path.GetExtension(upPicPath.FileName).ToLower(); //upPicPath.PostedFile.SaveAs(MapPath("~/Manage/UploadFiles/Sys/" + _img)); upPicPath.PostedFile.SaveAs(globalVariables.SysDirString + _img); xModuleItem.Picpath = _img; } db.ModuleItem.AddObject(xModuleItem); db.SaveChanges(); } if (string.IsNullOrEmpty(Request.QueryString["type"])) { jsHint.toUrl("模块信息" + txtModuleName.Text + "增加成功!", "ModuleList.aspx"); } else { jsHint.toUrl("模块信息" + txtModuleName.Text + "增加成功!", Request.UrlReferrer.OriginalString); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { name = loginname; if (!string.IsNullOrEmpty(Request.Params["isid"])) { } // 处理删除操作 if (!string.IsNullOrEmpty(Request.QueryString["del"]) && WebUtil.IsDigit(Request.QueryString["del"])) { using (WXDBEntities db = new WXDBEntities()) { int tmpid = int.Parse(Request.QueryString["del"]); var model = db.RegisterInfo.Where(s => s.Id == tmpid).FirstOrDefault(); if (model != null) { db.RegisterInfo.DeleteObject(model); db.SaveChanges(); } jsHint.toUrl("删除成功!", "RegistInfo.aspx"); //MaintenanceService.Instance.DeleteAccountById(int.Parse(Request.QueryString["del"])); } } BindRepeater(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); UserPoinLog model = db.UserPoinLog.Where(s => s.Id == tmpid).FirstOrDefault(); if (model != null) { var tm = db.Forms.Where(s => s.Source.Equals(topid) && s.Type.Equals(8)).FirstOrDefault(); if (tm != null) { //tm.JFCount = tm.JFCount - Convert.ToDecimal(model.Extent1); // tm.Status = tm.Status - 1; } db.UserPoinLog.DeleteObject(model); db.SaveChanges(); } } } BindRepeater(topid); } using (WXDBEntities db = new WXDBEntities()) { var tm = db.Forms.Where(s => s.Source.Equals(topid) && s.Type.Equals(8)).FirstOrDefault(); if (tm != null) { ctitile = tm.Name; } } }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { if (string.IsNullOrEmpty(txtMarkInfo.Text.Trim())) { jsHint.Back("请输入销售咨询信息!"); return; } using (WXDBEntities db = new WXDBEntities()) { var model = db.MarketInfo.FirstOrDefault(); if (model != null) { model.Contents = txtMarkInfo.Text.Replace("\r\n", "<br/>"); model.UpdateTime = DateTime.Now; model.UpdateUser = loginname; model.UpdateUserId = UserId; } else { model = new MarketInfo(); model.Contents = txtMarkInfo.Text.Replace("\r\n", "<br/>"); model.Description = ""; model.Status = 0; model.Orders = 0; model.AddTime = DateTime.Now; model.UpdateTime = DateTime.Now; model.UpdateUser = loginname; model.UpdateUserId = UserId; db.MarketInfo.AddObject(model); } db.SaveChanges(); jsHint.toUrl("信息修改成功!", "marketInfo.aspx"); } }
/// <summary> /// 修改保存操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, ImageClickEventArgs e) { using (WXDBEntities db = new WXDBEntities()) { int id = int.Parse(Request.QueryString["id"]); PageItem xPageItem = db.PageItem.Where(p => p.ItemID == id).FirstOrDefault(); xPageItem.PageName = txtPageName.Text; xPageItem.Url = txtUrl.Text; xPageItem.IsDisplay = IsDisplay.Checked; if (upPic.HasFile) { if (!string.IsNullOrEmpty(xPageItem.PicUrl) && File.Exists(globalVariables.SysDirString + xPageItem.PicUrl)) { File.Delete(globalVariables.SysDirString + xPageItem.PicUrl); } string _img = Guid.NewGuid().ToString() + Path.GetExtension(upPic.FileName).ToLower(); upPic.PostedFile.SaveAs(globalVariables.SysDirString + _img); xPageItem.PicUrl = _img; } db.SaveChanges(); } jsHint.toUrl("页面信息" + txtPageName.Text + "修改成功!", refer.Value); }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { if (string.IsNullOrEmpty(txttitle.Text.Trim())) { jsHint.Back("请输入进度名称信息!"); return; } using (WXDBEntities db = new WXDBEntities()) { int tmpid = Convert.ToInt32(Request.Params["id"]); var model = db.TuInfo.Where(s => s.Id == tmpid).FirstOrDefault(); model.name = txttitle.Text.Trim();// lat2 + ""; model.extend2 = txtsummary.Text.Trim(); model.updatetime = DateTime.Now; if (upPic.HasFile) { string _imgpath = Guid.NewGuid().ToString() + Path.GetExtension(upPic.FileName).ToLower(); upPic.PostedFile.SaveAs(globalVariables.NewsImgPath + _imgpath); model.varurl = _imgpath; } //db.TuInfo.AddObject(model); db.SaveChanges(); jsHint.toUrl("进度图信息编辑成功!", "jinduinfo.aspx"); } }
//新增留言 public void AddQues(HttpContext context) { string opid = context.Request.Params["tmpopid"]; string uname = context.Request.Params["tmpuname"]; string cot = context.Request.Params["tmpcont"]; try { using (WXDBEntities db = new WXDBEntities()) { var qumod = new ZxFw(); qumod.wxopenid = opid; qumod.Extend1 = uname; qumod.status = 0; qumod.orders = 0; qumod.qucont = Utils.EncodeHtml(cot); qumod.anscont = ""; qumod.addtime = DateTime.Now; qumod.updatetime = DateTime.Now; qumod.extend2 = ""; qumod.extend3 = ""; db.ZxFw.AddObject(qumod); db.SaveChanges(); context.Response.Write("1"); return; } } catch (Exception) { context.Response.Write("0"); return; } }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { using (WXDBEntities db = new WXDBEntities()) { PicType model = new PicType(); model.Title = txttitle.Text; model.Description = txtDesc.Text; model.Orders = Convert.ToInt32(txtorders.Text); model.AddTime = DateTime.Now; model.Status = 0; model.UpdateTime = DateTime.Now; model.Extend = loginname; model.Extend1 = loginname; try { db.PicType.AddObject(model); db.SaveChanges(); jsHint.toUrl("信息" + model.Title + "增加成功!", "PicTypeList.aspx"); } catch (Exception ex) { jsHint.Alert(ex.Message); } } }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { //if (drpActityType.SelectedValue == "-1") //{ // jsHint.Back("请选择活动信息类别!"); // return; //} if (string.IsNullOrEmpty(txttitle.Text.Trim())) { jsHint.Back("请输入活动标题!"); return; } if (string.IsNullOrEmpty(txtorders.Text.Trim())) { jsHint.Back("请输入排序号!"); return; } if (!WebUtil.IsDigit(txtorders.Text.Trim())) { jsHint.Back("排序号请输入数字!"); return; } if (string.IsNullOrEmpty(txtcontent.Value)) { jsHint.Back("请输入内容信息!"); return; } WXEF.Activity addobj = new WXEF.Activity(); addobj.Title = txttitle.Text; addobj.Entitle = ""; addobj.Author = loginname; addobj.UpdateAuthor = loginname; addobj.Orders = string.IsNullOrEmpty(txtorders.Text) ? 0 : int.Parse(txtorders.Text); addobj.Contents = txtcontent.Value;; addobj.Description = txtsummary.Text.Trim(); addobj.StartTime = Convert.ToDateTime(txtStart.Text.Trim()); addobj.EndTime = Convert.ToDateTime(txtEnd.Text.Trim()); addobj.AddTime = DateTime.Now; addobj.Status = rdisshow.SelectedValue == "0" ? 0 : 1; addobj.Type = 0;// Convert.ToInt32(drpActityType.SelectedValue); addobj.UpdateTime = DateTime.Now; if (upPic.HasFile) { string _imgpath = Guid.NewGuid().ToString() + Path.GetExtension(upPic.FileName).ToLower(); upPic.PostedFile.SaveAs(globalVariables.NewsImgPath + _imgpath); addobj.Conver = _imgpath; } else { addobj.Conver = ""; } using (WXDBEntities db = new WXDBEntities()) { db.Activity.AddObject(addobj); db.SaveChanges(); jsHint.toUrl("活动信息" + addobj.Title + "增加成功!", "ActivityList.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); Product model = db.Product.Where(s => s.Id.Equals(tmpid) && s.Extent3.Equals("1")).FirstOrDefault(); if (model != null) { //string strsql = "update Article set status=1 where Type=" + model.ID; //db.ExecuteStoreCommand(strsql); //db.ArticleType.DeleteObject(model);. db.Product.DeleteObject(model); db.SaveChanges(); } } if (!string.IsNullOrEmpty(Request["upd"]) && WebUtil.IsDigit(Request["upd"])) { int tmpid = Convert.ToInt32(Request["upd"]); Product model = db.Product.Where(s => s.Id.Equals(tmpid) && s.Extent3.Equals("1")).FirstOrDefault(); if (model != null) { model.Status = 1; db.SaveChanges(); } } } BindRepeater(cod); } if (!string.IsNullOrEmpty(cod)) { using (WXDBEntities db = new WXDBEntities()) { var tmodel = db.Forms.Where(s => s.Source.Equals(cod) && s.Type.Equals(8)).FirstOrDefault(); if (tmodel != null) { ctitile = tmodel.Name; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["refresh"]) && !string.IsNullOrEmpty(Request.QueryString["rId"])) { //PdmCollection.Instance.RebuildPdm(); jsHint.toUrl("权限分配完毕!", "AccountList.aspx"); } // 处理删除操作 if (!string.IsNullOrEmpty(Request.QueryString["del"]) && WebUtil.IsDigit(Request.QueryString["del"])) { using (WXDBEntities db = new WXDBEntities()) { int tmpid = int.Parse(Request.QueryString["del"]); IList <AccountUnionPage> xList = db.AccountUnionPage.Where(a => a.AccountID == tmpid).ToList(); if (xList.Count > 0) { foreach (var a in xList) { db.AccountUnionPage.DeleteObject(a); db.SaveChanges(); } } var model = db.SysAccount.Where(s => s.AccountID == tmpid).FirstOrDefault(); if (model != null) { db.SysAccount.DeleteObject(model); db.SaveChanges(); } jsHint.toUrl("删除成功!", "AccountList.aspx"); //MaintenanceService.Instance.DeleteAccountById(int.Parse(Request.QueryString["del"])); } } using (WXDBEntities db = new WXDBEntities()) { // 进行数据绑定 List <SysAccount> list = db.SysAccount.ToList(); WebUtil.CtrlToList <SysAccount>(rptAccount, list); } } ((maintenancemaster)this.Master).txtTitle = "帐号管理"; }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { //if (drpActityType.SelectedValue == "-1") //{ // jsHint.Back("请选择活动信息类别!"); // return; //} if (string.IsNullOrEmpty(txtKeword.Text.Trim())) { jsHint.Back("请输入关键词!"); return; } if (string.IsNullOrEmpty(txtcontent.Value.Trim())) { jsHint.Back("请输入关键词信息!"); return; } using (WXDBEntities db = new WXDBEntities()) { var tmpid = Convert.ToInt32(Request.Params["id"]); var m1 = db.WXKewWords.Where(s => s.Title.Equals(txtKeword.Text.Trim())).Where(s => s.Id != tmpid).FirstOrDefault(); if (m1 != null) { jsHint.Back("已存在该关键词信息,请重新输入关键词!"); return; } var tmp = db.WXKewWords.Where(s => s.Id == tmpid).FirstOrDefault(); if (tmp != null) { tmp.Title = txtKeword.Text.Trim(); tmp.Description = txtcontent.Value; tmp.UpdateTime = DateTime.Now; } else { tmp = new WXKewWords(); tmp.Title = txtKeword.Text.Trim(); tmp.Status = 0; tmp.Orders = 0; tmp.AddTime = DateTime.Now; tmp.UpdateTime = DateTime.Now; tmp.Type = 1; tmp.Description = txtcontent.Value; db.WXKewWords.AddObject(tmp); } try { db.SaveChanges(); jsHint.toUrl("关键词信息编辑成功!", "keyword.aspx"); } catch (Exception et) { jsHint.Alert("错误信息" + et.Message); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // 处理删除模块操作 if (!string.IsNullOrEmpty(Request.QueryString["delid"])) { int mid = int.Parse(Request.QueryString["delid"]); using (WXDBEntities db = new WXDBEntities()) { //IList<PageItem> xList = db.PageItem.Where(p => p.ModuleID == mid).ToList(); //if (xList.Count > 0) //{ // foreach (var p in xList) // { // PageItem xPageItem = p; // db.PageItem.DeleteObject(xPageItem); // db.SaveChanges(); // } //} ModuleItem xModuleItem = db.ModuleItem.Where(m => m.ModuleID == mid).FirstOrDefault(); db.ModuleItem.DeleteObject(xModuleItem); db.SaveChanges(); jsHint.toUrl("删除成功!", "ModuleList.aspx"); } } // 处理删除页面操作 if (!string.IsNullOrEmpty(Request.QueryString["delpid"])) { int pid = int.Parse(Request.QueryString["delid"]); using (WXDBEntities db = new WXDBEntities()) { PageItem xPageItem = db.PageItem.Where(p => p.ItemID == pid).FirstOrDefault(); db.PageItem.DeleteObject(xPageItem); db.SaveChanges(); } jsHint.toUrl("删除成功!", "ModuleList.aspx"); } // 处理排序操作 if (!string.IsNullOrEmpty(Request.QueryString["action"])) { //if (!string.IsNullOrEmpty(Request.QueryString["id"])) // MaintenanceService.Instance.ModifyModuleOrdersById(int.Parse(Request.QueryString["id"]), Request.QueryString["action"]); //else if (!string.IsNullOrEmpty(Request.QueryString["pid"])) // MaintenanceService.Instance.ModifyPageOrdersById(int.Parse(Request.QueryString["pid"]), Request.QueryString["action"]); } // 进行数据绑定 InitCtrls(); } ((maintenancemaster)this.Master).txtTitle = "模块信息列表"; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); AResource model = //DbSession.Default.From<Article>().Where(s => s.AritcleID.Equals(tmpid)).ToFirstDefault(); db.AResource.Where(s => s.RId == tmpid).FirstOrDefault(); if (model != null) { //model.Attach(); db.AResource.DeleteObject(model); //model. = 2; //model.UpdateTime = DateTime.Now; // int ts = DbSession.Default.Update<Article>(model); db.SaveChanges(); } } } } BindRepeater(); WebConn.ManageInfoType sex = (WebConn.ManageInfoType)typid; switch (sex) { case WebConn.ManageInfoType.半岛美食: stTitle = WebConn.ManageInfoType.半岛美食.ToString(); break; case WebConn.ManageInfoType.万宁四诊: stTitle = WebConn.ManageInfoType.万宁四诊.ToString(); break; case WebConn.ManageInfoType.其他美食: stTitle = WebConn.ManageInfoType.其他美食.ToString(); break; case WebConn.ManageInfoType.特色小吃: stTitle = WebConn.ManageInfoType.特色小吃.ToString(); break; case WebConn.ManageInfoType.美食餐厅: stTitle = WebConn.ManageInfoType.美食餐厅.ToString(); break; } string reqStrUrl = "BDMSList.aspx?tid=" + typid; //if (Request.UrlReferrer != null) //{ // reqStrUrl = Request.UrlReferrer.ToString(); //} btn_Back.Attributes.Add("onclick", "window.location.href='" + reqStrUrl + "';return false;"); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); Article model = db.Article.Where(s => s.AritcleID == tmpid).FirstOrDefault(); if (model != null) { model.Status = 2; //string strsql = "update Article set status=1 where Type=" + model.ID; //db.ExecuteStoreCommand(strsql); //db.ArticleType.DeleteObject(model); db.SaveChanges(); } } } BindRepeater(typid); } if (typid != -1) { WebConn.ManageInfoType sex = (WebConn.ManageInfoType)typid; switch (sex) { case WebConn.ManageInfoType.半岛美食: sttitle = WebConn.ManageInfoType.半岛美食.ToString(); break; case WebConn.ManageInfoType.万宁四诊: sttitle = WebConn.ManageInfoType.万宁四诊.ToString(); break; case WebConn.ManageInfoType.其他美食: sttitle = WebConn.ManageInfoType.其他美食.ToString(); break; case WebConn.ManageInfoType.特色小吃: sttitle = WebConn.ManageInfoType.特色小吃.ToString(); break; case WebConn.ManageInfoType.美食餐厅: sttitle = WebConn.ManageInfoType.美食餐厅.ToString(); break; } } }
protected void Button1_Click(object sender, EventArgs e) { using (WXDBEntities db = new WXDBEntities()) { List <string> namelist = new List <string>(); namelist.Add("乔偲蔚"); namelist.Add("周晓俊"); namelist.Add("周嘉"); namelist.Add("季优美"); namelist.Add("赵天云"); namelist.Add("周晶"); namelist.Add("邬君雯"); namelist.Add("沈德虎"); namelist.Add("程丽娟"); namelist.Add("王玲"); namelist.Add("俞康"); namelist.Add("赵俊翔"); namelist.Add("胡春阳"); namelist.Add("罗百江"); namelist.Add("张拯"); namelist.Add("孙梦婷"); namelist.Add("孙苗苗"); namelist.Add("高文文"); namelist.Add("孙利侠"); namelist.Add("华媛"); namelist.Add("朱小华"); namelist.Add("卢传娟"); namelist.Add("周思杰"); namelist.Add("姜晓霞"); namelist.Add("郭银全"); namelist.Add("石智勇"); for (int i = 0; i < 26; i++) { var model = new HdPic() { Name = namelist[i], Status = 0, Orders = 0, PicUrl = "r" + (i + 1) + ".jpg", AddTime = DateTime.Now, UpdateTime = DateTime.Now, Extend1 = "", Extend2 = "56" }; db.HdPic.AddObject(model); db.SaveChanges(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); AResource model = //DbSession.Default.From<Article>().Where(s => s.AritcleID.Equals(tmpid)).ToFirstDefault(); db.AResource.Where(s => s.RId == tmpid).FirstOrDefault(); if (model != null) { //model.Attach(); db.AResource.DeleteObject(model); //model. = 2; //model.UpdateTime = DateTime.Now; // int ts = DbSession.Default.Update<Article>(model); db.SaveChanges(); } } } hidtype.Value = stypid + ""; BindRepeater(); } int tmpid1 = Convert.ToInt32(hidtype.Value); WebConn.ManageInfoType sex = (WebConn.ManageInfoType)tmpid1; string reqStrUrl = string.Empty; switch (sex) { case WebConn.ManageInfoType.半岛住宿: stTitle = WebConn.ManageInfoType.半岛住宿.ToString(); //reqStrUrl = "BDZSList.aspx";//"BDMSList.aspx?tid=" + hidtype.Value; break; case WebConn.ManageInfoType.富饶特产: stTitle = WebConn.ManageInfoType.富饶特产.ToString(); break; case WebConn.ManageInfoType.滨海风情餐饮购物街: stTitle = WebConn.ManageInfoType.滨海风情餐饮购物街.ToString(); break; } reqStrUrl = "BDZSList.aspx?tid=" + stypid; btn_Back.Attributes.Add("onclick", "window.location.href='" + reqStrUrl + "';return false;"); }
private string lotterid() { string str = string.Empty; string jp = string.Empty; int ti = GetLotter(); if (ti == 0) { jp = "谢谢参与"; } else { using (WXDBEntities db = new WXDBEntities()) { //判断奖品数量 var jpmodel = db.Effect.Where(s => s.Orders > 0 && s.Openid.Equals("6")).FirstOrDefault(); if (jpmodel != null) { string hb = string.Empty; var model1 = db.Effect.Where(s => s.Status.Equals(ti) && s.Orders > 0 && s.Openid.Equals("6")).FirstOrDefault(); if (model1 != null) { model1.Orders = model1.Orders - 1; hb = model1.Title; jp = model1.Title; db.SaveChanges(); } else { //jp = jpmodel.Title; //jpmodel.Orders = jpmodel.Orders - 1; ////jp = "谢谢参与"; ////ti = 0; //ti = jpmodel.Status; //db.SaveChanges(); jp = "谢谢参与"; ti = 0; } } else { jp = "谢谢参与"; ti = 0; } } } return(ti + "|" + jp); }
/// <summary> /// 预约看房信息 /// </summary> /// <param name="context"></param> protected void AddKFinfo(HttpContext context) { try { var name = context.Request.Params["tname"]; var phone = context.Request.Params["tphone"]; var sex = context.Request.Params["sex"]; var year = context.Request.Params["year"]; var mon = context.Request.Params["mon"]; var dd = context.Request.Params["day"]; var yxfx = context.Request.Params["fx"]; var hztj = context.Request.Params["tj"]; var lfqy = context.Request.Params["qy"]; using (WXDBEntities db = new WXDBEntities()) { Forms model = new Forms(); model.Name = name; model.Number = 0; model.Mobile = phone; model.Age = 0; model.Source = hztj; model.Income = yxfx; model.AddTime = Convert.ToDateTime(year + "-" + mon + "-" + dd); model.UpdateTime = DateTime.Now; model.Status = 0; model.Orders = 0; model.Extend = lfqy; model.Extend2 = sex; model.JFCount = 0; //看房预约 model.Type = 15; model.Title = year + "年" + mon + "月" + dd + "日"; db.Forms.AddObject(model); db.SaveChanges(); string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "succ", result = null, count = 1 }); context.Response.Write(jsonstrlist); } } catch (Exception) { string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "succ", result = null, count = 0 }); context.Response.Write(jsonstrlist); } }
/// <summary> /// 登陆信息 /// </summary> /// <param name="context"></param> private void SysLogin(HttpContext context) { string LoginName = context.Request["LoginName"]; string LoginPassword = context.Request["LoginPassword"]; string SecretCode = context.Request["SecretCode"]; string retMsg = string.Empty; try { using (WXDBEntities db = new WXDBEntities()) { var tmpma = Utils.MD5(LoginPassword); var tmodel = db.SysAccount.Where(s => s.LoginName.Equals(LoginName) && s.Status.Equals(0) && s.Password.Equals(tmpma)).FirstOrDefault(); if (tmodel != null) { var tqx = DbSession.Default.From <Dos.Model.Manager_Groups>().Where(s => s.Id.Equals(tmodel.SyType) && s.Status.Equals(0)).ToFirstDefault(); Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("loginname", LoginName); dic.Add("userid", tmodel.AccountID + ""); dic.Add("DutyId", tmodel.SyType + ""); if (tqx.Id > 0) { dic.Add("CityNo", tqx.Remark); dic.Add("ProjectNo", tqx.Extend1); } //dic.Add("",""); CookieHelper.WriteIn(WebConfigurationManager.AppSettings["ManageDomain"], 30, dic); tmodel.LastLoginTime = DateTime.Now; tmodel.LoginNums += 1; db.SaveChanges(); retMsg = "success"; context.Response.Write(retMsg); } else { retMsg = "Error"; context.Response.Write(retMsg); } } } catch (Exception ex) { retMsg = "Error"; context.Response.Write(retMsg); Logger.Default.Error("获取用户信息出错", ex); } }
/// <summary> /// 添加餐饮预定信息 /// </summary> /// <param name="context"></param> protected void AddCyInfo(HttpContext context) { var tmpopid = context.Request.Params["sourcid"]; var tmptitle = context.Request.Params["title"]; var tmpremark = context.Request.Params["Remak"]; var tmpname = context.Request.Params["name"]; var tmpphone = context.Request.Params["phone"]; var tmpnums = context.Request.Params["nums"]; var remark = context.Request.Params["remark"]; using (WXDBEntities db = new WXDBEntities()) { var models = new Forms() { Name = tmpname, Number = Convert.ToInt32(tmpnums), Mobile = tmpphone, Age = 0, Source = tmpopid, Income = "", AddTime = DateTime.Now, UpdateTime = DateTime.Now, Remark = tmpremark, Status = 0, Orders = 0, FormType = 0, Extend = "", Extend2 = remark, //餐饮预定信息 Type = 8, Title = tmptitle, JFCount = 1 }; try { db.Forms.AddObject(models); db.SaveChanges(); context.Response.Write("{\"msg\":\"1\",\"desc\":\"您的预定信息提交成功!\"}"); return; } catch (Exception) { context.Response.Write("{\"msg\":\"2\",\"desc\":\"网络错误,预定信息失败!请重新提交!\"}"); return; } } }
private void UpWzStats() { try { using (WXDBEntities db = new WXDBEntities()) { var topid = _context.Request.Form["topid"]; var tm1 = DateTime.Now.Date; var tm2 = DateTime.Now.Date.AddDays(1); var tmodel = db.Oders.Where(s => s.Soucre.Equals(topid) && s.Extent1.Equals("65") && s.AddTime > tm1 && s.AddTime < tm2).OrderBy(s => s.AddTime).FirstOrDefault(); if (tmodel != null) { if (tmodel.Status.Equals(1)) { string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "4", result = "0", count = 2 }); _context.Response.Write(jsonstrlist); } else { tmodel.Status = 1; db.SaveChanges(); string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "4", result = "0", count = 1 }); _context.Response.Write(jsonstrlist); } } else { string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "4", result = "0", count = 2 }); _context.Response.Write(jsonstrlist); } } } catch (Exception ex) { string jsonstrlist = JsonHelper.GetJsonString(new jsonResult { code = "4", result = "0", count = 0 }); _context.Response.Write(jsonstrlist); } }
/// <summary> /// 页面信息保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, ImageClickEventArgs e) { using (WXDBEntities db = new WXDBEntities()) { int mid = int.Parse(drpModule.SelectedValue); if (mid > 0) { PageItem xPageItem = new PageItem(); xPageItem.ModuleID = mid; xPageItem.PageName = txtPageName.Text; xPageItem.Url = txtUrl.Text; xPageItem.IsDisplay = IsDisplay.Checked; if (upPic.HasFile) { string _img = Guid.NewGuid().ToString() + Path.GetExtension(upPic.FileName).ToLower(); upPic.PostedFile.SaveAs(globalVariables.SysDirString + _img); xPageItem.PicUrl = _img; } db.PageItem.AddObject(xPageItem); db.SaveChanges(); if (!string.IsNullOrEmpty(refer.Value)) { jsHint.toUrl("页面信息" + txtPageName.Text + "增加成功!", refer.Value); } else if (string.IsNullOrEmpty(Request.QueryString["type"])) { jsHint.toUrl("页面信息" + txtPageName.Text + "增加成功!", "PageList.aspx"); } else { jsHint.toUrl("页面信息" + txtPageName.Text + "增加成功!", Request.UrlReferrer.OriginalString); } } else { jsHint.toUrl("请选择模块信息", refer.Value); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); Article model = db.Article.Where(s => s.AritcleID == tmpid).FirstOrDefault(); if (model != null) { model.Status = 2; db.SaveChanges(); } } } BindRepeater(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["del"]) && WebUtil.IsDigit(Request["del"])) { int tmpid = Convert.ToInt32(Request["del"]); Forms model = db.Forms.Where(s => s.Id == tmpid).FirstOrDefault(); if (model != null) { db.Forms.DeleteObject(model); db.SaveChanges(); } } } BindRepeater(); } }
/// <summary> /// 操作信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_click_Click(object sender, ImageClickEventArgs e) { if (string.IsNullOrEmpty(txtcontent.Value)) { jsHint.Back("请输入内容信息!"); return; } using (WXDBEntities db = new WXDBEntities()) { var addobj = new Article(); if (hidId.Value.Equals("0")) { addobj = new Article(); addobj.AddTime = DateTime.Now; addobj.Title = ""; addobj.Orders = 0; addobj.Contents = txtcontent.Value;; addobj.Description = ""; addobj.Status = 0; ///关键字 addobj.Extend1 = ""; addobj.Type = 25; addobj.UpdateTime = DateTime.Now; } else { addobj = db.Article.Where(s => s.Type.Equals(25)).FirstOrDefault(); addobj.UpdateTime = DateTime.Now; addobj.Contents = txtcontent.Value; } //修改人 addobj.Extend2 = loginname; if (hidId.Value.Equals("0")) { db.Article.AddObject(addobj); } db.SaveChanges(); jsHint.toUrl("积分规则操作成功", "JFgz.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ((SysNewsmaster)this.Master).txtTitle = "图片类型信息的管理"; using (WXDBEntities db = new WXDBEntities()) { if (!string.IsNullOrEmpty(Request["delt"]) && WebUtil.IsDigit(Request["delt"])) { int tmpid = Convert.ToInt32(Request["delt"]); PicShow model = db.PicShow.Where(s => s.Id == tmpid).FirstOrDefault(); if (model != null) { db.PicShow.DeleteObject(model); db.SaveChanges(); } } } BindRepeater(); } }