public void DataSave() { var data = dc.Szksknowledge.Where(p => p.Postid == decimal.Parse(hdnPostid.Value.ToString()) && p.Maindept == SessionBox.GetUserSession().DeptNumber); if (data.Count() > 0) { data.First().Kcontent = HtmlEditor1.Value.ToString(); dc.SubmitChanges(); Ext.Msg.Alert("提示", "修改成功!").Show(); } else { Szksknowledge sk = new Szksknowledge { Kcontent = HtmlEditor1.Value.ToString(), Maindept = SessionBox.GetUserSession().DeptNumber,//"241700000", Postid = decimal.Parse(hdnPostid.Value.ToString()), Status = "1", Remarks = "", Zyid = dc.Post.First(p => p.Postid == decimal.Parse(hdnPostid.Value.ToString())).Zyid }; dc.Szksknowledge.InsertOnSubmit(sk); dc.SubmitChanges(); Ext.Msg.Alert("提示", "新增成功!").Show(); } }
public static string Send(string phone, string content) { if (VerifyNumber(phone)) { DBSCMDataContext dc = new DBSCMDataContext(); TblSmsendtask sms = new TblSmsendtask(); sms.Count = 1; sms.Creatorid = "000"; sms.Destaddr = phone; sms.Destaddrtype = 0; sms.Feecode = 0; sms.Feetype = "01"; sms.Messageid = 0; sms.Msgid = ""; sms.Needstatereport = 0; sms.Operationtype = "WAS"; sms.Orgaddr = "1065730615390000"; sms.Reserve1 = ""; sms.Reserve2 = ""; sms.Sendlevel = 0; sms.Sendstate = 0; sms.Sendtime = DateTime.Now.AddSeconds(2); sms.Sendtype = 1; sms.Serviceid = "MAH0510101"; sms.SmContent = content; sms.Smsendednum = 0; sms.Smtype = 0; sms.Suboperationtype = 66; sms.Subtime = DateTime.Now; sms.Successid = 0; sms.Taskname = ""; sms.Taskstatus = 0; sms.Trytimes = 3; string strSql = "INSERT INTO [tbl_SMSendTask]( [CreatorID], [TaskName], [SmSendedNum], [OperationType], [SuboperationType], [SendType], [OrgAddr], [DestAddr], [SM_Content], [SendTime], [NeedStateReport], [ServiceID], [FeeType], [FeeCode], [MsgID], [SMType], [MessageID], [DestAddrType], [SubTime], [TaskStatus], [SendLevel], [SendState], [TryTimes], [Count], [SuccessID], [Reserve1], [Reserve2]) values ('" + sms.Creatorid + "','" + sms.Taskname + "'," + sms.Smsendednum.Value.ToString() + ",'" + sms.Operationtype + "'," + sms.Suboperationtype.Value.ToString() + "," + sms.Sendtype.Value.ToString() + ",'" + sms.Orgaddr + "','" + sms.Destaddr + "','" + sms.SmContent + "','" + sms.Sendtime.Value + "'," + sms.Needstatereport.Value.ToString() + ",'" + sms.Serviceid + "','" + sms.Feetype + "'," + sms.Feecode.Value.ToString() + ",'" + sms.Msgid + "'," + sms.Smtype.Value.ToString() + "," + sms.Messageid.Value.ToString() + "," + sms.Destaddrtype.Value.ToString() + ",'" + sms.Subtime.Value + "'," + sms.Taskstatus.Value.ToString() + "," + sms.Sendlevel.Value.ToString() + "," + sms.Sendstate.Value.ToString() + "," + sms.Trytimes.Value.ToString() + "," + sms.Count.Value.ToString() + "," + sms.Successid.Value.ToString() + ",'" + sms.Reserve1 + "','" + sms.Reserve2 + "')"; try { if (SQLHelper.ExecuteSql(strSql) >= 1) { sms.Successid = 1; dc.TblSmsendtask.Insert(sms); dc.SubmitChanges(); return("1"); } else { dc.TblSmsendtask.Insert(sms); dc.SubmitChanges(); return("0"); } } catch (Exception ex) { return(ex.Message); } } else { return("非法的手机号码!"); } }
public void SaveSWLearn(string lname, string act) { if (act == "new") { Swlearn l = new Swlearn { Deptnumber = SessionBox.GetUserSession().DeptNumber, Intime = System.DateTime.Today, Levelid = int.Parse(hdnKindid.Value.ToString()), Lname = lname, Nstatus = 0 }; dc.Swlearn.InsertOnSubmit(l); dc.SubmitChanges(); } else { RowSelectionModel sm = gpJoem.SelectionModel.Primary as RowSelectionModel; var l = dc.Swlearn.First(p => p.Lid == decimal.Parse(sm.SelectedRow.RecordID)); l.Lname = lname; dc.SubmitChanges(); } Ext.Msg.Alert("提示", "保存成功!").Show(); GVLoad(int.Parse(hdnKindid.Value.ToString())); ControlSet(); }
private void SaveSw(decimal swid, decimal pid, string perid) { DBSCMDataContext db = new DBSCMDataContext(); var fk = db.Nswfinedetail.Where(p => p.Id == swid && p.Pid == pid); if (fk.Count() > 0) { var fd = fk.First(); fd.Personnumber = perid; db.SubmitChanges(); } else { var data = from f in db.Swfineset from y in db.Nswinput from sw in db.Swbase where f.Deptnumber == SessionBox.GetUserSession().DeptNumber&& y.Swid == sw.Swid && sw.Levelid == f.Levelid && y.Id == swid && f.Pid == pid select new { y.Fine }; Nswfinedetail nf = new Nswfinedetail { Id = swid, Pid = pid, Personnumber = perid, Fine = data.First().Fine }; db.Nswfinedetail.InsertOnSubmit(nf); db.SubmitChanges(); } }
public void AgStatus(string reason, string ID) { var view = dc.Swinput.Where(p => p.Id == decimal.Parse(ID)); if (view.Count() > 0) { SwinputNullify sn = new SwinputNullify { Id = view.First().Id, Banci = view.First().Banci, Fine = view.First().Fine, Inputpersonid = view.First().Inputpersonid, Intime = view.First().Intime, Isadministrativepenalty = view.First().Isadministrativepenalty, Isend = view.First().Isend, Ispublic = view.First().Ispublic, Maindeptid = view.First().Maindeptid, Nullify = reason, Pcpersonid = view.First().Pcpersonid, Pctime = view.First().Pctime, Placeid = view.First().Placeid, Remarks = view.First().Remarks, Swnumber = view.First().Swnumber, Swpersonid = view.First().Swpersonid }; dc.SwinputNullify.InsertOnSubmit(sn); dc.SubmitChanges(); dc.Swinput.DeleteOnSubmit(view.First()); dc.SubmitChanges(); Ext.DoScript("#{Store1}.reload();"); Ext.Msg.Alert("提示", "作废成功!").Show(); } }
public void DoDel() { RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count > 0) { var gs = dc.Accidentcase.First(p => p.Id == decimal.Parse(sm.SelectedRow.RecordID.Trim())); dc.Accidentcase.DeleteOnSubmit(gs); dc.SubmitChanges(); Ext.Msg.Alert("提示", "删除成功!").Show(); btnEdit.Disabled = true; btnDelete.Disabled = true; Gridload(); sgName.Text = ""; sgdj.SelectedItem.Value = ""; sglx.SelectedItem.Value = ""; swNumber.Text = ""; zsNumber.Text = ""; qsNumber.Text = ""; zjjjss.Text = ""; jjjjss.Text = ""; sf.SelectedItem.Value = ""; kjName.Text = ""; kjlx.SelectedItem.Value = ""; wsdj.SelectedItem.Value = ""; jt.SelectedItem.Value = ""; } }
private void SaveYh(decimal yhid, decimal pid, string perid) { DBSCMDataContext db = new DBSCMDataContext(); var fk = db.Nyhfinedetail.Where(p => p.Yinputid == yhid && p.Pid == pid); if (fk.Count() > 0) { var fd = fk.First(); fd.Personnumber = perid; db.SubmitChanges(); } else { var data = from f in db.Fineset from y in db.Nyhinput where f.Deptnumber == SessionBox.GetUserSession().DeptNumber&& y.Levelid == f.Levelid && y.Yhputinid == yhid && f.Pid == pid select new { f.Kcfine }; Nyhfinedetail nf = new Nyhfinedetail { Yinputid = yhid, Pid = pid, Personnumber = perid, Fine = data.First().Kcfine }; db.Nyhfinedetail.InsertOnSubmit(nf); db.SubmitChanges(); } }
public void DoDel() { RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count > 0) { var gs = dc.Workinjury.First(p => p.Id == decimal.Parse(sm.SelectedRow.RecordID.Trim())); dc.Workinjury.DeleteOnSubmit(gs); dc.SubmitChanges(); Ext.Msg.Alert("提示", "删除成功!").Show(); btnEdit.Disabled = true; btnDelete.Disabled = true; Gridload(); cbbGsperson.SelectedItem.Value = ""; cbbplace.SelectedItem.Value = ""; gsss.Text = ""; Happentime.Value = ""; grkf.Text = ""; // grfk.Text = ""; bmkf.Text = ""; bmfk.Text = ""; bz.Text = ""; } }
protected void SaveD(object sender, BeforeStoreChangedEventArgs e) { try { XmlNode xml = e.DataHandler.XmlData; XmlNode updated = xml.SelectSingleNode("records/Updated"); if (updated != null) { XmlNodeList uRecords = updated.SelectNodes("record"); if (uRecords.Count > 0) { foreach (XmlNode record in uRecords) { if (record != null) { DBSCMDataContext dc1 = new DBSCMDataContext(); if (record.SelectSingleNode("Mid").InnerText.Trim() == "-1") { if (record.SelectSingleNode("isCheck").InnerText.Trim() == "true") { SmsManagement ma = new SmsManagement { Coding = record.SelectSingleNode("Coding").InnerText, Deptnumber = SessionBox.GetUserSession().DeptNumber, Sendset = 1 }; dc1.SmsManagement.InsertOnSubmit(ma); dc1.SubmitChanges(); } } else { var ma = dc1.SmsManagement.First(p => p.Mid == decimal.Parse(record.SelectSingleNode("Mid").InnerText.Trim())); if (record.SelectSingleNode("isCheck").InnerText.Trim() == "true") { ma.Sendset = 1; } else { dc1.SmsManagement.DeleteOnSubmit(ma); } dc1.SubmitChanges(); } } } e.Cancel = true; StoreLoad(); Ext.Msg.Alert("提示", "保存成功!").Show(); } } } catch { Ext.Msg.Alert("提示", "数据处理异常,请刷新页面重新操作!").Show(); } }
protected void SaveD(object sender, BeforeStoreChangedEventArgs e) { XmlNode xml = e.DataHandler.XmlData; XmlNode updated = xml.SelectSingleNode("records/Updated"); RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; if (updated != null) { XmlNodeList uRecords = updated.SelectNodes("record"); if (uRecords.Count > 0) { foreach (XmlNode record in uRecords) { if (record != null) { DBSCMDataContext dc1 = new DBSCMDataContext(); foreach (var item in sm.SelectedRows) { var rd = dc1.SwexamineDetail.Where(p => p.Lid == decimal.Parse(record.SelectSingleNode("Lid").InnerText) && p.Swid == decimal.Parse(item.RecordID)); if (record.SelectSingleNode("isCheck").InnerText.Trim() == "false") { dc1.SwexamineDetail.DeleteOnSubmit(rd.First()); //dc1.SubmitChanges(); } else { if (rd.Count() == 0) { SwexamineDetail ra = new SwexamineDetail { Lid = decimal.Parse(record.SelectSingleNode("Lid").InnerText), Remark = record.SelectSingleNode("Remark").InnerText, Swid = decimal.Parse(item.RecordID) }; dc1.SwexamineDetail.InsertOnSubmit(ra); //dc1.SubmitChanges(); } } } dc1.SubmitChanges(); } } } } foreach (var item in sm.SelectedRows) { var se = dc.Swexamine.First(p => p.Swid == decimal.Parse(item.RecordID)); se.Result = tfResult.Text; } dc.SubmitChanges(); Ext.Msg.Alert("提示", "保存成功!").Show(); LearnStoreLoad(); }
public void BaseSave() { if (cbbCheckDept.SelectedIndex == -1 || cbbforcheckDept.SelectedIndex == -1 || tfplace.Text.Trim() == "" || cbbXZ.SelectedIndex == -1) { Ext.Msg.Alert("提示", "请填写完整信息!").Show(); return; } string type = Request.QueryString["Type"].Trim(); decimal strrid = 0; if (hdnId.Value.ToString().Trim() == "") { SqsResult pr = new SqsResult { Checkdate = dfDate.SelectedDate, Checkdept = cbbCheckDept.SelectedItem.Value, Checkfordept = cbbforcheckDept.SelectedItem.Value, Did = decimal.Parse(Request.QueryString["Pkindid"]), Checkway = cbbXZ.SelectedItem.Value, Placeid = tfplace.Text, Rstatus = "1", Total = 0 }; dc.SqsResult.InsertOnSubmit(pr); dc.SubmitChanges(); strrid = dc.SqsResult.Max(p => p.Rid); hdnId.SetValue(strrid.ToString()); } else { var result = dc.SqsResult.First(p => p.Rid == decimal.Parse(hdnId.Value.ToString())); result.Checkfordept = cbbforcheckDept.SelectedItem.Value; result.Placeid = tfplace.Text; result.Checkdate = dfDate.SelectedDate; result.Checkway = cbbXZ.SelectedItem.Value; dc.SubmitChanges(); strrid = result.Rid; } //Ext.Msg.Alert("提示", "1").Show(); Ext.DoScript("#{gpESSENTIALCONDITION}.save();"); Ext.DoScript("#{gpDEMOTION}.save();#{gpJeom}.save();"); Ext.DoScript("#{gpJeom}.save();"); Ext.Msg.Alert("提示", "保存成功!").Show(); //var res = dc.SqsResult.First(p => p.Rid == decimal.Parse(hdnId.Value.ToString())); //decimal total = dc.SqsResultDetail.Where(p => p.Rid == decimal.Parse(hdnId.Value.ToString())).Sum(p => p.Jeom).Value; //var d = dc.SqsDemotiondetail.Where(p => p.Rid == decimal.Parse(hdnId.Value.ToString())); //if (total - d.Count() * 10 < 80) //{ // total = 70 + total % 10 - d.Count() * 5; //} }
public void Dodel() { RowSelectionModel sm = GridPanel3.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count > 0) { var yb = dc.Swquote.First(p => p.Swid == decimal.Parse(sm.SelectedRow.RecordID) && p.Deptnumber == SessionBox.GetUserSession().DeptNumber); yb.Nstatus = 0; dc.SubmitChanges(); StoreLoad(); Ext.Msg.Alert("提示", "作废成功!").Show(); } }
public void BanAddPerson() { RowSelectionModel sm = gpPer.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count > 0) { foreach (var r in sm.SelectedRows) { DBSCMDataContext db = new DBSCMDataContext(); var sw = db.Nswinput.First(p => p.Swpersonid == r.RecordID && p.Islearn == 1); Swexamine se = new Swexamine { Swid = sw.Id, Stime = dfInban.SelectedDate, Isfinish = 0, Result = " " }; db.Swexamine.InsertOnSubmit(se); sw.Islearn = 2; db.SubmitChanges(); } Ext.Msg.Alert("提示", "进班成功,共添加" + sm.SelectedRows.Count.ToString() + "人").Show(); SelectedStoreLoad(); sm.SelectedRows.Clear(); sm.UpdateSelection(); LearnStoreLoad(); btn_detail.Disabled = true; btnsw.Disabled = true; Button1.Disabled = true; } }
public void PlanCreate(decimal[,] place, string perid) { int count = 0; for (int i = 0; i < place.Length / 2; i++) { int rate = (int)(((dfend.SelectedDate - dfbegin.SelectedDate).Days + 1) / place[i, 1]); //rate = rate == 0 ? 1 : rate; DateTime begin = dfbegin.SelectedDate; DateTime end = dfend.SelectedDate; int make = 0; for (; (begin <= end && make < place[i, 1]); begin = begin.AddDays(rate))//begin.AddDays(rate) <= end { DBSCMDataContext dc1 = new DBSCMDataContext(); Moveplan mp1 = new Moveplan { Personid = perid, Placeid = place[i, 0], Starttime = begin, Endtime = begin > end ? end : (begin.AddDays(rate) > end ? end : begin.AddDays(rate - 1)), Movestate = "未走动", Maindept = SessionBox.GetUserSession().DeptNumber }; dc1.Moveplan.InsertOnSubmit(mp1); dc1.SubmitChanges(); count++; make++; } } Ext.Msg.Alert("提示", "添加完成,共计添加" + count.ToString() + "条计划!").Show(); }
public void Updatedata() { RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; var data = dc.Movefrequency.Where(p => p.Frequencyid == Convert.ToInt32(sm.SelectedRows[0].RecordID.Trim())); foreach (var r in data) { //r.DeptID = Convert.ToInt32(up_dep.SelectedItem.Value); //r.PosID = Convert.ToInt32(up_pos.SelectedItem.Value); //r.PlaceID = Convert.ToInt32(up_pla.SelectedItem.Value); r.Frequency = Convert.ToInt32(up_fun.Text.Trim()); } dc.SubmitChanges(); BaseStroeLoad(); Ext.Msg.Alert("提示", "保存成功!").Show(); }
protected void btnUpdateClick(object sender, AjaxEventArgs e) { if (tfSwcontent.Text.Trim() == "" || cbbLevelid.SelectedIndex == -1) { Ext.Msg.Alert("提示", "请填写完整信息!").Show(); return; } try { if (hdnID.Value.ToString() != "-1") { DBSCMDataContext db = new DBSCMDataContext(); var yb = db.Swquote.First(p => p.Swid == decimal.Parse(hdnID.Value.ToString()) && p.Deptnumber == SessionBox.GetUserSession().DeptNumber); yb.Levelid = decimal.Parse(cbbLevelid.SelectedItem.Value); //yb.Conpyfirst = dc.F_PINYIN(tfYhcontent.Text).ToLower(); db.SubmitChanges(); StoreLoad(); } Ext.Msg.Alert("提示", "更新成功!").Show(); } catch { Ext.Msg.Alert("提示", "请先引用!").Show(); } }
private void AutoUpdate() { //var lavel = from c in dc.CsBaseinfoset // where c.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("YHJB", this)) // select new // { // c.Infoid, // c.Infoname // }; var yh = dc.Nyhinput.Where(p => p.Status == "逾期未整改"); foreach (var r in yh) { if (r.Levelid > 42) { r.Levelid = r.Levelid.Value - 1; } r.Status = "新增"; //自动短信 var msgall = dc.Getyhinput.First(p => p.Yhputinid == r.Yhputinid); string msg12 = msgall.Deptname + "在" + msgall.Placename + "的" + msgall.Levelname + "级隐患因逾期未整改,级别升级!"; var smsd = dc.Yhsmsset.Where(p => p.Yhlevel == msgall.Levelid && p.Maindept == msgall.Unitid && p.Deptnumber == msgall.Deptid); List <string> per = new List <string>(); foreach (var n in smsd) { per.Add(n.Person); } string msg = Sms.Send(per, msg12, r.Yhputinid.ToString(), SmsType.HiddenTroubleTips, "-安全生产体系支撑平台!"); //Ext.Msg.Alert("提示", "发布成功!" + msg).Show(); } dc.SubmitChanges(); }
public void AddHaz() { RowSelectionModel sm = GridPanel1.SelectionModel.Primary as RowSelectionModel; RowSelectionModel sm1 = GridPanel3.SelectionModel.Primary as RowSelectionModel; var yh = dc.Swbase.First(p => p.Swid == decimal.Parse(sm1.SelectedRow.RecordID)); if (sm.SelectedRows.Count() > 0) { int i = 0; foreach (var r in sm.SelectedRows) { if (dc.Shmatchup.Count(p => p.Swid == yh.Swid && p.Hazardsid == decimal.Parse(r.RecordID)) == 0) { Shmatchup ym = new Shmatchup { Swid = yh.Swid, Hazardsid = decimal.Parse(r.RecordID) }; DBSCMDataContext dc1 = new DBSCMDataContext(); dc1.Shmatchup.InsertOnSubmit(ym); dc1.SubmitChanges(); i++; } } Ext.Msg.Alert("提示", "添加成功,共计添加" + i.ToString() + "条危险源!").Show(); SearchBLLoad(); hazWindow.Hide(); } }
protected void adsPlace_Deleting(object sender, LinqDataSourceDeleteEventArgs e) { DBSCMDataContext dc = new DBSCMDataContext(); Place place = dc.Place.First(p => p.Placeid == (e.OriginalObject as Place).Placeid); if (place.Placestatus == 1) { place.Placestatus = 0; dc.SubmitChanges(); } //ListDictionary keyValues = new ListDictionary(); //ListDictionary newValues = new ListDictionary(); //ListDictionary oldValues = new ListDictionary(); //keyValues.Add("Placeid", ((GhtnTech.SEP.DAL.Place)e.OriginalObject).Placeid; //oldValues.Add("ProductName", ((Label)DetailsView1.FindControl("NameLabel")).Text); //oldValues.Add("ProductCategory", ((Label)DetailsView1.FindControl("CategoryLabel")).Text); //oldValues.Add("Color", ((Label)DetailsView1.FindControl("ColorLabel")).Text); //newValues.Add("ProductName", "New Product"); //newValues.Add("ProductCategory", "General"); //newValues.Add("Color", "Not assigned"); //adsPlace.Update(keyValues, newValues, oldValues); e.Cancel = true; }
public void DoDel() { RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; if (sm.SelectedRows.Count > 0) { var sw = dc.Nswinput.First(p => p.Id == decimal.Parse(sm.SelectedRow.RecordID.Trim())); dc.Nswinput.DeleteOnSubmit(sw); dc.SubmitChanges(); Ext.Msg.Alert("提示", "删除成功!").Show(); btnEdit.Disabled = true; btnDelete.Disabled = true; Gridload(); cbbSwperson.SelectedItem.Value = ""; cbbplace.SelectedItem.Value = ""; cbbSWcontent.SelectedItem.Value = ""; } }
private void UpdateRADetail(XmlNode data) { DBSCMDataContext dc1 = new DBSCMDataContext(); var rd = dc1.ParResultAdddetail.First(p => p.Ardid == decimal.Parse(data.SelectSingleNode("Rdid").InnerText)); rd.Jeom = data.SelectSingleNode("Jeom").InnerText.Trim() == "" ? 0 : decimal.Parse(data.SelectSingleNode("Jeom").InnerText); rd.Remark = data.SelectSingleNode("Remark").InnerText.Trim(); dc1.SubmitChanges(); }
public void AgStatus() { RowSelectionModel sm = this.GridPanel1.SelectionModel.Primary as RowSelectionModel; var yhN = dc.Yscollect.First(p => p.Cid == decimal.Parse(sm.SelectedRecordID.Trim())); dc.Yscollect.DeleteOnSubmit(yhN); dc.SubmitChanges(); Ext.Msg.Alert("提示", "删除成功!").Show(); storeload(); }
protected void SaveJ(object sender, BeforeStoreChangedEventArgs e) { XmlNode xml = e.DataHandler.XmlData; XmlNode updated = xml.SelectSingleNode("records/Updated"); if (updated != null) { XmlNodeList uRecords = updated.SelectNodes("record"); if (uRecords.Count > 0) { foreach (XmlNode record in uRecords) { if (record != null) { DBSCMDataContext dc1 = new DBSCMDataContext(); var rd = dc1.SqsResultDetail.Where(p => p.Jcid == decimal.Parse(record.SelectSingleNode("Jcid").InnerText) && p.Rid == decimal.Parse(hdnId.Value.ToString())); if (rd.Count() == 0) { SqsResultDetail rk = new SqsResultDetail { Jcid = decimal.Parse(record.SelectSingleNode("Jcid").InnerText.Trim().Substring(1)), Jeom = record.SelectSingleNode("Jeom").InnerText.Trim() == "" ? 0 : decimal.Parse(record.SelectSingleNode("Jeom").InnerText), Remark = record.SelectSingleNode("Remark").InnerText.Trim(), Rid = decimal.Parse(hdnId.Value.ToString()) }; dc1.SqsResultDetail.InsertOnSubmit(rk); dc1.SubmitChanges(); } else { var r = rd.First(); r.Jeom = record.SelectSingleNode("Jeom").InnerText.Trim() == "" ? 0 : decimal.Parse(record.SelectSingleNode("Jeom").InnerText); r.Remark = record.SelectSingleNode("Remark").InnerText.Trim(); dc1.SubmitChanges(); } } } e.Cancel = true; } } }
public void FineClose() { DBSCMDataContext db = new DBSCMDataContext(); if (Request.QueryString["Mod"].Trim() == "yh") { var yh = db.Nyhinput.First(p => p.Yhputinid == decimal.Parse(Request.QueryString["Post"])); yh.Isfine = 1; db.SubmitChanges(); } AddSuccessAndClose(Request.QueryString["Win"]); }
public void Item_Del(int id) { var r = dc.ParResult.First(p => p.Rid == id); var rj = dc.ParResultDetail.Where(p => p.Rid == id); var ra = dc.ParResultAdddetail.Where(p => p.Rid == id); dc.ParResult.DeleteOnSubmit(r); dc.ParResultDetail.DeleteAllOnSubmit(rj); dc.ParResultAdddetail.DeleteAllOnSubmit(ra); dc.SubmitChanges(); Ext.Msg.Alert("提示", "删除成功!").Show(); LoadData(int.Parse(hdnKindid.Value.ToString())); }
protected void SaveD(object sender, BeforeStoreChangedEventArgs e) { XmlNode xml = e.DataHandler.XmlData; XmlNode updated = xml.SelectSingleNode("records/Updated"); if (updated != null) { XmlNodeList uRecords = updated.SelectNodes("record"); if (uRecords.Count > 0) { foreach (XmlNode record in uRecords) { if (record != null) { DBSCMDataContext dc1 = new DBSCMDataContext(); var rd = dc1.SqsDemotiondetail.Where(p => p.Deid == decimal.Parse(record.SelectSingleNode("Deid").InnerText) && p.Rid == decimal.Parse(hdnId.Value.ToString())); if (record.SelectSingleNode("isCheck").InnerText.Trim() == "false") { dc1.SqsDemotiondetail.DeleteOnSubmit(rd.First()); dc1.SubmitChanges(); } else { if (rd.Count() == 0) { SqsDemotiondetail ra = new SqsDemotiondetail { Deid = decimal.Parse(record.SelectSingleNode("Deid").InnerText), Rid = decimal.Parse(hdnId.Value.ToString()) }; dc1.SqsDemotiondetail.InsertOnSubmit(ra); dc1.SubmitChanges(); } } } } } } }
//下面的可以优化 private void AddYhMorePerson(decimal Yhid, string[] person) { //var ymall = dc.NyhinputMore.Where(p => p.Yhputinid == Yhid && !person.Contains(p.Personid));//所有不在人员列表的数据 //dc.NyhinputMore.DeleteAllOnSubmit(ymall); //dc.SubmitChanges(); string msg = ""; foreach (string per in person) { //decimal rjid = PublicCode.GetKQrecord(per, dfPCtime.SelectedDate, cbbBc.SelectedItem.Value, SessionBox.GetUserSession().PersonNumber); //if (rjid == -1) //{ // msg += dc.Person.First(p => p.Personnumber == per).Name + ":为检测到一小时内出井记录!;"; //} //else //{ if (dc.NyhinputMore.Where(p => p.Yhputinid == Yhid && p.Personid == per).Count() == 0) { DBSCMDataContext db = new DBSCMDataContext(); NyhinputMore ym = new NyhinputMore {//修正多人排查不同享检查信息 Personid = per, Yhputinid = Yhid, //-------------------------------- Pctime = dfPCtime.SelectedDate, Banci = cbbBc.SelectedItem.Value, Jctype = cbbJctype.SelectedIndex, Remarks = TextArea1.Text.Trim() //, //Rjid=rjid //-------------------------------- }; db.NyhinputMore.InsertOnSubmit(ym); db.SubmitChanges(); //msg += dc.Person.First(p => p.Personnumber == per).Name + ":添加成功!;"; //更新入井信息 //var rj = dc.KqRecord.First(p => p.Rjid == rjid); //rj.Inputyhcount = rj.Inputyhcount == null ? 1 : (rj.Inputyhcount.Value + 1); //rj.Status = 1; //dc.SubmitChanges(); //更新走动计划 PublicCode.setUpdateMoveState(per, Convert.ToDateTime(dfPCtime.Value), decimal.Parse(cbbplace.SelectedItem.Value.Trim())); } else { msg += dc.Person.First(p => p.Personnumber == per).Name + ":已添加过的人员!;"; } //} } //WriteYHlog(Yhid, msg); //return msg; }
private void AddRAdetail(XmlNode data, decimal rid) { ParResultAdddetail ra = new ParResultAdddetail { Ajcid = decimal.Parse(data.SelectSingleNode("Jcid").InnerText.Trim().Substring(1)), Jeom = data.SelectSingleNode("Jeom").InnerText.Trim() == "" ? 0 : decimal.Parse(data.SelectSingleNode("Jeom").InnerText), Remark = data.SelectSingleNode("Remark").InnerText.Trim(), Rid = rid }; DBSCMDataContext dc1 = new DBSCMDataContext(); dc1.ParResultAdddetail.InsertOnSubmit(ra); dc1.SubmitChanges(); }
protected void btnSave_Click(object sender, EventArgs e) { if (txtScore.Text.Trim() == "" || txtCount.Text.Trim() == "") { JSHelper.Alert("请填写分值与次数!"); return; } try { DBSCMDataContext db = new DBSCMDataContext(); var warn = db.Swwarningset.Where(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber); if (warn.Count() > 0) { Swwarningset war = db.Swwarningset.First(p => p.Deptnumber == SessionBox.GetUserSession().DeptNumber); war.Maxcount = decimal.Parse(txtCount.Text.Trim()); war.Maxscore = decimal.Parse(txtScore.Text.Trim()); db.SubmitChanges(); } else { Swwarningset war = new Swwarningset { Deptnumber = SessionBox.GetUserSession().DeptNumber, Maxcount = decimal.Parse(txtCount.Text.Trim()), Maxscore = decimal.Parse(txtScore.Text.Trim()), Intime = System.DateTime.Today }; db.Swwarningset.InsertOnSubmit(war); db.SubmitChanges(); } JSHelper.Alert("保存成功!"); } catch { JSHelper.Alert("保存失败,请检查填写是否正确!"); } }
protected void btnUpdateClick(object sender, AjaxEventArgs e) { if (tfYhcontent.Text.Trim() == "" || cbbLevelid.SelectedIndex == -1 || cbbTypeid.SelectedIndex == -1) { Ext.Msg.Alert("提示", "请填写完整信息!").Show(); return; } if (hdnID.Value.ToString() == "-1") { Yhbase yb = new Yhbase { Yhcontent = tfYhcontent.Text, Levelid = decimal.Parse(cbbLevelid.SelectedItem.Value), Typeid = decimal.Parse(cbbTypeid.SelectedItem.Value), Sglxid = decimal.Parse(cbbSglxid.SelectedItem.Value), Intime = System.DateTime.Now, Nstatus = 1, Submitdept = SessionBox.GetUserSession().DeptNumber //Conpyfirst = dc.F_PINYIN(tfYhcontent.Text) }; dc.Yhbase.InsertOnSubmit(yb); dc.SubmitChanges(); StoreLoad(); } else { var yb = dc.Yhbase.First(p => p.Yhid == decimal.Parse(hdnID.Value.ToString())); yb.Yhcontent = tfYhcontent.Text; yb.Typeid = decimal.Parse(cbbTypeid.SelectedItem.Value); yb.Levelid = decimal.Parse(cbbLevelid.SelectedItem.Value); yb.Sglxid = decimal.Parse(cbbSglxid.SelectedItem.Value); //yb.Conpyfirst = dc.F_PINYIN(tfYhcontent.Text).ToLower(); dc.SubmitChanges(); StoreLoad(); } Ext.Msg.Alert("提示", "更新成功!").Show(); }