Beispiel #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);

        }
Beispiel #2
0
 void gridViewOperation_AfterAdd(sdjl_09pxjl obj)
 {
     
     CreatRiZhi(obj);
 }
Beispiel #3
0
        /// <summary>
        /// 文档格式预定义好的,只填写内容
        /// </summary>
        /// <param name="obj"></param>
        public static void ExportExcel(sdjl_09pxjl obj)
        {
            //lgm
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\送电18培训记录.xls";

            ex.Open(fname);
            //每行显示文字长度
            int zc = 60;
            //与会人员之间的间隔符号
            char[] jksign = new char[1] { ';' };
            int row = 1;
            int col = 1;
            //计算页码
            int pagecount = 1;

            //题目

            string timustr = Ecommon.Comparestring(obj.tm, "题目") ? "" : "题目:";
           
            
            List<string> timulist = Ecommon.ResultStrListByPage(timustr,obj.tm, zc,4);
            if (Ecommon.GetPagecount(timulist.Count,4)>pagecount)
	        {
                pagecount=Ecommon.GetPagecount(timulist.Count,4);
	        }
            //活动内容

            string hdstr = Ecommon.Comparestring(obj.nr, "内容") ? "" : "内容:";
            List<string> hdlist = Ecommon.ResultStrListByPage(hdstr, obj.nr,zc,10);
              if (Ecommon.GetPagecount(hdlist.Count,10)>pagecount)
	        {
                pagecount=Ecommon.GetPagecount(hdlist.Count,10);
	        }
            //领导评语
            
            string ldpystr = Ecommon.Comparestring(obj.py, "领导检查评语") ? "" : "领导检查评语:";
            List<string> ldpylist = Ecommon.ResultStrListByPage(ldpystr,obj.py, zc,3);
             if (Ecommon.GetPagecount(ldpylist.Count,3)>pagecount)
	        {
                pagecount=Ecommon.GetPagecount(ldpylist.Count,3);
	        }
            //复制空模板
            for (int m = 1; m < pagecount; m++)
			{
                 ex.CopySheet(1,m);
                 ex.ReNameWorkSheet(m + 1, "Sheet" + (m + 1));
			}

            for (int p = 0; p < pagecount; p++)
            {
                ex.ActiveSheet(p + 1);

                //题目

                for (int i = 0; i < 4; i++)
                {
                    if (p*4+i>=timulist.Count)
                    {
                        break;
                    }
                    string  tempstr = timulist[p * 4 + i];
                    ex.SetCellValue(tempstr, 7 + i, 1);
                }
                //活动内容
              
                for (int r = 0; r < 10; r++)
                {
                    if (p*10+r>=hdlist.Count)
                    {
                        break;
                    }
                    string tempstr = hdlist[p * 10 + r];
                    ex.SetCellValue(tempstr, 11 + r, 1);
                }

                //领导评语
           
                for (int t = 0; t < 3; t++)
                {
                    if (p * 3 + t >= ldpylist.Count)
                    {
                        break;
                    }
                    string tempstr = ldpylist[p * 3 + t];
                    ex.SetCellValue(tempstr, 21 + t, 1);
                }
          

            }

            ex.ActiveSheet(1);
            
            //培训时间
            row = 2;
            ex.SetCellValue(obj.rq.Year.ToString(), 4, 2);

            ex.SetCellValue(obj.rq.Month.ToString(), 4, 4);

            ex.SetCellValue(obj.rq.Day.ToString(), 4, 6);
            //学习时数
            string[] ary = obj.xxss.Split(jksign);
            if (ary.Length>=1)
            {
                ex.SetCellValue(ary[0], 4, 9);
            }
            else
            {
                ex.SetCellValue("", 4, 9);
            }
            if (ary.Length >= 2)
            {
                ex.SetCellValue(ary[1], 4, 11);
            }
            else
            {
                ex.SetCellValue("", 4, 11);
            }
            //参加人数
            ex.SetCellValue(obj.cjrs, 4, 14);
            //主持人
            ex.SetCellValue(obj.zcr, 6, 3);
            ex.SetCellValue(obj.zjr, 6, 9);
            //会议地点
            //ex.SetCellValue(obj.hydd, 6, 14);

        
            //签字
           // ex.SetCellValue(obj.qz, 24, 3);
          //  if (ComboBoxHelper.CompreDate(obj.qzrq))
          //  {
           //     ex.SetCellValue(obj.qzrq.Year.ToString(), 24, 8);
          //      ex.SetCellValue(obj.qzrq.Month.ToString(), 24, 10);
          //      ex.SetCellValue(obj.qzrq.Day.ToString(), 24, 12);
          //  }

            ex.ActiveSheet(1);
            ex.ShowExcel();
           
        }
Beispiel #4
0
 /// <summary>
 /// 新建对象设置Key值
 /// </summary>
 /// <param name="newobj"></param>
 void gridViewOperation_CreatingObjectEvent(sdjl_09pxjl newobj)
 {
     if (parentID == null) return;
     newobj.OrgCode = parentID;
     newobj.OrgName = parentObj.OrgName;
     newobj.CreateDate = DateTime.Now;
     newobj.qzrq = DateTime.Now;
     Ebada.Core.UserBase m_UserBase = MainHelper.ValidateLogin();
     newobj.CreateMan = m_UserBase.RealName;
     newobj.rq = DateTime.Now;
 }
Beispiel #5
0
        /// <summary>
        /// 文档格式预定义好的,只填写内容
        /// </summary>
        /// <param name="obj"></param>
        public static void ExportExcel1(sdjl_09pxjl obj)
        {
            //lgm
            ExcelAccess ex = new ExcelAccess();
            SaveFileDialog saveFileDialog1 = new SaveFileDialog();
            string fname = Application.StartupPath + "\\00记录模板\\送电18培训记录.xls";

            ex.Open(fname);
            //每行显示文字长度
            int zc = 58;
            //与会人员之间的间隔符号
            char[] jksign = new char[1] { ';' };
            int row = 1;
            int col = 1;

            //计算页码
            int pagecount = 1;
            //题目
            string tmstr = Ecommon.Comparestring(obj.tm, "题目") ? "" : "题目:";
            List<string> tmlist = Ecommon.ResultStrListByPage(tmstr, obj.tm, zc, 4);
          
            //内容
            string nrstr = Ecommon.Comparestring(obj.nr, "内容") ? "" : "内容:";
            List<string> nrlist = Ecommon.ResultStrListByPage(nrstr, obj.nr, zc, 10);
            
            //领导评语
            string ldpystr = Ecommon.Comparestring(obj.py, "领导检查评语") ? "" : "领导检查评语:";
            List<string> ldpylist = Ecommon.ResultStrListByPage(ldpystr, obj.py, zc, 3);
            //页数
            if (Ecommon.GetPagecount(tmlist.Count + nrlist.Count + ldpylist.Count, 15) > pagecount)
            {
                pagecount = Ecommon.GetPagecount(ldpylist.Count + tmlist.Count + nrlist.Count, 15);
            }
            
            //复制空模版
            if (pagecount > 1)
            {
                for (int i = 1; i < pagecount; i++)
                {
                    ex.CopySheet(1, i);
                    ex.ReNameWorkSheet(i + 1, "Sheet" + (i + 1));
                }
            }
            for (int p = 0; p < pagecount; p++)
            {
                ex.ActiveSheet(p + 1);
                //改造后的
                for (int i = 0; i < 17; i++)
                {

                    if (p * 17 + i < tmlist.Count)
                    {

                        string tempstr = tmlist[p * 17 + i];
                        ex.SetCellValue(tempstr, 7 + i, 1);
                        if (p == 0 && i == 0)
                        {
                            //设定活动内容为粗体
                            ex.SetFontBold(7 + i, 1, 7 + i, 1, true, 0, 3);
                        }
                    }
                    if (p * 17 + i >= tmlist.Count && p * 17 + i < tmlist.Count + nrlist.Count)
                    {

                        string tempstr = nrlist[p * 17 + i - tmlist.Count];
                        ex.SetCellValue(tempstr, 7 + i, 1);
                        if (p * 17 + i == tmlist.Count)
                        {
                            ex.SetFontBold(7 + i, 1, 7 + i, 1, true, 0, 3);
                        }
                        //break;
                    }

                    if (p * 17 + i >= tmlist.Count + nrlist.Count && p * 17 + i < tmlist.Count + nrlist.Count + ldpylist.Count)
                    {

                        string tempstr = ldpylist[p * 17 + i - tmlist.Count - nrlist.Count];

                        ex.SetCellValue(tempstr, 7 + i, 1);
                        if (p * 17 + i == tmlist.Count + nrlist.Count)
                            ex.SetFontBold(7 + i, 1, 7 + i, 1, true, 0, 7);
                        //break;
                    }
                    if (p * 17 + i >= tmlist.Count + nrlist.Count + ldpylist.Count)
                    {
                        break;
                    }
                }
                
            }

            ex.ActiveSheet(1);

            
            //培训时间
            ex.SetCellValue(obj.rq.Year.ToString(), 4, 2);

            ex.SetCellValue(obj.rq.Month.ToString(), 4, 4);

            ex.SetCellValue(obj.rq.Day.ToString(), 4, 6);
            //学习时数
            string[] ary = obj.xxss.Split(jksign);
            if (ary.Length >= 1)
            {
                ex.SetCellValue(ary[0], 4, 9);
            }
            else
            {
                ex.SetCellValue("", 4, 9);
            }
            if (ary.Length >= 2)
            {
                ex.SetCellValue(ary[1], 4, 11);
            }
            else
            {
                ex.SetCellValue("", 4, 11);
            }
            //参加人数
            ex.SetCellValue(obj.cjrs, 4, 14);
            //主持人
            ex.SetCellValue(obj.zcr, 6, 3);
            ex.SetCellValue(obj.zjr, 6, 9);
            //会议地点
            //ex.SetCellValue(obj.hydd, 6, 14);


            ex.ShowExcel();

        }