コード例 #1
0
 private void bbi_Add_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     Model.NODEMATERIALSADD nodematerialsaddMdl = new Model.NODEMATERIALSADD();
     nodematerialsaddMdl.NODENAME = clbc_node.Items[clbc_node.SelectedIndex].ToString();
     if (nodematerialsaddMdl.NODENAME.Length <= 0 || nodematerialsaddMdl.NODENAME == null)
     {
         MessageBox.Show("请选择需要修改的工作节点!", "提示信息");
         return;
     }
     else
     {
         frmNODEMATERIALSADD frm = new frmNODEMATERIALSADD(nodematerialsaddMdl, StatusClass.AddNew);
         frm.ShowDialog();
         ReadData(nodematerialsaddMdl.NODENAME);
     }
 }
コード例 #2
0
        private void bbi_Edit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            Model.NODEMATERIALSADD nodematerialsaddMdl = new Model.NODEMATERIALSADD();
            nodematerialsaddMdl.NODENAME = this.clbc_node.Items[clbc_node.SelectedIndex].ToString();
            if (nodematerialsaddMdl.NODENAME.Length <= 0 || nodematerialsaddMdl.NODENAME == null)
            {
                MessageBox.Show("请选择需要修改的工作节点!", "提示信息");
                return;
            }

            int id = 0;

            if (this.gridView1.RowCount <= 0)
            {
                return;
            }
            id = ToolHelper.ConvertToInt(this.gridView1.GetFocusedRowCellValue("NODEMATERIALSNO").ToString());
            if (id < 1)
            {
                MessageBox.Show("请选择需要修改的材料信息!", "提示信息");
                return;
            }
            else
            {
                nodematerialsaddMdl.NODEMATERIALSNO = ToolHelper.ConvertToInt(this.gridView1.GetFocusedRowCellValue("NODEMATERIALSNO").ToString());
                nodematerialsaddMdl.NAME            = this.gridView1.GetFocusedRowCellValue("NAME").ToString();
                nodematerialsaddMdl.MATERIALNAME    = this.gridView1.GetFocusedRowCellValue("MATERIALNAME").ToString();
                nodematerialsaddMdl.BEGINTIME       = ToolHelper.ConvertToDateTime(this.gridView1.GetFocusedRowCellValue("BEGINTIME").ToString());
                nodematerialsaddMdl.ENDTIME         = ToolHelper.ConvertToDateTime(this.gridView1.GetFocusedRowCellValue("ENDTIME").ToString());
                nodematerialsaddMdl.MEMO            = this.gridView1.GetFocusedRowCellValue("MEMO").ToString();

                frmNODEMATERIALSADD frm = new frmNODEMATERIALSADD(nodematerialsaddMdl, StatusClass.Edit);
                frm.ShowDialog();
                ReadData(nodematerialsaddMdl.NODENAME);
            }
        }