示例#1
0
 void ucpJ_14aqgj1_FocusedRowChanged(object sender, PS_aqgj obj)
 {
     ucpJ_14aqgjsy1.ParentID = "";
     ucpJ_14aqgjsy1.PSObj = null;
     ucpJ_14aqgjsy1.PSObj = obj;
 }
示例#2
0
        /// <summary>
        /// 文档格式预定义好的,只填写内容
        /// </summary>
        /// <param name="obj"></param>
        public static void ExportExcel(PS_aqgj obj,IList<PJ_14aqgjsy> objlist)
        {
            //lgm
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\14电力安全工具试验记录.xls";

            ex.Open(fname);
            //计算页码
            int pagecout = Ecommon.GetPagecount(objlist.Count, 17);
            //复制空模板并重命名
            for (int m = 1; m < pagecout; m++)
            {
                ex.CopySheet(1, m);
                ex.ReNameWorkSheet(m + 1, "Sheet" + (m + 1));
            }
            for (int p = 0; p < pagecout; p++)
            {
                ex.ActiveSheet(p + 1);
                for (int i = 0; i < 17; i++)
                {
                    if (p * 17 + i >= objlist.Count)
                    {
                        break;
                    }
                    PJ_14aqgjsy tempobj = objlist[p * 17 + i];
                    //时间
                    ex.SetCellValue(tempobj.rq.Year.ToString(), 8 + i, 1);
                    ex.SetCellValue(tempobj.rq.Month.ToString(), 8 + i, 2);
                    ex.SetCellValue(tempobj.rq.Day.ToString(), 8 + i, 3);
                    //
                    ex.SetCellValue(tempobj.jr, 8 + i, 4);
                    //送检人
           //         ex.SetCellValue(tempobj.sjr, 8 + i, 5);
                    //实验人
          //          ex.SetCellValue(tempobj.syr, 8 + i, 6);
                    //安监签字
          //          ex.SetCellValue(tempobj.ajqz, 8 + i, 7);
                    // 下次实验日期
                    ex.SetCellValue(tempobj.xcsyrq.Year.ToString(), 8 + i, 8);
                    ex.SetCellValue(tempobj.xcsyrq.Month.ToString(), 8 + i, 9);
                    ex.SetCellValue(tempobj.xcsyrq.Day.ToString(), 8 + i, 10);
                }

            }

            ex.ActiveSheet(1);
           
            ex.SetCellValue(obj.sbName, 5, 1);
            if (obj.sbCode.Contains(obj.sbName))
            {
                ex.SetCellValue(obj.sbCode, 5, 4);
            }
            else
            {
                ex.SetCellValue(obj.sbName+obj.sbCode, 5, 4);
            }
          
            ex.SetCellValue(obj.syzq.ToString()+"年", 5, 5);
            ex.SetCellValue(obj.syxm, 5, 8);


            ex.ActiveSheet(1);
           ex.ShowExcel();
        }
示例#3
0
        void gridViewOperation_AfterAdd(PS_aqgj obj) {
            if (isWorkflowCall) {
                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                mrwt.ModleRecordID = obj.sbID;
                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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                mrwt.CreatTime = DateTime.Now;
                mrwt.ModleTableName = obj.GetType().ToString();
                MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
            }


        }
示例#4
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PS_aqgj newobj) {
     if (parentID == null) return;
     newobj.OrgID = parentID;
     //newobj.OrgCode = parentID;
     //newobj.OrgName = parentObj.OrgName;
     //newobj.CreateDate = DateTime.Now;
     //newobj.CreateMan = MainHelper.LoginName;
     try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); } catch { }
 }
示例#5
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PS_aqgj newobj)
 {
     if (parentID == null) return;
      newobj.OrgID = parentID;
     //newobj.OrgCode = parentID;
     //newobj.OrgName = parentObj.OrgName;
     //newobj.CreateDate = DateTime.Now;
     //newobj.CreateMan = MainHelper.LoginName;
 }