Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
 private void dgvExtTemplates_DoubleClick(object sender, EventArgs e)
 {
     if (dgvExtTemplates.CurrentRow != null)
     {
         RelationObject frm = new RelationObject();
         if (frm.ShowDialog() == DialogResult.OK)
         {
             string tempaltesID = frm.WfTemplates;
             //保存
             string objectValue = dgvExtTemplates.CurrentRow.Cells["OBJECTVALUE"].Value.ToString();
             WF_TEMPLATES_OBJECT wfRealtionObject=WorkFlow.NewInstance.GetWfTemplatesObject(objectValue);
             if (wfRealtionObject != null)
             {
                 wfRealtionObject.WFT_ID = tempaltesID;
                 wfRealtionObject.LASTUPDATEDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                 wfRealtionObject.LASTUPDATEUSER = CommonFuns.NewInstance.LoginInfo.LoginID;
                 try
                 {
                     wfRealtionObject.Update();
                     MessageBox.Show("保存成功", "提示您:", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                     SetRealtionObject();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show("存储异常:" + ex.Message.ToString(), "提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                     return;
                 }
             }
             else
             {
                 wfRealtionObject.OBJECTVALUE = objectValue;
                 wfRealtionObject.WFT_ID = tempaltesID;
                 wfRealtionObject.OBJECTDESC = "";
                 wfRealtionObject.LASTUPDATEDATE = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                 wfRealtionObject.LASTUPDATEUSER = CommonFuns.NewInstance.LoginInfo.LoginID;
                 try
                 {
                     wfRealtionObject.Save();
                     MessageBox.Show("保存成功", "提示您:", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                     SetRealtionObject();
                 }
                 catch (Exception ex)
                 {
                     MessageBox.Show("存储异常:"+ex.Message.ToString(), "提示您:", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                     return;
                 }
             }
         }
     }
 }