예제 #1
0
        private void btEditfrm_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (gridView1.FocusedRowHandle<0)
            {
                return;
            }
           
            frmLP frm = new frmLP();
            frm.Status = "edit";
            frm.ParentTemple = ParentObj;
            frm.Kind = ParentObj.Kind;         
            DataRow dr = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            LP_Record currRecord = new LP_Record();
            foreach (DataColumn dc in gridtable.Columns)
            {
                if (dc.ColumnName != "Image")
                {
                    if (dc.DataType.FullName.IndexOf("Byte[]") < 0)
                        currRecord.GetType().GetProperty(dc.ColumnName).SetValue(currRecord, dr[dc.ColumnName], null);
                    else if (dc.DataType.FullName.IndexOf("Byte[]") > -1 && DBNull.Value != dr[dc.ColumnName] && dr[dc.ColumnName].ToString() != "") 
                        currRecord.GetType().GetProperty(dc.ColumnName).SetValue(currRecord, dr[dc.ColumnName], null);

                }
            }
            frm.CurrRecord = currRecord;
            if (currRecord.ID.IndexOf("N") > -1)
            {
                MsgBox.ShowWarningMessageBox("此记录由新模块创建,请使用新模块操作!");
                return;
            }
            if (!RecordWorkTask.HaveRunRecordRole(currRecord.ID, MainHelper.User.UserID)) return;
            DataTable dt = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
            frm.RecordWorkFlowData = dt;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                InitData(ParentObj.Kind);
            }
        }
예제 #2
0
        private void btAddfrm_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (MainHelper.UserOrg == null) return;

            if (!RecordWorkTask.HaveRunNewGZPRole(ParentObj.Kind, MainHelper.User.UserID)) return;
            frmLP frm = new frmLP();
            LP_Record lpr = new LP_Record();
            frm.Status = "add";
            frm.Kind = ParentObj.Kind;
            frm.ParentTemple = ParentObj;

            lpr.Status = RecordWorkTask.GetGZPRecordSartStatus(ParentObj.Kind, MainHelper.User.UserID);
            //lpr.Status = "填票";
            //frm.RowData = lpr;
            frm.CurrRecord = lpr;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                InitData(ParentObj.Kind);
            }
        }