Ejemplo n.º 1
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PJ_tbsj newobj)
 {
   
 }
Ejemplo n.º 2
0
        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Multiselect = true;
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                int i = 0;
                for (i = 0; i < dialog.FileNames.Length  ;i++ )
                {
                    string[] str_name = dialog.FileNames[i].Split("\\".ToCharArray());
                    string[] filename = str_name[str_name.Length - 1].Split(".".ToCharArray());
                    byte[] Excbyte = System.Text.Encoding.Default.GetBytes(filename[filename.Length - 1]);
                    string Exc = System.Text.Encoding.Default.GetString(Excbyte);

                    PJ_tbsj tb = MainHelper.PlatformSqlMap.GetOne<PJ_tbsj>("where picName='" + filename[0] + "'");
                    if (tb == null)
                    {
                        tb = new PJ_tbsj();
                        tb.ID = tb.CreateID();
                        tb.picName = filename[0];
                        tb.S1 = "." + Exc;
                        tb.Remark = tb.picName;
                        tb.picImage = Ecommon.GetImageBate(dialog.FileNames[i]);
                        MainHelper.PlatformSqlMap.Create<PJ_tbsj>(tb); 
                        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    }
                    else
                    {
                        tb.S1 = "." + Exc;
                        tb.picImage = Ecommon.GetImageBate(dialog.FileNames[i]);
                        MainHelper.PlatformSqlMap.Update<PJ_tbsj>(tb); 
                    }
                }
                RefreshData(" where 1=1");
            }
        }
Ejemplo n.º 3
0
 void gridViewOperation_AfterAdd(PJ_tbsj newobj)
 {
     if (isWorkflowCall)
     {
         WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
         mrwt.ModleRecordID = newobj.ID;
         mrwt.RecordID = currRecord.ID;
         mrwt.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
         mrwt.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
         mrwt.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
         mrwt.ModleTableName = newobj.GetType().ToString();
         mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
         mrwt.CreatTime = DateTime.Now;
         MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
         currRecord.DocContent = newobj.picImage;
         MainHelper.PlatformSqlMap.Update<LP_Record>(currRecord);
     }
 }