Beispiel #1
0
        /// <summary>
        /// 新建对象设置Key值
        /// </summary>
        /// <param name="newobj"></param>
        void gridViewOperation_CreatingObjectEvent(PJ_yfsyjl newobj)
        {
            if (parentID == null)
            {
                return;
            }
            try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); }
            catch { }

        }
Beispiel #2
0
        void gridViewOperation_AfterDelete(PJ_yfsyjl obj)
        {

            if (isWorkflowCall)
            {

                MainHelper.PlatformSqlMap.DeleteByWhere<WF_ModleRecordWorkTaskIns>(" where ModleRecordID='" + obj.ID + "' and RecordID='" + currRecord.ID + "'"
                    + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
                    + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
                    + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
                    + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "'");
            }
            string slqwhere = " where OrgCode='" + obj.OrgCode + "'  and type='" + obj.type + "' ";
            //if (isWorkflowCall)
            //{

            //    slqwhere = slqwhere + " and id in (select ModleRecordID from WF_ModleRecordWorkTaskIns where RecordID='" + CurrRecord.ID + "'";
            //    slqwhere = slqwhere + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
            //       + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
            //       + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
            //       + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "')";
            //}
            slqwhere = slqwhere + " order by xh";
            IList<PJ_yfsyjl> li = MainHelper.PlatformSqlMap.GetListByWhere<PJ_yfsyjl>(slqwhere);
            int i = 1;
            List<PJ_yfsyjl> list = new List<PJ_yfsyjl>();
            foreach (PJ_yfsyjl ob in li)
            {
                ob.xh = i;
                i++;
                list.Add(ob);
            }
            List<SqlQueryObject> list3 = new List<SqlQueryObject>();
            if (list.Count > 0)
            {
                SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Update, list.ToArray());
                list3.Add(obj3);
            }

            MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            RefreshData(" where OrgCode='" + obj.OrgCode + "'  and type='" + obj.type + "'  ");
        }
Beispiel #3
0
        void gridViewOperation_AfterAdd(PJ_yfsyjl obj)
        {
            string slqwhere = " where OrgCode='" + obj.OrgCode + "'  and type='" + obj.type + "' ";
            //if (isWorkflowCall)
            //{

            //    slqwhere = slqwhere + " and id in (select ModleRecordID from WF_ModleRecordWorkTaskIns where RecordID='" + CurrRecord.ID + "'";
            //    slqwhere = slqwhere + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
            //       + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
            //       + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
            //       + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "')";
            //}
            obj.xh = MainHelper.PlatformSqlMap.GetRowCount<PJ_yfsyjl>(slqwhere);
            obj.CreateDate = DateTime.Now;
            MainHelper.PlatformSqlMap.Update<PJ_yfsyjl>(obj);
            //if (isWorkflowCall)
            //{
            //    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
            //    mrwt.ModleRecordID = obj.ID;
            //    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);
            //}
            Delqxmx(obj.ID);
            RefreshData(" where OrgCode='" + ParentID + "'  and type='" + _type + "'  ");
        }
Beispiel #4
0
        void gridViewOperation_AfterEdit(PJ_yfsyjl obj)
        {
            Addqxmx(obj);
            RefreshData(" where OrgCode='" + ParentID + "'  and type='" + _type + "'  ");

        }
Beispiel #5
0
        //处理缺陷明细  lgmqx
        private void Addqxmx(PJ_yfsyjl obj)
        {
            PJ_qxfl tempobj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_qxfl>(obj.ID);
            switch (_type)
            {
                case "变压器":
                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "01";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "变压器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            mx.qxlb = "重大缺陷";
                            mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();

                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }

                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;
                case "断路器":
                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "02";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "断路器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            mx.qxlb = "重大缺陷";
                            mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();

                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }
                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;

                case "避雷器":

                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "03";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "避雷器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            if (obj.syjg == "绝缘阻值低于2000兆欧")
                            {
                                mx.qxnr = "预防性试验不合格";
                                mx.qxlb = "一般缺陷";
                                mx.xcqx = mx.xssj.AddMinutes(3).ToShortDateString();
                            }
                            else if (obj.syjg == "绝缘阻值低于1000兆欧")
                            {
                                mx.qxnr = "预防性试验不合格";
                                mx.qxlb = "重大缺陷";
                                mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();
                            }
                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }
                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;
                case "电容器":
                    if (obj.syjg != "合格")
                    {
                        if (tempobj == null || tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                            PJ_qxfl mx = new PJ_qxfl();
                            mx.ID = obj.ID;
                            mx.OrgCode = obj.OrgCode;
                            mx.OrgName = obj.OrgName;
                            mx.LineID = "04";
                            mx.LineName = obj.sbInstallAdress;
                            mx.xlqd = obj.sbInstallAdress;
                            mx.xssj = obj.sjExpTime;
                            mx.xsr = obj.syMan;
                            mx.qxly = "电容器预防性试验实施情况记录";
                            mx.qxnr = "预防性试验不合格";
                            mx.qxlb = "重大缺陷";
                            mx.xcqx = mx.xssj.AddDays(3).ToShortDateString();
                            //lgmqxlast
                            mx.xlid = obj.xlid;
                            mx.xlname = obj.xlname;
                            mx.tqid = obj.tqid;
                            mx.tqname = obj.tqname;
                            mx.byqid = obj.byqid;
                            mx.byqname = obj.byqname;
                            mx.kgid = obj.kgid;
                            mx.kgname = obj.kgname;
                            MainHelper.PlatformSqlMap.Create<PJ_qxfl>(mx);
                        }
                    }
                    else
                    {
                        if (tempobj != null && tempobj.xcr == string.Empty)
                        {
                            MainHelper.PlatformSqlMap.DeleteByKey<PJ_qxfl>(obj.ID);
                        }

                    }
                    break;
            }
        }
Beispiel #6
0
        /// <summary>
        /// 新建对象设置Key值
        /// </summary>
        /// <param name="newobj"></param>
        void gridViewOperation_CreatingObjectEvent(PJ_yfsyjl newobj)
        {
            if (parentID == null)
            {
                return;
            }
            try { frmLP.ReadTaskData(newobj, RecordWorkFlowData, ParentTemple, CurrRecord); }
            catch { }

            newobj.CreateDate = DateTime.Now;
            newobj.planExpTime = DateTime.Now;
            newobj.preExpTime = DateTime.Now;




        }
        void gridViewOperation_AfterAdd(PJ_yfsyjl obj)
        {
            string slqwhere = " where OrgCode='" + obj.OrgCode + "' and  type='" + obj.type + "'";
            if (isWorkflowCall)
            {

                slqwhere = slqwhere + " and id in (select ModleRecordID from WF_ModleRecordWorkTaskIns where RecordID='" + CurrRecord.ID + "'";
                slqwhere = slqwhere + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
                   + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
                   + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
                   + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "')";
            }
            obj.xh = MainHelper.PlatformSqlMap.GetRowCount<PJ_yfsyjl>(slqwhere)+1;
            obj.CreateDate = DateTime.Now;
            MainHelper.PlatformSqlMap.Update<PJ_yfsyjl>(obj);
            if (RecordWorkTask.CheckOnRiZhi(WorkFlowData))
            {
                RecordWorkTask.CreatRiZhi(WorkFlowData, null, currRecord.ID, new object[] {obj, currRecord });
            }
            RefreshData(" where OrgCode='" + ParentID + "'  and type='" + _type + "'   and planExpTime like '%" + DateTime.Now.Year + "%'   ");
        }
Beispiel #8
0
        public static void setSpanExcel(ExcelAccess ex, PJ_yfsyjl data, int i, int istart, int jmax, int jstart, ref int spanadd, int imax2, string sheetname, string[] sname, int itemp)
        {
            if (Math.Ceiling((i + 1.0 + spanadd) / (jmax)) > 1)
            {
                ex.ActiveSheet(sheetname + Math.Ceiling((i + 1.0 + spanadd) / (jmax)));


            }
            else
                ex.ActiveSheet(sheetname);
            ex.SetCellValue(Convert.ToString(i + 1), istart + ((i + spanadd) % jmax) * imax2, jstart);
            ex.SetCellValue(data.sbInstallAdress, istart + ((i + spanadd) % jmax) * imax2, jstart + 1);
            ex.SetCellValue(data.sbModle, istart + ((i + spanadd) % jmax) * imax2, jstart + 2);
            ex.SetCellValue(data.sl.ToString(), istart + ((i + spanadd) % jmax) * imax2, jstart + 3);

            ex.SetCellValue(data.syPeriod, istart + ((i + spanadd) % jmax) * imax2, jstart + 6);
            ex.SetCellValue(data.preExpTime.Year.ToString() + "年", istart + ((i + spanadd) % jmax) * imax2, jstart + 7);
            ex.SetCellValue(data.preExpTime.Month.ToString() + "月", istart + ((i + spanadd) % jmax) * imax2, jstart + 8);
            ex.SetCellValue(data.preExpTime.Day.ToString() + "日", istart + ((i + spanadd) % jmax) * imax2, jstart + 9);

            ex.SetCellValue(data.planExpTime.Year.ToString() + "年", istart + ((i + spanadd) % jmax) * imax2, jstart + 10);
            ex.SetCellValue(data.planExpTime.Month.ToString() + "月", istart + ((i + spanadd) % jmax) * imax2, jstart + 11);
            ex.SetCellValue(data.planExpTime.Day.ToString() + "日", istart + ((i + spanadd) % jmax) * imax2, jstart + 12);
            //ex.SetCellValue(data.charMan, istart + ((i + spanadd) % jmax) * imax2, jstart + 13);
            ex.SetCellValue(data.Remark, istart + ((i + spanadd) % jmax) * imax2, jstart + 13);

            for (int m = 0; m + itemp < sname.Length; m++)
            {
                if (m < 4)
                    ex.SetCellValue(sname[itemp], istart + ((i + spanadd) % jmax) * imax2 + m, jstart + 5);
                else
                {
                    spanadd++;
                    setSpanExcel(ex, data, i, istart, jmax, jstart, ref spanadd, imax2, sheetname, sname, m + itemp);
                    break;
                }
            }
        }
 void gridViewOperation_AfterAdd(PJ_yfsyjl obj)
 {
     obj.xh = MainHelper.PlatformSqlMap.GetRowCount<PJ_yfsyjl>(" where OrgCode='" + obj.OrgCode + "' and  type='" + obj.type + "'");
     obj.CreateDate = DateTime.Now;
     MainHelper.PlatformSqlMap.Update<PJ_yfsyjl>(obj);
     RefreshData(" where OrgCode='" + ParentID + "'  and type='" + _type + "' and (planExpTime like '%" + DateTime.Now.Year + "%' or planExpTime like '%" + DateTime.Now.Year + 1 + "%')  ");
 }
        void gridViewOperation_AfterDelete(PJ_yfsyjl obj)
        {

            IList<PJ_yfsyjl> li = MainHelper.PlatformSqlMap.GetListByWhere<PJ_yfsyjl>(" where OrgCode='" + obj.OrgCode + "'  and type='" + obj.type + "' order by xh");
            int i = 1;
            List<PJ_yfsyjl> list = new List<PJ_yfsyjl>();
            foreach (PJ_yfsyjl ob in li)
            {
                ob.xh = i;
                i++;
                list.Add(ob);
            }
            List<SqlQueryObject> list3 = new List<SqlQueryObject>();
            if (list.Count > 0)
            {
                SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Update, list.ToArray());
                list3.Add(obj3);
            }

            MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            RefreshData(" where OrgCode='" + obj.OrgCode + "'  and type='" + obj.type + "' and (planExpTime like '%" + DateTime.Now.Year + "%' or planExpTime like '%" + DateTime.Now.Year + 1 + "%')  ");
        }
        void gridViewOperation_AfterEdit(PJ_yfsyjl obj)
        {


        }
        void gridViewOperation_AfterAdd(PJ_yfsyjl obj)
        {
            string slqwhere = " where OrgCode='" + obj.OrgCode + "'  and type='" + obj.type + "' ";
            if (isWorkflowCall)
            {

                slqwhere = slqwhere + " and id in (select ModleRecordID from WF_ModleRecordWorkTaskIns where RecordID='" + CurrRecord.ID + "'";
                slqwhere = slqwhere + " and  WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "'"
                   + " and  WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "'"
                   + " and  WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'"
                   + " and  WorkTaskInsId='" + WorkFlowData.Rows[0]["WorkTaskInsId"].ToString() + "')";
            }
            obj.xh = MainHelper.PlatformSqlMap.GetRowCount<PJ_yfsyjl>(slqwhere)+1;
            obj.CreateDate = DateTime.Now;
            MainHelper.PlatformSqlMap.Update<PJ_yfsyjl>(obj);
            RefreshData(" where OrgCode='" + ParentID + "'  and type='" + _type + "'  ");
        }