Exemple #1
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PJ_05jcky newobj)
 {
     if (parentID == null) return;
     newobj.OrgCode = parentID;
     newobj.OrgName = parentObj.OrgName;
     newobj.CreateDate = DateTime.Now;
     Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin();
     newobj.CreateMan = m_UserBase.RealName;
 }
Exemple #2
0
        //ExcelAccess
        public static void ExportExcel(PJ_05jcky jl) {

            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\05交叉跨越及对地距离测量记录.xls";
            ex.Open(fname);
            int row = 1;
            int col = 1;
            int rowcount = 11;
            //
            IList<PJ_05jckyjl> list = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_05jckyjl>(" where jckyID='" + jl.jckyID + "' order by CreateDate");
            //加页
            int pageindex = 1;
            if (pageindex < Ecommon.GetPagecount(list.Count, 15)) {
                pageindex = Ecommon.GetPagecount(list.Count, 15);
            }
            for (int j = 1; j <= pageindex; j++) {
                if (j > 1) {
                    ex.CopySheet(1, 1);
                }
            }
            // PS_xl xlobject = Client.ClientHelper.PlatformSqlMap.GetOneByKey<PS_xl>(jl.LineID);
            ex.ActiveSheet(1);
            PS_xl xl = Client.ClientHelper.PlatformSqlMap.GetOne<PS_xl>(" where linecode='" + jl.LineID + "'");
            if (xl != null) {
                string sublinename = "";
                string linename = andparentlinename(xl);
                string[] fz = linename.Split(" ".ToCharArray());
                if (fz.Length > 2) {
                    sublinename += fz[0] + " " + fz[1] + " " + fz[fz.Length - 1];
                } else
                    sublinename = linename;
                ex.SetCellValue(linename, row + 3, col + 1);
            } else {
                string sublinename = "";
                string linename = jl.kywz;
                string[] fz = linename.Split(" ".ToCharArray());
                if (fz.Length > 2) {
                    sublinename += fz[0] + " " + fz[1] + " " + fz[fz.Length - 1];
                } else
                    sublinename = linename;
                ex.SetCellValue(linename, row + 3, col + 1);
            }


            //ex.SetCellValue("'" + jl.gtID, row + 3, col + 3);
            //ex.SetCellValue(jl.kywz, row + 3, col + 6);


            //交叉跨越行
            ex.SetCellValue(jl.kygh, row + 6, col);
            ex.SetCellValue(jl.gdjl.ToString(), row + 6, col + 3);
            ex.SetCellValue(jl.kymc, row + 6, col + 4);
            ex.SetCellValue(jl.ssdw, row + 6, col + 5);
            ex.SetCellValue(jl.jb, row + 6, col + 7);
            //测量记录

            ex.ShowExcel();
            for (int j = 1; j <= pageindex; j++) {
                ex.ActiveSheet(j);
                //ex.ReNameWorkSheet(j, "Sheet" + (j));
                int prepageindex = j - 1;
                //主题
                int starow = prepageindex * 15 + 1;
                int endrow = j * 15;

                if (list.Count > endrow) {
                    for (int i = 0; i < 15; i++) {

                        string str = list[starow - 1 + i].clrqz;
                        string[] mans = str.Split(new char[1] { ';' });
                        ex.SetCellValue(list[starow - 1 + i].clrq.Year.ToString(), rowcount + i, col);
                        ex.SetCellValue(list[starow - 1 + i].clrq.Month.ToString(), rowcount + i, col + 1);
                        ex.SetCellValue(list[starow - 1 + i].clrq.Day.ToString(), rowcount + i, col + 2);
                        ex.SetCellValue(list[starow - 1 + i].scz.ToString(), rowcount + i, col + 3);
                        ex.SetCellValue(list[starow - 1 + i].qw, rowcount + i, col + 4);
                        ex.SetCellValue(mans[0], rowcount + i, col + 5);
                        ex.SetCellValue(mans[1], rowcount + i, col + 6);
                        ex.SetCellValue(list[starow - 1 + i].jr, rowcount + i, col + 7);

                    }
                } else if (list.Count <= endrow && list.Count >= starow) {
                    for (int i = 0; i < list.Count - starow + 1; i++) {
                        string str = list[starow - 1 + i].clrqz;
                        string[] mans = str.Split(new char[1] { ';' });
                        ex.SetCellValue(list[starow - 1 + i].clrq.Year.ToString(), rowcount + i, col);
                        ex.SetCellValue(list[starow - 1 + i].clrq.Month.ToString(), rowcount + i, col + 1);
                        ex.SetCellValue(list[starow - 1 + i].clrq.Day.ToString(), rowcount + i, col + 2);
                        ex.SetCellValue(list[starow - 1 + i].scz.ToString(), rowcount + i, col + 3);
                        ex.SetCellValue(list[starow - 1 + i].qw, rowcount + i, col + 4);

                        ex.SetCellValue(mans[0], rowcount + i, col + 5);
                        ex.SetCellValue(mans[1], rowcount + i, col + 6);
                        ex.SetCellValue(list[starow - 1 + i].jr, rowcount + i, col + 7);

                    }
                }

            }
            ex.ActiveSheet(1);

            ex.ShowExcel();

        }
Exemple #3
0
      /// <summary>
      /// 新建对象设置Key值
      /// </summary>
      /// <param name="newobj"></param>
      void gridViewOperation_CreatingObjectEvent(PJ_05jcky newobj)
      {
          if (parentID == null) return;
          newobj.gtID = parentID;
          newobj.kygh = parentObj.gth;
          newobj.LineID = parentObj.LineCode;
          newobj.OrgCode = parentObj.LineCode.Substring(0, 3);
          mOrg org = Client.ClientHelper.PlatformSqlMap.GetOne<mOrg>("where orgcode='" + newobj.OrgCode + "'");
          if (org != null)
              newobj.OrgName = org.OrgName;
 
      }
Exemple #4
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(PJ_05jcky newobj) {
     if (parentID == null) return;
     newobj.OrgCode = parentID;
     newobj.OrgName = parentObj.OrgName;
     newobj.CreateDate = DateTime.Now;
     Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin();
     newobj.CreateMan = m_UserBase.RealName;
     try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); } catch { }
 }
Exemple #5
0
 void gridViewOperation_AfterAdd(PJ_05jcky obj) {
     //RefreshData("where byqID='" + PSObj.byqID + "'");
     if (isWorkflowCall) {
         WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
         mrwt.ModleRecordID = obj.jckyID;
         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 = obj.GetType().ToString();
         mrwt.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
         mrwt.CreatTime = DateTime.Now;
         MainHelper.PlatformSqlMap.Create<WF_ModleRecordWorkTaskIns>(mrwt);
         MainHelper.PlatformSqlMap.Update<LP_Record>(currRecord);
     }
 }
Exemple #6
0
 void ucTop_FocusedRowChanged(object sender, PJ_05jcky obj)
 {
     ucBottom.ParentObj = obj;
     splitCC1.Panel2.Text = "测量记录:" + (obj != null ? obj.kymc : "");
 }