コード例 #1
0
        void gridViewOperation_AfterDelete(PJ_18gysbpjmx obj)
        {

            IList<PJ_18gysbpjmx> list = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_18gysbpjmx>(" where PJ_ID='" + PSObj.PJ_ID + "' order by xh ");
            List<PJ_18gysbpjmx> list2 = new List<PJ_18gysbpjmx>();
            for (int i = 0; i < list.Count; i++)
            {
                list[i].xh = i;
            }
            list2.AddRange (list);
            try
            {
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                
                if (list.Count > 0)
                {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Update, list2.ToArray());
                    list3.Add(obj3);
                }

                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
                RefreshData(" where PJ_ID='" + PSObj.PJ_ID + "' order by xh  ");

            }
            catch (Exception exception)
            {
                MainHelper.ShowWarningMessageBox(exception.Message);
               
            }
        }
コード例 #2
0
ファイル: frmGtDel.cs プロジェクト: s7loves/mypowerscgl
        private bool save() {
            int begin = comboBoxEdit10.SelectedIndex;
            int end = comboBoxEdit11.SelectedIndex;
            bool flag = true;
            if(begin>end){
                MsgBox.ShowWarningMessageBox("启始杆号不能大于终止杆号!");
                flag = false;
                goto ret;
            }
           
            if (begin == -1) {
                MsgBox.ShowTipMessageBox("请选择启始杆号!");
                flag = false;
                goto ret;
            }
            if (end == -1) {
                MsgBox.ShowTipMessageBox("请选择终止杆号!");
                flag = false;
                goto ret;
            }
            if (MsgBox.ShowAskMessageBox(string.Format("删除{0}-{1}的所有{2},确定吗?",gtlist[begin].Gt.gth, gtlist[end].Gt.gth, mtype)) == DialogResult.OK) {
                List<string> list = new List<string>();
                for (int i = begin; i <= end; i++) {
                    PS_gt gt = gtlist[i].Gt;
                    list.Add("'" + gt.gtID + "'");
                }
                SqlQueryObject so1 = new SqlQueryObject(SqlQueryType.Delete, "Delete", "delete from ps_gt where gtid in ("+string.Join(",",list.ToArray())+")");
                List<SqlQueryObject> listso = new List<SqlQueryObject>();
                if (mtype == "杆塔") {
                    listso.Add(so1);
                }
                SqlQueryObject so2 = new SqlQueryObject(SqlQueryType.Delete, "Delete", "delete from ps_gtsb where gtid  in (" + string.Join(",", list.ToArray()) + ")");
                listso.Add(so2);
                try {
                    ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(listso);
                } catch {
                    flag = false;
                }

            } else {
                flag = false;
            }
            ret:
            return flag;
        }
コード例 #3
0
ファイル: UsualForm.cs プロジェクト: s7loves/mypowerscgl
 private void RemoveMoudle_Click(object sender, EventArgs e)
 {
     if (gridView1.FocusedRowHandle   <0)
         return;
     try
     {
         DataRow udr = gridView1.GetDataRow(gridView1.FocusedRowHandle);
         if (udr == null) return;
         string umid = udr["ID"].ToString();
         //mModule obj = MainHelper.PlatformSqlMap.GetOneByKey<mModule>(udr["mMouleID"]);
         //mUserModule um = new mUserModule();
         //um.mMouleID = obj.Modu_ID;
         //DataRow dr = mdt.NewRow();
         //dr["Modu_ID"] = obj.Modu_ID ;
         //dr["ModuName"] = obj.ModuName;
         //dr["ParentID"] = obj.ParentID;
         //mdt.Rows.Add(dr);
         udt.Rows.Remove(udr);
         MainHelper.PlatformSqlMap.DeleteByKey<mUserModule>(umid);
         IList<mUserModule> il = MainHelper.PlatformSqlMap.GetList<mUserModule>("SelectmUserModuleList", "where UserID='" + MainHelper.User.UserID + "' order by SortID");
         for (int i = 0; i < il.Count; i++)
         {
             il[i].SortID = i + 1;
             
         
         }
         SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Update,"UpdatemUserModule", il);
         List<SqlQueryObject> list3 = new List<SqlQueryObject>();
         list3.Add(obj3);
         MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
         desk.iniUsualCtrl();
         treeList1.Refresh();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
コード例 #4
0
ファイル: UCmLPRecord.cs プロジェクト: s7loves/mypowerscgl
        void copyData(LP_Temple lp, IList<LP_Temple> templeList)
        {
            if (templeList.Count == 0) return;
            string flowid = lp.ParentID;
            int i = 1;
            List<LP_Temple> list = new List<LP_Temple>();
            string workflowid = flowid;
            IList<WF_WorkTask> wftli = MainHelper.PlatformSqlMap.GetList<WF_WorkTask>("SelectWF_WorkTaskList", "where WorkFlowId='" + workflowid + "' and  TaskTypeId!='2' order by TaskTypeId");
            foreach (WF_WorkTask wft in wftli)
            {
                //保存关联模块
                WorkFlowTask.DeleteAllModle(wft.WorkTaskId);
                mModule mu = MainHelper.PlatformSqlMap.GetOne<mModule>("where ModuName='表单执行平台'  and ModuTypes='Ebada.Scgl.Lcgl.frmLP'");
                WorkFlowTask.SetTaskUserModle(mu.Modu_ID, wft.WorkFlowId, wft.WorkTaskId);
                //保存关联表单
                WorkFlowTask.DeleteAllControls(wft.WorkTaskId);
                WorkFlowTask.DeleteAllTableField(wft.WorkFlowId, wft.WorkTaskId);
                string sqlStr = " where  WorkTaskId='" + wft.WorkTaskId + "'";

                MainHelper.PlatformSqlMap.DeleteByWhere<WF_WorkTaskControls>(sqlStr);
                WorkFlowTask.SetTaskUserCtrls(templeList[0].ParentID, workflowid, wft.WorkTaskId);
            }
            i = 1;
            foreach (LP_Temple obj in templeList)
            {
                obj.SortID = i;
                if (obj.SignImg == null)
                {
                    obj.SignImg = new byte[0];
                }
                if (obj.ImageAttachment == null)
                {
                    obj.ImageAttachment = new byte[0];
                }
                if (obj.DocContent == null)
                {
                    obj.DocContent = new byte[0];
                }
                i++;
                if (obj.CellName == "6.3 其他安全措施和注意事项" && obj.Status == "")
                {
                    obj.Status = "填票";
                }

                if (obj.CellName.IndexOf("终了时间") > -1)
                {
                    obj.WordCount = "dd日 HH:mm";
                }
                else
                    if (obj.CellName.IndexOf("同意执行时间") > -1)
                    {
                        obj.WordCount = "MM-dd日 HH:mm";
                    }
                    else
                        if (obj.CellName.IndexOf("时间") > -1)
                        {
                            obj.WordCount = "yyyy-MM-dd HH:mm";
                        }

                if (obj.SqlSentence == "SelectmOrgList where parentid='0'")
                {
                    obj.SqlSentence = "Select OrgName  from mOrg where parentid='0'";
                    obj.SqlColName = "";
                }

                if (obj.SqlSentence.IndexOf("SelectmUserList where  OrgName ='@1'") > -1)
                {
                    obj.SqlSentence = "Select UserName  from mUser where OrgName='{1}'";
                    obj.SqlColName = "";
                }

                if (lp.CellName == "电力线路第一种工作票")
                {
                    //if (obj.KindTable == "")
                    {
                        obj.KindTable = "工作票";
                    }
                }
                if (lp.CellName == "电力线路第二种工作票")
                {
                    //if (obj.KindTable == "")
                    {
                        obj.KindTable = "Sheet1";
                    }
                }

                if (lp.CellName == "电力线路倒闸操作票")
                {
                    //if (obj.KindTable == "")
                    {
                        obj.KindTable = "Sheet1";
                    }
                }
                if (lp.CellName == "电力线路事故应急抢修单")
                {
                    if (obj.KindTable == "")
                    {
                        obj.KindTable = "Sheet1";
                    }
                }


                if (obj.SqlSentence == "SelectmOrgList where parentid=(select OrgID From mOrg where OrgName='@1')")
                //if (obj.SqlSentence == "Select OrgName  from mOrg where  parentid=(select OrgID From mOrg where OrgName={1})")
                {
                    obj.SqlSentence = "Select OrgName  from mOrg where  parentid=(select OrgID From mOrg where OrgName='{1}')";
                    obj.SqlColName = "";
                }
                WF_WorkTask wt = MainHelper.PlatformSqlMap.GetOne<WF_WorkTask>(
                    "where WorkFlowId='" + workflowid + "'  and TaskCaption='" + obj.Status + "'");
                if (wt == null)
                {
                    continue;
                }
                WF_TableUsedField tuf = MainHelper.PlatformSqlMap.GetOne<WF_TableUsedField>("where FieldName='" + obj.CellName +
                    "'  and UserControlId='" + obj.ParentID + "'");
                if (tuf == null)
                {
                    WF_TableUsedField um = new WF_TableUsedField();
                    um.ID = um.CreateID();
                    um.UserControlId = obj.ParentID;
                    um.FieldName = obj.CellName;
                    um.FieldId = obj.LPID;
                    um.WorkflowId = workflowid;
                    um.WorktaskId = wt.WorkTaskId;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    MainHelper.PlatformSqlMap.Create<WF_TableUsedField>(um);
                }
                list.Add(obj);
            }
            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);


        }
コード例 #5
0
ファイル: ExportJTDJH.cs プロジェクト: s7loves/mypowerscgl
        public void ExportExceljhbAllSubmitToWF_ModleRecordWorkTaskIns(DateTime dt,DateTime dt2, string orgid)
        {

            string filter = "";
            int i = 0;
            if (orgid != "") filter = " and OrgCode='" + orgid + "'";
            string startday = "20";
            IList list = Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr",
                string.Format("select nr from pj_dyk where  dx='所月度停电计划' and sx like '%{0}%' and nr!=''", "申报截止日期"));
            if (list.Count > 0)
                startday = list[0].ToString();

            filter = " where (TDtime between '" + dt.Year + "-"
                + dt.Month + "-" + dt.Day
                + " 00:00:00' and  '"
                + dt2.Year + "-"
                + dt2.Month + "-" + dt2.Day + " 23:59:59' ) ";
             if (orgid != "") filter += " and OrgCode='" + orgid + "'";
            if (isWorkflowCall)
            {
                filter = filter + " and (id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowInsId='"
                    + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "') "
                        + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                    + "    RecordID='" + currRecord.ID + "')) "
                    ;
            }
            IList<PJ_tdjh> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_tdjh>(
                 filter
                 );
            List<WF_ModleRecordWorkTaskIns> mrwtlist = new List<WF_ModleRecordWorkTaskIns>();
            
            if (isWorkflowCall)
            {
                for (i = 0; i < datalist.Count; i++)
                {

                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ID = mrwt.CreateID();
                    mrwt.ModleRecordID = datalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.ModleTableName = datalist[i].GetType().ToString();
                    mrwt.CreatTime = DateTime.Now;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    mrwtlist.Add(mrwt);
                }
            }

           


                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                if (mrwtlist.Count > 0)
                {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, mrwtlist.ToArray());
                    list3.Add(obj3);
                }

                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            }
コード例 #6
0
        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 + "%')  ");
        }
コード例 #7
0
ファイル: ScglBDService.cs プロジェクト: s7loves/mypowerscgl
        public string UpdateGtOne(bd_sb data) {
            BD_SBTZ gt = Ebada.Client.ClientHelper.PlatformSqlMap.GetOneByKey<BD_SBTZ>(data.sbid);
            if (gt != null) {
               
                if (!string.IsNullOrEmpty(data.jsonData2)) {
                    Console.WriteLine("data.jsonData2;\r\n"+data.jsonData2);
                    List<bd_sbsxz> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<bd_sbsxz>>(data.jsonData2);
                    if (list != null) {
                        Type t = gt.GetType(); gt.sbname = data.sbmc;
                        foreach (var sx in list) {
                            t.GetProperty(sx.k).SetValue(gt, sx.v,null);
                        }
                        int n=Client.ClientHelper.PlatformSqlMap.Update<BD_SBTZ>(gt);
                        ncount += n>0?n:0;
                    }
                }
                if (!string.IsNullOrEmpty(data.jsonData)) {
                    Console.WriteLine("data.jsonData;\r\n" + data.jsonData);
                    List<ps_gtsb> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ps_gtsb>>(data.jsonData);
                    if (list != null) {
                        List<SqlQueryObject> sqllist = new List<SqlQueryObject>();
                        SqlQueryObject sqo = new SqlQueryObject(SqlQueryType.Delete, "Delete", "delete from bd_sbtz_fssb where gtid='" + gt.sb_id + "'");
                        sqllist.Add(sqo);
                        int num = 0;
                        foreach (ps_gtsb sb in list) {
                            num++;
                            bd_sbtz_fssb gtsb = new bd_sbtz_fssb() { gtID = gt.sb_id, sbModle = sb.xh, sbType = sb.zldm, sbNumber = short.Parse(sb.sl), sbName = sb.zl, sbCode = num.ToString("000") };
                            gtsb.sbID = gt.sb_id + num.ToString("000");
                            sqo = new SqlQueryObject(SqlQueryType.Insert, gtsb);
                            sqllist.Add(sqo);
                        }
                        Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(sqllist);
                    }
                    //Console.WriteLine(list != null ? list.Count : 0);
                }
                //Console.WriteLine("update {0} count {1}", gt.gtCode, n);
            }

            return "";
        }
コード例 #8
0
        public void ExportExceljhbAllSubmitToWF_ModleRecordWorkTaskIns(string orgid, string strProject, string strfenProject)
        {

            string filter = "";
            int i = 0;
            List<WF_ModleRecordWorkTaskIns> mrwtlist = new List<WF_ModleRecordWorkTaskIns>();
            string strfirst = "";
            string filter2 = "";
            string filter3 = "";
            string filter4 = "";
            if (strProject != "全部")
                filter2 = "  where 1=1 and ssgc='" + strProject + "'  and type = '撤旧材料出库单' ";
            else
                filter2 = "  where 1=1  and type = '撤旧材料出库单' ";

            IList mclist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct ssgc  from PJ_clcrkd " + filter2 + " order by ssgc");

            foreach (string mc in mclist)
            {
                if (strfenProject == "全部")
                    filter3 = "  where 1=1 and type = '撤旧材料出库单' ";
                else
                    filter3 = "  where  ssxm='" + strfenProject + "'  and type = '撤旧材料出库单' ";

                IList xmlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct ssxm  from PJ_clcrkd " + filter3 + " order by ssxm");
                foreach (string xm in xmlist)
                {
                    filter4 = "  where 1=1 and type = '撤旧材料出库单'"
                        + "  and ssgc='" + mc + "' "
                        + "  and ssxm='" + xm + "' ";
                    //IList sjlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct CONVERT(varchar(50) ,indate, 112 )  from PJ_clcrkd " + filter4 + " ");

                    IList sjlist = ClientHelper.PlatformSqlMap.GetList("SelectOneStr", "select distinct num  from PJ_clcrkd " + filter4 + " ");
                    foreach (string sj in sjlist)
                    {
                        filter = "  where 1=1 and type = '撤旧材料出库单'"
                        + "  and ssgc='" + mc + "' "
                        + "  and ssxm='" + xm
                        + "' and num= '" + sj + "' ";
                        if (isWorkflowCall)
                        {

                            filter = filter + " and id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowId='"
                                + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "') "
                                    + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                                + "    RecordID='" + currRecord.ID + "') "
                                ;
                        }

                        IList<PJ_clcrkd> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_clcrkd>(
                         filter
                           );
                        if (isWorkflowCall)
                        {
                            for (i = 0; i < datalist.Count; i++)
                            {
                                WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                                mrwt.ID = mrwt.CreateID();
                                mrwt.ModleRecordID = datalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                                mrwt.ModleTableName = datalist[i].GetType().ToString();
                                mrwt.CreatTime = DateTime.Now;
                                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                                mrwtlist.Add(mrwt);
                            }
                        }

                    }
                }

            }


            List<SqlQueryObject> list3 = new List<SqlQueryObject>();
            if (mrwtlist.Count > 0)
            {
                SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, mrwtlist.ToArray());
                list3.Add(obj3);
            }
            MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);





        }
コード例 #9
0
ファイル: UCtestRecord.cs プロジェクト: s7loves/mypowerscgl
        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 + "'  ");
        }
コード例 #10
0
        public bool Save() {
            bool flag = true;
            List<string> list = new List<string>();
            List<rRoleModul> list2 = new List<rRoleModul>();
            //List<string> wflist1 = new List<string>();
            List<WF_Operator> wflist2 = new List<WF_Operator>();

            this.getCheckList(this.treeList1.Nodes, list);
            foreach (string str in list) {
                rRoleModul function = new rRoleModul();
                function.RoleID = this.m_RoleID;
                function.Modu_ID = str;
                list2.Add(function);
                TreeListNode td = treeList1.FindNodeByKeyID(str);
                if (td["Description"].ToString () == "工作流")
                {
                    WF_WorkTask wt = MainHelper.PlatformSqlMap.GetOneByKey<WF_WorkTask>(str);
                    if (wt!= null)
                    {
                        mRole mrl = MainHelper.PlatformSqlMap.GetOneByKey<mRole>(RoleID);
                        WF_Operator wfop = new WF_Operator();
                        wfop.OperatorId = Guid.NewGuid().ToString(); 
                        wfop.OperContent = RoleID; 
                        wfop.Description = mrl.RoleName;
                        wfop.OperDisplay = mrl.RoleName;
                        wfop.WorkFlowId = wt.WorkFlowId;
                        wfop.WorkTaskId = wt.WorkTaskId;
                        wfop.OperType = 5;
                        wfop.InorExclude = true;
                        wflist2.Add(wfop);
                        
                    }
                    //wflist1.Add(" where WorkTaskId='" + str + "' and OperContent='" + RoleID + "'");
                }
            }



            SqlQueryObject item = new SqlQueryObject(SqlQueryType.Delete, "DeleterRoleModulByWhere", "where RoleID='" + this.m_RoleID + "'");
            SqlQueryObject item2 = new SqlQueryObject(SqlQueryType.Delete, "DeleteWF_OperatorInstanceByWhere", "where OperContent='" + this.m_RoleID + "'");


            SqlQueryObject wfitem = new SqlQueryObject(SqlQueryType.Delete, "DeleteWF_OperatorByWhere", "where OperContent='" + this.m_RoleID + "'");
           

            try {
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                list3.Add(item);
                list3.Add(item2);
                if (list2.Count>0)
                {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, list2.ToArray());
                    list3.Add(obj3);
                }
               

                list3.Add(wfitem);
                if (wflist2.Count > 0)
                {
                    SqlQueryObject wfobj3 = new SqlQueryObject(SqlQueryType.Insert, wflist2.ToArray());
                    list3.Add(wfobj3);
                }
                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            } catch (Exception exception) {
                MainHelper.ShowWarningMessageBox(exception.Message);
                flag = false;
            }
            return flag;
        }
コード例 #11
0
        private void IniWFData(string parentid)
        {
            List<mModule> list2 = new List<mModule>();
            IList<WF_WorkFlowClass> wfcli = MainHelper.PlatformSqlMap.GetList<WF_WorkFlowClass>("SelectWF_WorkFlowClassList", "where clLevel='0' order by Caption");
            foreach (WF_WorkFlowClass wfc in wfcli)
            {

                mModule md = new mModule();
                md.Modu_ID = wfc.WFClassId;
                md.ModuName = wfc.Caption;
                md.ParentID = parentid;
                md.ModuTypes = "hide";
                md.Description = "工作流";
                list2.Add(md); 
                IniWFTData(wfc.WFClassId,ref list2);
                ReWFData(wfc.WFClassId, ref list2);
                
            }
            SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Update, "InsertWFmModule", list2.ToArray());
            try
            {
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                
                list3.Add(obj3);
                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            }
            catch (Exception exception)
            {
                MainHelper.ShowWarningMessageBox(exception.Message);
               
            }
          

        }
コード例 #12
0
ファイル: UCmExcel.cs プロジェクト: s7loves/mypowerscgl
        void gridViewOperation_AfterDelete(LP_Temple obj)
        {
            string slqwhere = " where ParentID='" + obj.ParentID + "' ";

            slqwhere = slqwhere + " order by SortID";
            IList<LP_Temple> li = MainHelper.PlatformSqlMap.GetListByWhere<LP_Temple>(slqwhere);
            int i = 1;
            List<LP_Temple> list = new List<LP_Temple>();
            foreach (LP_Temple ob in li)
            {
                ob.SortID= i;
                if (ob.SignImg == null)
                {
                    ob.SignImg = new byte[0];
                }
                if (ob.ImageAttachment == null)
                {
                    ob.ImageAttachment = new byte[0];
                }
                if (ob.DocContent == null)
                {
                    ob.DocContent = new byte[0];
                }
                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);
            inidata();
        }
コード例 #13
0
ファイル: UCmExcel.cs プロジェクト: s7loves/mypowerscgl
        void gridViewOperation_BeforeInsert(object render, ObjectOperationEventArgs<LP_Temple> e) {
            //e.Value.Password = MainHelper.EncryptoPassword(e.Value.Password);
             string slqwhere = " where ParentID='" + e.Value.ParentID + "' and SortID =" + e.Value.SortID + " and lpid!='" + e.Value.LPID+"'";
            IList<LP_Temple> li = MainHelper.PlatformSqlMap.GetListByWhere<LP_Temple>(slqwhere);
            if (li.Count > 0)
            {
                //li[0].SortID = e.ValueOld.SortID;
                //if (li[0].DocContent == null)
                //{
                //    li[0].DocContent = bt;
                //}
                //if (li[0].ImageAttachment == null)
                //{
                //    li[0].ImageAttachment = bt;
                //}
                //if (li[0].SignImg == null)
                //{
                //    li[0].SignImg = bt;
                //}
                //MainHelper.PlatformSqlMap.Update<LP_Temple>(li[0]);
                slqwhere = " where ParentID='" + e.Value.ParentID + "' and SortID>=" + e.ValueOld.SortID + " and lpid!='" + e.Value.LPID + "'";

                slqwhere = slqwhere + " order by SortID";
                li = MainHelper.PlatformSqlMap.GetListByWhere<LP_Temple>(slqwhere);
                int i = 1;
                List<LP_Temple> list = new List<LP_Temple>();
                foreach (LP_Temple ob in li)
                {
                    ob.SortID = ob.SortID + 1;
                    if (ob.SignImg == null)
                    {
                        ob.SignImg = new byte[0];
                    }
                    if (ob.ImageAttachment == null)
                    {
                        ob.ImageAttachment = new byte[0];
                    }
                    if (ob.DocContent == null)
                    {
                        ob.DocContent = new byte[0];
                    }
                    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);
                }
            }
        }
コード例 #14
0
ファイル: UCBPBJJHB.cs プロジェクト: s7loves/mypowerscgl
        private void barCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            //请求确认
            if (MsgBox.ShowAskMessageBox("是否确认复制去年计划生成今年计划 ?") != DialogResult.OK) {
                return;
            }
            IList<PJ_bpbjjhb> bjlist = Client.ClientHelper.PlatformSqlMap.GetList<PJ_bpbjjhb>("where orgcode='" + btGdsList.EditValue + "' AND jhnf='" + DateTime.Now.Year + "'");
            List<PJ_bpbjjhb> list = new List<PJ_bpbjjhb>();
            foreach (PJ_bpbjjhb bj in bjlist) {
                bj.ID = bj.CreateID();
                bj.jhnf = (DateTime.Now.Year + 1).ToString();
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                list.Add(bj);
            }
            List<SqlQueryObject> list3 = new List<SqlQueryObject>();
            if (list.Count > 0) {
                SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, list.ToArray());
                list3.Add(obj3);
            }

            MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            RefreshData(" where OrgCode='" + parentID + "' ");
        }
コード例 #15
0
        void gridViewOperation_AfterDelete(PJ_18gysbpjmx obj) {

            if (isWorkflowCall) {

                MainHelper.PlatformSqlMap.DeleteByWhere<WF_ModleRecordWorkTaskIns>(" where ModleRecordID='" + obj.PJ_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() + "'");
            }
            IList<PJ_18gysbpjmx> list = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_18gysbpjmx>(" where PJ_ID='" + PSObj.PJ_ID + "' order by xh ");
            List<PJ_18gysbpjmx> list2 = new List<PJ_18gysbpjmx>();
            for (int i = 0; i < list.Count; i++) {
                list[i].xh = i;
            }
            list2.AddRange(list);
            try {
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();

                if (list.Count > 0) {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Update, list2.ToArray());
                    list3.Add(obj3);
                }

                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
                RefreshData(" where PJ_ID='" + PSObj.PJ_ID + "' order by xh ");

            } catch (Exception exception) {
                MainHelper.ShowWarningMessageBox(exception.Message);

            }
        }
コード例 #16
0
ファイル: UCPJ_03yxfx.cs プロジェクト: s7loves/mypowerscgl
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            InitColumns();//初始列
            InitData();//初始数据
            List<WF_Operator> wflist2 = new List<WF_Operator>();
            IList<WF_WorkFlow> list = MainHelper.PlatformSqlMap.GetList<WF_WorkFlow>("SelectWF_WorkFlowList", "where FlowCaption like '%分析%'");
            foreach (WF_WorkFlow wf in list)
            {
                IList<WF_WorkTask> list2 = MainHelper.PlatformSqlMap.GetList<WF_WorkTask>("SelectWF_WorkTaskList", "where WorkFlowId='" + wf.WorkFlowId + "' and  TaskTypeId!='2' order by TaskTypeId");
                foreach (WF_WorkTask wt in list2)
                {
                    WF_Operator wfop = (WF_Operator)MainHelper.PlatformSqlMap.GetObject("SelectWF_OperatorList", "where WorkFlowId='" + wt.WorkFlowId + "' and WorkTaskId='" + wt.WorkTaskId + "' and OperContent='all'");
                    if (wfop == null)
                    {
                        wfop = new WF_Operator();
                        wfop.OperatorId = Guid.NewGuid().ToString();
                        wfop.OperContent = "all";
                        wfop.Description = "所有人";
                        wfop.OperDisplay = "所有人";
                        wfop.WorkFlowId = wt.WorkFlowId;
                        wfop.WorkTaskId = wt.WorkTaskId;
                        wfop.OperType = 5;
                        wfop.InorExclude = true;
                        wflist2.Add(wfop);

                    }
                }
            
            }
            if (wflist2.Count > 0) 
            {
                 List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                 SqlQueryObject wfobj3 = new SqlQueryObject(SqlQueryType.Insert, wflist2.ToArray());
                    list3.Add(wfobj3);
                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            }
            if (this.Site != null) return;
            btGdsList.Edit = DicTypeHelper.GdsDic;
            btGdsList.EditValueChanged += new EventHandler(btGdsList_EditValueChanged);
            if (MainHelper.UserOrg != null && MainHelper.UserOrg.OrgType == "1")
            {//如果是供电所人员,则锁定
                btGdsList.EditValue = MainHelper.UserOrg.OrgCode;
                btGdsList.Edit.ReadOnly = true;
            }

        }
コード例 #17
0
ファイル: Export11.cs プロジェクト: s7loves/mypowerscgl
        public void ExportExceljhbAllSubmitToWF_ModleRecordWorkTaskIns(string orgid)
        {

            string filter = "";
            int i = 0;
            if (orgid != "") filter = " and OrgCode='" + orgid + "'";
            if (isWorkflowCall)
            {
                filter = filter + " and (id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                    + "    WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "') "
                    + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                    + "    RecordID='" + currRecord.ID + "')) "
                    ;
            }
            List<WF_ModleRecordWorkTaskIns> mrwtlist = new List<WF_ModleRecordWorkTaskIns>();
            IList<PJ_yfsyjl> byqdatalist = Client.ClientHelper.PlatformSqlMap.GetList<PJ_yfsyjl>("SelectPJ_yfsyjlList", " where  type='变压器'   and planExpTime like '%" + DateTime.Now.Year + "%' " + filter + " order by xh ");
            if (isWorkflowCall)
            {
                for (i = 0; i < byqdatalist.Count; i++)
                {

                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ID = mrwt.CreateID();
                    mrwt.ModleRecordID = byqdatalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.ModleTableName = byqdatalist[i].GetType().ToString();
                    mrwt.CreatTime = DateTime.Now;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    mrwtlist.Add(mrwt);
                }
            }

            byqdatalist = Client.ClientHelper.PlatformSqlMap.GetList<PJ_yfsyjl>("SelectPJ_yfsyjlList", " where  type='断路器'  and planExpTime like '%" + DateTime.Now.Year + "%' " + filter + " order by xh ");
            if (isWorkflowCall)
            {
                for (i = 0; i < byqdatalist.Count; i++)
                {

                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ID = mrwt.CreateID();
                    mrwt.ModleRecordID = byqdatalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.ModleTableName = byqdatalist[i].GetType().ToString();
                    mrwt.CreatTime = DateTime.Now;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    mrwtlist.Add(mrwt);
                }
            }


            byqdatalist = Client.ClientHelper.PlatformSqlMap.GetList<PJ_yfsyjl>("SelectPJ_yfsyjlList", " where  type='避雷器'  and planExpTime like '%" + DateTime.Now.Year + "%' " + filter + " order by xh ");
            if (isWorkflowCall)
            {
                for (i = 0; i < byqdatalist.Count; i++)
                {

                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ID = mrwt.CreateID();
                    mrwt.ModleRecordID = byqdatalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.ModleTableName = byqdatalist[i].GetType().ToString();
                    mrwt.CreatTime = DateTime.Now;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    mrwtlist.Add(mrwt);
                }
            }


            byqdatalist = Client.ClientHelper.PlatformSqlMap.GetList<PJ_yfsyjl>("SelectPJ_yfsyjlList", " where  type='电容器'  and planExpTime like '%" + DateTime.Now.Year + "%' " + filter + " order by xh ");
            if (isWorkflowCall)
            {
                for (i = 0; i < byqdatalist.Count; i++)
                {

                    WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                    mrwt.ID = mrwt.CreateID();
                    mrwt.ModleRecordID = byqdatalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    mrwt.ModleTableName = byqdatalist[i].GetType().ToString();
                    mrwt.CreatTime = DateTime.Now;
                    Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                    mrwtlist.Add(mrwt);
                }
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                if (mrwtlist.Count > 0)
                {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, mrwtlist.ToArray());
                    list3.Add(obj3);
                }

                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            }





        }
コード例 #18
0
ファイル: UCmOrgUserTree.cs プロジェクト: s7loves/mypowerscgl
        public bool Save() {
            bool flag = true;
            List<string> list = new List<string>();
            List<rUserRole> list2 = new List<rUserRole>();
            this.getCheckList(this.treeList1.Nodes, list);
            foreach (string str in list) {
                rUserRole function = new rUserRole();
                function.RoleID = this.m_RoleID;
                function.UserID = str;
                list2.Add(function);
            }



            SqlQueryObject item = new SqlQueryObject(SqlQueryType.Delete, "DeleterUserRoleByWhere", "where RoleID='" + this.m_RoleID + "'");
            
            try {
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                list3.Add(item);
                if (list2.Count>0)
                {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, list2.ToArray());
                    list3.Add(obj3);
                }
               
                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            } catch (Exception exception) {
                MainHelper.ShowWarningMessageBox(exception.Message);
                flag = false;
            }
            return flag;
        }
コード例 #19
0
 private void updateGjlist(string rwid, List<sbxj_gj> list) {
     List<sd_xsgj> gjlist = new List<sd_xsgj>();
     List<SqlQueryObject> sqllist = new List<SqlQueryObject>();
     int n = Client.ClientHelper.PlatformSqlMap.GetRowCount<sd_xsgj>(string.Format(" where rwid='{0}' and sj='{1}'", rwid, list[0].dt));
     SqlQueryObject sqo = null;
     if (n >0) {
         sqo = new SqlQueryObject(SqlQueryType.Delete, "Delete", "delete from sd_xsgj where rwID='" + rwid + "'");
         sqllist.Add(sqo);
     }
     foreach (sbxj_gj gj in list) {
         sqo = new SqlQueryObject(SqlQueryType.Insert, new sd_xsgj() {
             rwID = rwid, jd = gj.jd, wd = gj.wd, sj = DateTime.Parse(gj.dt)
         });
         sqllist.Add(sqo);
     }
     Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(gjlist.ToArray(), null, null);
     Console.WriteLine("{0},调用方法:{1},共插入{2}个巡视轨迹点。", DateTime.Now.ToString(), "updateGjlist", list.Count);
 }
コード例 #20
0
ファイル: GpsService.cs プロジェクト: s7loves/mypowerscgl
        public string UpdateGtOne(ps_gt data) {
            PS_gt gt = Ebada.Client.ClientHelper.PlatformSqlMap.GetOneByKey<PS_gt>(data.gtID);
            if (gt != null) {
                //foreach(FieldInfo fi in data.GetType().GetFields()){
                //    try {
                //        gt.GetType().GetProperty(fi.Name).SetValue(gt, fi.GetValue(data), null);
                //    } catch { }
                //}
                gt.gtType = data.gtType;
                gt.gtModle = data.gtModle;
                gt.gtElev = (int)decimal.Parse(data.gtElev);
                gt.gtLat = decimal.Parse(data.gtLat);
                gt.gtLon = decimal.Parse(data.gtLon);
                gt.gtHeight = decimal.Parse(data.gtHeight);
                gt.gtJg = data.gtSpan == "是" ? "是" : "否";//借杆
                if ((gt.gtLat + gt.gtLon) > 0) {
                    int n = Ebada.Client.ClientHelper.PlatformSqlMap.Update<PS_gt>(gt);
                    ncount += n;
                }
                if (data.jsonData != null) {
                    Console.WriteLine(data.jsonData);
                    List<ps_gtsb> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ps_gtsb>>(data.jsonData);
                    if (list != null) {
                        List<SqlQueryObject> sqllist = new List<SqlQueryObject>();
                        SqlQueryObject sqo = new SqlQueryObject(SqlQueryType.Delete, "Delete", "delete from ps_gtsb where gtid='" + gt.gtID + "'");
                        sqllist.Add(sqo);
                        int num = 0;
                        foreach (ps_gtsb sb in list) {
                            num++;
                            PS_gtsb gtsb = new PS_gtsb() { gtID = gt.gtID, sbModle = sb.xh, sbType = sb.zldm, sbNumber = short.Parse(sb.sl), sbName = sb.zl, sbCode = num.ToString("000") };
                            gtsb.sbID = gt.gtID + num.ToString("000");
                            sqo = new SqlQueryObject(SqlQueryType.Insert, gtsb);
                            sqllist.Add(sqo);
                        }
                        Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(sqllist);
                    }
                    //Console.WriteLine(list != null ? list.Count : 0);
                }
                //Console.WriteLine("update {0} count {1}", gt.gtCode, n);
            }

            return "";
        }
コード例 #21
0
ファイル: frmdykCopy.cs プロジェクト: s7loves/mypowerscgl
        void btnOK_Click(object sender, EventArgs e)
        {
            List<string> list = new List<string>();
            List<PJ_dyk> list2 = new List<PJ_dyk>();
            this.getCheckList(this.treeList1.Nodes, list);
            long xhidex = 0;
            IList<PJ_dyk> li = MainHelper.PlatformSqlMap.GetList<PJ_dyk>("SelectPJ_dykList", " where ParentID='" + parentObj.bh + "'  order by id desc");
            if (li.Count > 0)
                xhidex = (Convert.ToInt64(li[0].bh) + 1);
            else
            {
                xhidex = (Convert.ToInt64(parentObj.bh) * 100 + 1);
            }
            foreach (string str in list)
            {
                PJ_dyk dyk = new PJ_dyk();
                TreeListNode td = treeList1.FindNodeByKeyID(str);



                dyk.ID = Convert.ToString(xhidex);
                dyk.bh = dyk.ID;
                xhidex++;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                dyk.ParentID = parentObj.ID;
                dyk.dx = parentObj.dx;
                dyk.nr = td["nr"].ToString();
                dyk.sx = td["sx"].ToString();
                list2.Add(dyk);
            }
            try
            {
                List<SqlQueryObject> list3 = new List<SqlQueryObject>();
                if (list2.Count > 0)
                {
                    SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, list2.ToArray());
                    list3.Add(obj3);
                }

                MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            }
            catch (Exception exception)
            {
                MainHelper.ShowWarningMessageBox(exception.Message);
               
            }
            this.DialogResult = DialogResult.OK;
        }
コード例 #22
0
        public void ExportExceljhbAllSubmitToWF_ModleRecordWorkTaskIns(string orgid)
        {

            string filter = "";
            int i = 0;
          
            List<WF_ModleRecordWorkTaskIns> mrwtlist = new List<WF_ModleRecordWorkTaskIns>();
            
                filter = "  where 1=1 ";
                if (orgid != "") filter += " and OrgCode='" + orgid + "'";
                if (isWorkflowCall)
                {
                    filter = filter + " and id not in (select ModleRecordID from WF_ModleRecordWorkTaskIns where  WorkFlowId='"
                        + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "') "
                            + " or id in  (select ModleRecordID from WF_ModleRecordWorkTaskIns where "
                        + "    RecordID='" + currRecord.ID + "') ";
                }
                IList<PJ_sbbzqsbgmxb3> datalist = Client.ClientHelper.PlatformSqlMap.GetListByWhere<PJ_sbbzqsbgmxb3>(
                 filter
                   );
                if (isWorkflowCall)
                {
                    for (i = 0; i < datalist.Count; i++)
                    {
                        WF_ModleRecordWorkTaskIns mrwt = new WF_ModleRecordWorkTaskIns();
                        mrwt.ID = mrwt.CreateID();
                        mrwt.ModleRecordID = datalist[i].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.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        mrwt.ModleTableName = datalist[i].GetType().ToString();
                        mrwt.CreatTime = DateTime.Now;
                        Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                        mrwtlist.Add(mrwt);
                    }
                }
                
            
           
            List<SqlQueryObject> list3 = new List<SqlQueryObject>();
            if (mrwtlist.Count > 0)
            {
                SqlQueryObject obj3 = new SqlQueryObject(SqlQueryType.Insert, mrwtlist.ToArray());
                list3.Add(obj3);
            }
            MainHelper.PlatformSqlMap.ExecuteTransationUpdate(list3);
            



           
        }
コード例 #23
0
        private SqlConstantExpression EvaluateQueryPlan(SqlQueryObject obj)
        {
            if (context.QueryContext == null)
                throw new ExpressionEvaluateException("A query context is required to evaluate a query.");

            try {
                var plan = obj.QueryPlan;
                var result = plan.Evaluate(context.QueryContext);

                return SqlExpression.Constant(new DataObject(new TabularType(), SqlTabular.From(result)));
            } catch (ExpressionEvaluateException) {
                throw;
            } catch (Exception ex) {
                throw new ExpressionEvaluateException("Could not evaluate a query.", ex);
            }
        }