Example #1
0
        public static void CreatRiZhi(sdjl_09pxjl obj)
        {


            sdjl_gzrjnr gzr = new sdjl_gzrjnr();
            gzr.gzrjID = gzr.CreateID();
            gzr.ParentID = obj.ID;
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            IList<sdjl_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<sdjl_01gzrj>("Selectsdjl_01gzrjList", "where GdsCode='" + MainHelper.User.OrgCode + "' and rq between '" + obj.rq.ToString("yyyy-MM-dd 00:00:00") + "' and '" + obj.rq.ToString("yyyy-MM-dd 23:59:59") + "'");

            if (gzrj01.Count > 0)
            {
                gzr.gzrjID = gzrj01[0].gzrjID;
            }
            else
            {
                sdjl_01gzrj pj = new sdjl_01gzrj();
                pj.gzrjID = pj.CreateID();
                pj.GdsCode = obj.OrgCode;
                pj.GdsName = obj.OrgName;
                pj.CreateDate = obj.rq;
                pj.CreateMan = MainHelper.User.UserName;
                gzr.gzrjID = pj.gzrjID;
                pj.rq = obj.rq;
                pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                MainHelper.PlatformSqlMap.Create<sdjl_01gzrj>(pj);


            }
            IList<sdjl_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<sdjl_gzrjnr>("Selectsdjl_gzrjnrList", "where gzrjID  = '" + gzr.gzrjID + "' order by seq  ");
            if (gzrlist.Count > 0)
            {
                gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
            }
            else
                gzr.seq = 1;

            gzr.gznr =obj.hydd+ "职工培训";
            gzr.fzr = obj.zcr;

            gzr.cjry = obj.zcr + "等" + gzr.cjry + "人";

            gzr.CreateDate = obj.rq;
            gzr.CreateMan = MainHelper.User.UserName;
            gzr.fssj = obj.rq;
            MainHelper.PlatformSqlMap.Create<sdjl_gzrjnr>(gzr);

        }
Example #2
0
 void ucTop_FocusedRowChanged(object sender, sdjl_01gzrj obj)
 {
     ucBottom.ParentObj = obj;
     splitCC1.Panel2.Text = "内容日期:" + (obj != null ? obj.rq.ToShortDateString() : "");
 }
Example #3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            //if (recordStatus == 0)
            //{

            sdjl_gzrjnr gzr = new sdjl_gzrjnr();
            sdjl_03yxfx yxfx = RowData as sdjl_03yxfx;
            object obj = MainHelper.PlatformSqlMap.GetOneByKey<sdjl_03yxfx>(yxfx.ID);
            if (obj == null)
            {
                rowData.gznrID = gzr.gznrID;
                gzr.ParentID = yxfx.ID;
                yxfx.CreateDate = DateTime.Now;
                yxfx.CreateMan = MainHelper.User.UserName;
                IList<sdjl_01gzrj> gzrj01 = MainHelper.PlatformSqlMap.GetList<sdjl_01gzrj>("Selectsdjl_01gzrjList", "where rq between '" + rowData.rq.ToString("yyyy-MM-dd 00:00:00") + "' and '" + rowData.rq.ToString("yyyy-MM-dd 23:59:59") + "'");
                if (gzrj01.Count > 0)
                {
                    gzr.gzrjID = gzrj01[0].gzrjID;
                }
                else
                {
                    sdjl_01gzrj pj = new sdjl_01gzrj();
                    pj.gzrjID = pj.CreateID();
                    pj.GdsCode = rowData.OrgCode;
                    pj.GdsName = rowData.OrgName;
                    pj.CreateDate = rowData.rq;
                    pj.CreateMan = MainHelper.User.UserName;
                    gzr.gzrjID = pj.gzrjID;
                    pj.rq = rowData.rq;
                    pj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
                    pj.rsaqts = (DateTime.Today - MainHelper.UserOrg.PSafeTime.Date).Days;
                    pj.sbaqts = (DateTime.Today - MainHelper.UserOrg.DSafeTime.Date).Days;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    MainHelper.PlatformSqlMap.Create<sdjl_01gzrj>(pj);


                }
                IList<sdjl_gzrjnr> gzrlist = MainHelper.PlatformSqlMap.GetList<sdjl_gzrjnr>("Selectsdjl_gzrjnrList", "where ParentID  = '" + gzr.ParentID + "' order by seq  ");
                if (gzrlist.Count > 0)
                {
                    gzr.seq = gzrlist[gzrlist.Count - 1].seq + 1;
                }
                else
                    gzr.seq = 1;
                gzr.gznr = yxfx.hydd + "运行分析-" + yxfx.type;
                gzr.fzr = yxfx.zcr;
                gzr.fssj = yxfx.rq;
                string[] ss = yxfx.cjry.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                if (ss.Length >= 1)
                {

                    gzr.cjry = ss[0] + ss[1];
                    if (ss.Length > 2) gzr.cjry = gzr.cjry + "等";
                    gzr.cjry = gzr.cjry + ss.Length + "人";
                }
                else
                {
                    gzr.cjry = gzr.fzr;
                }
                MainHelper.PlatformSqlMap.Create<sdjl_gzrjnr>(gzr);
                MainHelper.PlatformSqlMap.Create<sdjl_03yxfx>(yxfx);
            }
            else
            {
                yxfx.CreateDate = yxfx.rq;
                MainHelper.PlatformSqlMap.Update<sdjl_03yxfx>(RowData);
            }
            //string strmes = RecordWorkTask.RunNewYXFXRecord(rowData.ID, yxfx.type,MainHelper.User.UserID   );

            //if (strmes.IndexOf("未提交至任何人") > -1)
            //{
            //    MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
            //    return;
            //}
            //else
            //    MsgBox.ShowTipMessageBox(strmes);
            //if (gzrj01.Count > 0)
            //    MainHelper.PlatformSqlMap.Create<sdjl_gzrjnr>(gzr);
            //MainHelper.PlatformSqlMap.Create<sdjl_03yxfx>(yxfx);
            //this.Close();
            //}
            //else
            //{
            //    //try
            //    //{
            //    //    string strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
            //    //    if (strmes.IndexOf("未提交至任何人") > -1)
            //    //    {
            //    //        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
            //    //        return;
            //    //    }
            //    //    else
            //    //        MsgBox.ShowTipMessageBox(strmes);

            //    //}
            //    //catch (System.Exception ex)
            //    //{

            //    //}

            //    MainHelper.PlatformSqlMap.Update<sdjl_03yxfx>(RowData);

            //}

            //this.Close(); 
        }
Example #4
0
        //ExcelAccess
        public static void ExportExcel(sdjl_01gzrj jl, IList<sdjl_gzrjnr> nrList) {
            nrList = getRjnrList(jl.gzrjID);
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\送电02工作日记.xls";
            ex.Open(fname);
            int row = 1;
            int col = 1;
            int row_nr = 9;
            int row_num = 36 * 2;
            //List<string> strpy = Ecommon.ResultStrList("领导检查评语:" + jl.py, row_num);
            List<string> strjs = Ecommon.ResultStrList("记事:" + jl.js, row_num);
            int nrpage = Ecommon.GetPagecount(nrList.Count, 9);
            //int p = Math.Max(Ecommon.GetPagecount(strpy.Count + strjs.Count, 5), nrpage);
            int p = Math.Max(Ecommon.GetPagecount( strjs.Count, 5), nrpage);
            System.Collections.ArrayList objlist = new System.Collections.ArrayList();
            objlist.Add(strjs);
            //objlist.Add(strpy);
            List<string> allList = Ecommon.GetCollList(objlist);
            
            for (int j = 1; j <= p; j++) {
                if (j > 1) {
                    ex.CopySheet(1, 1);
                }
            }
            for (int j = 1; j <= p; j++) {
                ex.ActiveSheet(j);
                ex.ReNameWorkSheet(j, "Sheet" + (j));
                setHead(ex, jl);
                if (j == 1) {
                    setHead2(ex, jl);
                }
                int prepageindex = j - 1;
                //主题
                int starownr = prepageindex * 9 + 1;
                int js = prepageindex * 5 + 1;
                int endrownr = j * 9;
                int endrowjs = j * 5;
                int bh = 0;
                if (nrList.Count > endrownr) {
                    for (int i = 0; i < 9; i++) {
                        bh++;
                        sdjl_gzrjnr obj = nrList[starownr - 1 + i];
                        ex.SetCellValue(obj.seq > 0 ? obj.seq.ToString() : "", row + 9 + i, col);
                        ex.SetCellValue(obj.gznr, row + 9 + i, col + 1);
                        ex.SetCellValue(obj.fzr, row + 9 + i, col + 8);
                        string[] rr = obj.cjry.Split(";".ToCharArray());
                        if (rr.Length > 2)
                        {
                            string cry = rr[0]+ rr[1] + "等" + rr.Length + "人";

                            ex.SetCellValue(cry, row + 9 + i, col + 11);
                        }
                        else
                            ex.SetCellValue(obj.cjry, row + 9 + i, col + 11);

                    }
                } else if (nrList.Count <= endrownr && nrList.Count >= starownr) {
                    for (int i = 0; i < nrList.Count - starownr + 1; i++) {
                        sdjl_gzrjnr obj = nrList[starownr - 1 + i];
                        ex.SetCellValue(obj.seq > 0 ? obj.seq.ToString() : "", row + 9 + i, col);
                        ex.SetCellValue(obj.gznr, row + 9 + i, col + 1);
                        ex.SetCellValue(obj.fzr, row + 9 + i, col + 8);
                        string[] rr = obj.cjry.Split(";".ToCharArray());
                        if (rr.Length > 2)
                        {
                            string cry = rr[0] + rr[1] + "等" + rr.Length + "人";

                            ex.SetCellValue(cry, row + 9 + i, col + 11);
                        }
                        else
                            ex.SetCellValue(obj.cjry, row + 9 + i, col + 11);
                    }
                }
                if (allList.Count > endrowjs) {
                    for (int i = 0; i < 5; i++) {
                        ex.SetCellValue(allList[js - 1 + i], row + 18 + i, col);
                    }
                } else if (allList.Count <= endrowjs && allList.Count >= js) {
                    for (int i = 0; i < allList.Count - js + 1; i++) {
                        ex.SetCellValue(allList[js - 1 + i], row + 18 + i, col);
                    }
                }
            }
            ex.ActiveSheet(1);
            ex.ShowExcel();

        }
Example #5
0
        /// <summary>
        /// 填充人员
        /// </summary>
        /// <param name="ex"></param>
        /// <param name="jl"></param>
        private static void setHead2(ExcelAccess ex, sdjl_01gzrj jl) {
            int row = 1;
            int col = 1;
           
            //姓名、原因
            string[] rr = new string[10];
            string[] yy = new string[10];
            string[] rr2 = jl.qqry.Split(";".ToCharArray(),StringSplitOptions.RemoveEmptyEntries);
            if (rr2.Length > 0)
            {
                for (int i = 0; i < rr2.Length - 1; i++)
                {
                    rr[i] = rr2[i].Split(":".ToCharArray())[0];
                    yy[i] = rr2[i].Split(":".ToCharArray())[1];
                }
                for (int i = rr2.Length - 1; i < rr.Length; i++)
                {
                    rr[i] = "";
                    yy[i] = "";
                }
            }
            ex.SetCellValue(rr[0], row + 4, col + 2);
            ex.SetCellValue(rr[1], row + 4, col + 4);
            ex.SetCellValue(rr[2], row + 4, col + 6);
            ex.SetCellValue(rr[3], row + 4, col + 8);
            ex.SetCellValue(rr[4], row + 4, col + 10);
            ex.SetCellValue(rr[5], row + 6, col + 2);
            ex.SetCellValue(rr[6], row + 6, col + 4);
            ex.SetCellValue(rr[7], row + 6, col + 6);
            ex.SetCellValue(rr[8], row + 6, col + 8);
            ex.SetCellValue(rr[9], row + 6, col + 10);
            ex.SetCellValue(yy[0], row + 5, col + 2);
            ex.SetCellValue(yy[1], row + 5, col + 4);
            ex.SetCellValue(yy[2], row + 5, col + 6);
            ex.SetCellValue(yy[3], row + 5, col + 8);
            ex.SetCellValue(yy[4], row + 5, col + 10);
            ex.SetCellValue(yy[5], row + 7, col + 2);
            ex.SetCellValue(yy[6], row + 7, col + 4);
            ex.SetCellValue(yy[7], row + 7, col + 6);
            ex.SetCellValue(yy[8], row + 7, col + 8);
            ex.SetCellValue(yy[9], row + 7, col + 10);

            //人身,设备
            ex.SetCellValue(jl.rsaqts.ToString(), row + 5, col + 13);
            ex.SetCellValue(jl.sbaqts.ToString(), row + 7, col + 13);
        }
Example #6
0
 /// <summary>
 /// 填充头尾
 /// </summary>
 /// <param name="ex"></param>
 /// <param name="jl"></param>
 private static void setHead(ExcelAccess ex, sdjl_01gzrj jl) {
     int row = 1;
     int col = 1;
     int row_nr = 9;
     //日期
     ex.SetCellValue(jl.rq.Year.ToString(), row + 3, col + 1);
     ex.SetCellValue(jl.rq.Month.ToString(), row + 3, col + 3);
     ex.SetCellValue(jl.rq.Day.ToString(), row + 3, col + 5);
     ex.SetCellValue(jl.xq.Replace("星期", ""), row + 3, col + 10);
     ex.SetCellValue(jl.tq, row + 3, 15);
     //签字、时间
     ex.SetCellValue(jl.qz, row + 14 + row_nr, col + 2);
     if (ComboBoxHelper.CompreDate(jl.qzrq))
     {
         ex.SetCellValue(jl.qzrq.Year.ToString(), row + 14 + row_nr, col + 6);
         ex.SetCellValue(jl.qzrq.Month.ToString(), row + 14 + row_nr, col + 9);
         ex.SetCellValue(jl.qzrq.Day.ToString(), row + 14 + row_nr, col + 11);
     }
     
 }
Example #7
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(sdjl_01gzrj newobj)
 {
     if (parentID == null) return;
     newobj.GdsCode = parentID;
     newobj.GdsName = parentObj.OrgName;
     newobj.CreateDate = DateTime.Now;
     Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin();
     newobj.CreateMan = m_UserBase.RealName;
     newobj.rq = DateTime.Now.Date;
     newobj.xq = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
     newobj.rsaqts = (DateTime.Today - parentObj.PSafeTime.Date).Days;
     newobj.sbaqts = (DateTime.Today - parentObj.DSafeTime.Date).Days;
 }