private void InitComboBoxData() { IList<sd_gtsb> list = Client.ClientHelper.PlatformSqlMap.GetListByWhere<sd_gtsb>("where gtid in(select gtid from sd_gt where linecode in (select linecode from sd_xl where OrgCode='" + rowData.OrgID + "'))"); foreach (sd_gtsb pt in list) { comboBoxEdit5.Properties.Items.Add(pt.sbName); comboBoxEdit2.Properties.Items.Add(pt.sbType); comboBoxEdit1.Properties.Items.Add(pt.sbModle); } ComboBoxHelper.FillCBoxByDyk("送电电力安全工具试验记录", "工具名称", comboBoxEdit5.Properties); // ComboBoxHelper.FillCBoxByDyk("14电力安全工具试验记录", "编号", comboBoxEdit3.Properties); ComboBoxHelper.FillCBoxByDyk("送电电力安全工具试验记录", "试验周期", comboBoxEdit7.Properties); // ComboBoxHelper.FillCBoxByDyk("14电力安全工具试验记录", "试验项目", comboBoxEdit4.Properties); IList<PJ_dyk> dic = new List<PJ_dyk>(); PJ_dyk di = new PJ_dyk(); di.nr = "工频耐压"; dic.Add(di); di = new PJ_dyk(); di.nr = "绝缘电阻"; dic.Add(di); di = new PJ_dyk(); di.nr = "成组绝缘电阻"; dic.Add(di); di = new PJ_dyk(); di.nr = "直流电阻"; dic.Add(di); ////this.InitionData(this.cltOrderState, "DicItemCnName", "DicItemCode", "请选择", "类型名称", dic); this.InitionData(this.comboBoxEdit4, "nr", "nr", "请选择", "实验项目", dic); }
void ucTop_AfterEdit(PJ_dyk obj) { //ucBottom.ParentObj = obj; //splitCC1.Panel2.Text = "内容所在类别:" + (obj != null ? obj.dx : ""); Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", string.Format("UPDATE dbo.PJ_dyk SET dx='{0}',sx='{1}' WHERE ParentID='{2}'", obj.dx, obj.sx, obj.ID)); ucBottom.ParentObj = obj; }
void btnOK_Click(object sender, EventArgs e) { List<string> list = new List<string>(); List<PJ_dyk> list2 = new List<PJ_dyk>(); this.getCheckList(this.treeList1.Nodes, list); long xhidex = 0; IList<PJ_dyk> li = MainHelper.PlatformSqlMap.GetList<PJ_dyk>("SelectPJ_dykList", " where ParentID='" + parentObj.bh + "' order by id desc"); if (li.Count > 0) xhidex = (Convert.ToInt64(li[0].bh) + 1); else { xhidex = (Convert.ToInt64(parentObj.bh) * 100 + 1); } foreach (string str in list) { PJ_dyk dyk = new PJ_dyk(); TreeListNode td = treeList1.FindNodeByKeyID(str); dyk.ID = Convert.ToString(xhidex); dyk.bh = dyk.ID; xhidex++; Thread.Sleep(new TimeSpan(100000));//0.1毫秒 dyk.ParentID = parentObj.ID; dyk.dx = parentObj.dx; dyk.nr = td["nr"].ToString(); dyk.sx = td["sx"].ToString(); list2.Add(dyk); } try { List<SqlQueryObject> list3 = new List<SqlQueryObject>(); if (list2.Count > 0) { SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, list2.ToArray()); list3.Add(obj3); } MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3); } catch (Exception exception) { MainHelper.ShowWarningMessageBox(exception.Message); } this.DialogResult = DialogResult.OK; }
void ucTop_FocusedRowChanged(object sender, PJ_dyk obj) { ucBottom.ParentObj = obj; splitCC1.Panel2.Text = "内容所在类别:" + (obj != null ? obj.dx : ""); }
void gridViewOperation_AfterAdd(PJ_dyk obj) { //if (obj.bh != "") //{ // //obj.ID = obj.bh; // Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", string.Format("UPDATE dbo.PJ_dyk SET ID='{0}' WHERE ID='{1}'", obj.bh, obj.ID)); // obj.ID = obj.bh; //} //if (parentObj != null) // RefreshData(" where parentid='" + parentObj.ID + "'"); }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(PJ_dyk newobj) { newobj.ParentID = parentID; if (parentObj != null) { newobj.sx = parentObj.sx; newobj.dx = parentObj.dx; } else { PJ_dyk temp = gridView1.GetFocusedRow() as PJ_dyk; if (temp != null) { newobj.dx = temp.dx; } //var bh = MainHelper.PlatformSqlMap.GetObject("SelectOneInt", "select cast(max(bh) as int) + 1 from pj_dyk where dx='" + newobj.dx + "' and len(bh)=6"); //if (bh != null) //{ // string str_bh = ""; // for (int i = 0; i < 6 - bh.ToString().Length; i++) // { // str_bh += "0"; // } // newobj.bh = str_bh + bh; //} //else //{ // var bh1 = MainHelper.PlatformSqlMap.GetObject("SelectOneInt", "select cast(max(bh) as int) + 1 from pj_dyk where len(bh)=6"); // string str_bh = ""; // for (int i = 0; i < 6 - bh1.ToString().Length; i++) // { // str_bh += "0"; // } // newobj.bh = str_bh + bh1; //} if (!string.IsNullOrEmpty(zjm)) newobj.zjm = zjm; } }
void gridViewOperation_AfterEdit(PJ_dyk obj) { //if (obj.bh != "" && obj.bh != obj.ID) //{ // //obj.ID = obj.bh; // Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", string.Format("UPDATE dbo.PJ_dyk SET ParentID='{0}' WHERE ParentID='{1}'", obj.bh, obj.ID)); // Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", string.Format("UPDATE dbo.PJ_dyk SET ID='{0}', bh='{1}' WHERE ID='{2}'", obj.bh, obj.bh, obj.ID)); // obj.ID = obj.bh; // MainHelper.PlatformSqlMap.Update<PJ_dyk>(obj); //} }
private void btnOK_Click(object sender, EventArgs e) { if (ceQuick.Visible && ceQuick.Checked) { string[] nr = rowData.nr.Split(new string[] { "\r\n" },StringSplitOptions.None); string[] nr2 = rowData.nr2.Split(new string[] { "\r\n" },StringSplitOptions.None); string[] nr3 = rowData.nr3.Split(new string[] { "\r\n" },StringSplitOptions.None); string[] nr4 = rowData.nr4.Split(new string[] { "\r\n" }, StringSplitOptions.None); long index = Convert.ToInt64(rowData.ID); IList<PJ_dyk> li = MainHelper.PlatformSqlMap.GetList<PJ_dyk>("SelectPJ_dykList", " where ParentID='" + rowData.ParentID + "' order by id desc"); if (li.Count > 0) index = (Convert.ToInt64(li[0].bh) ); else { index = (Convert.ToInt64(rowData.ParentID) * 100 + 1); } rowData.nr = nr[0]; rowData.nr2 = nr2[0]; rowData.nr3 = nr3[0]; rowData.nr4 = nr4[0]; for (int i = 1; i < nr.Length; i++) { if (nr[i] == "") continue; PJ_dyk dyk = new PJ_dyk(); dyk.ID = (index + i).ToString(); dyk.dx = rowData.dx; dyk.sx = rowData.sx; dyk.bh = dyk.ID; dyk.nr = nr[i]; dyk.ParentID = rowData.ParentID; if ( nr2.Length >i) dyk.nr2 = nr2[i]; if (nr3.Length > i) dyk.nr3 = nr3[i]; if (nr4.Length > i) dyk.nr4 = nr4[i]; MainHelper.PlatformSqlMap.Create<PJ_dyk>(dyk); } } }
/// <summary> /// 新建对象设置Key值 /// </summary> /// <param name="newobj"></param> void gridViewOperation_CreatingObjectEvent(PJ_dyk newobj) { newobj.ParentID = parentID; if (parentObj != null) { newobj.sx = parentObj.sx; newobj.dx = parentObj.dx; } }