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
        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 #3
0
 /// <summary>
 /// 获了内容记录
 /// </summary>
 /// <param name="pid"></param>
 /// <returns></returns>
 private static IList<sdjl_gzrjnr> getRjnrList(string pid) {
     IList<sdjl_gzrjnr> list = Client.ClientHelper.PlatformSqlMap.GetListByWhere<sdjl_gzrjnr>(" where gzrjID='" + pid + "' order by seq");
     IList<sdjl_gzrjnr> list2 = new List<sdjl_gzrjnr>();
     int nrows = 0;
     for (int i = 0; i < list.Count; i++) {
         sdjl_gzrjnr nr = list[i];
         List<string> lines = Ecommon.ResultStrList(nr.gznr, 34);
         //string[] lines = nr.gznr.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
         nr.gznr = "";
         int j = 0;
         foreach (string line in lines) {
             j++;
             nrows++;
             if (j == 1) {
                 nr.gznr = line;
                 list2.Add(nr);
             } else {
                 sdjl_gzrjnr newnr = new sdjl_gzrjnr();
                 newnr.gznr = line;
                 list2.Add(newnr);
             }
         }
     }
     return list2;
 }