Example #1
0
        public string Node_CC(string userNo, string sid, string fk_flow, int fk_node, Int64 workID, string toEmpNos, string msgTitle, string msgDoc, string pFlowNo, Int64 pWorkID)
        {
            UserLogin(userNo);


            toEmpNos = toEmpNos.Replace(";", ",");
            toEmpNos = toEmpNos.Replace(";", ",");
            toEmpNos = toEmpNos.Replace(",", ",");

            string[] toEmps = toEmpNos.Split(',');
            string   strs   = "";

            foreach (string item in toEmps)
            {
                if (string.IsNullOrEmpty(item) == true)
                {
                    continue;
                }
                BP.Port.Emp emp = new BP.Port.Emp(item);
                strs += emp.Name + " ";

                BP.WF.Dev2Interface.Node_CC(fk_flow, fk_node, workID, emp.No, emp.Name, msgTitle, msgDoc, pFlowNo, pWorkID);
            }

            return("执行抄送成功,抄送给:" + strs);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type   = Request.QueryString["type"];
            string userNo = Request.QueryString["userNo"];
            string url    = "";

            if (string.IsNullOrEmpty(BP.Web.WebUser.No) || !BP.Web.WebUser.No.Equals(userNo))
            {
                BP.Port.Emp emp = new BP.Port.Emp(userNo);
                BP.Web.WebUser.SignInOfGener(emp);
            }

            switch (type)
            {
            case "start":
                url = "../AppDemoLigerUI/Start.aspx";
                break;

            case "empworks":
                url = "../AppDemoLigerUI/EmpWorks.aspx";

                break;

            case "empcc":
                url = "../AppDemoLigerUI/CC.aspx";
                break;

            case "runing":
                url = "../AppDemoLigerUI/Running.aspx";

                break;

            case "sharework":
                url = "../WF/TaskPoolSharing.aspx";
                break;

            case "batch":
                url = "../WF/Batch.aspx";
                break;

            case "designer":
                //url = "../WF/Admin/Xap/Designer.aspx?UserNo="+userNo;
                url = "../WF/Admin/Xap/Designer.aspx?UserNo=admin&SID=gaoling&s=ddd" + BP.Web.WebUser.SID;
                break;

            case "hungup":
                url = "../AppDemoLigerUI/HungUp.aspx";
                break;

            case "search":
                url = "../AppDemoLigerUI/keySearch.aspx";
                break;

            default:
                throw new Exception("传入的类型不正确!");
            }

            Response.Redirect(url, true);
            return;
        }
Example #3
0
        public string GetCompleateWork(string userNo, string[][] queryParams, int?page, int?pageSize)
        {
            UserLogin(userNo);

            string sql = string.Format("select * from WF_GenerWorkFlow  where WFState in({0}) and Emps like '%{1}%'", "'" + (int)BP.WF.WFState.Complete + "'", "@" + userNo);

            DataTable table = BP.DA.DBAccess.RunSQLReturnTable(sql);

            table.Columns.Add("TitleUrl");
            table.Columns.Add("FlowEmps");
            table.Columns.Add("FlowEnderRDT");
            string url = "";

            foreach (DataRow row in table.Rows)
            {
                url             = BP.Sys.SystemConfig.AppSettings["BaseUrl"] + "/WF/WFRpt.aspx?WorkID=" + row["WorkID"] + "&FK_Flow=" + row["FK_Flow"] + "&FK_Node=" + row["FK_Node"] + "&UserNo=" + userNo;
                row["TitleUrl"] = url;

                string emps = row["Emps"] + "";

                foreach (string single in emps.Split('@'))
                {
                    if (!string.IsNullOrEmpty(single))
                    {
                        try
                        {
                            row["FlowEmps"] += new BP.Port.Emp(single).Name + ";";
                        }
                        catch (Exception ex)
                        {
                            row["FlowEmps"] += single + ";";
                        }
                    }
                }

                BP.WF.Flow flow = new BP.WF.Flow(row["FK_Flow"] + "");

                BP.WF.Data.GERpt rpt = flow.HisGERpt;
                rpt.OID = Int64.Parse(row["WorkID"] + "");
                int count = rpt.RetrieveFromDBSources();
                if (count > 0)
                {
                    row["FlowEnderRDT"] = rpt.FlowEnderRDT;
                }
            }



            DataTable filterTable = FilterTable(queryParams, table);

            DataTable finalTable = PageTable(page, pageSize, table);


            string xml = WriteTableToXml(finalTable, filterTable.Rows.Count);


            return(xml);
        }
Example #4
0
        /// <summary>
        /// 测试案例说明:
        /// 1, . 这是一个标准的发送效率测试.
        /// 2, . 执行了createworkid 之后进行发送.
        /// </summary>
        public override void Do()
        {
            this.AddNote("开始执行发送.....");

            String userNo = "admin";

            BP.Port.Emp emp = new BP.Port.Emp(userNo);
            BP.Web.WebUser.SignInOfGener(emp);

            BP.WF.UnitTesting.TestAPI api = new BP.WF.UnitTesting.TestAPI();
            api.No   = "SendWork";
            api.Name = "标准的工作发送";
            api.Save();

            BP.WF.UnitTesting.TestVer apiVer = new BP.WF.UnitTesting.TestVer();
            apiVer.No   = "SendWork" + BP.DA.DataType.CurrentDataTime;
            apiVer.Name = "版本" + apiVer.No;

            try
            {
                //定义了10个样本. 对该过程执行10次。
                for (int idx = 0; idx < 5; idx++)
                {
                    DateTime startTime = System.DateTime.Now;
                    for (int i = 0; i <= 1000; i++)
                    {
                        long workid = BP.WF.Dev2Interface.Node_CreateBlankWork("230");
                        BP.WF.SendReturnObjs objs = BP.WF.Dev2Interface.Node_SendWork("230", workid, 0, "admin");
                    }
                    //doSomeThing();   //要运行的java程序
                    DateTime endTime = System.DateTime.Now;
                    TimeSpan ts      = endTime - startTime;

                    BP.WF.UnitTesting.TestSample dtl = new BP.WF.UnitTesting.TestSample();
                    dtl.MyPK   = BP.DA.DBAccess.GenerGUID();
                    dtl.FK_API = api.No;
                    dtl.FK_Ver = apiVer.No;
                    dtl.DTFrom = startTime.ToShortTimeString();
                    dtl.DTTo   = endTime.ToShortTimeString();
                    dtl.Name   = api.Name + "-" + apiVer.Name;

                    dtl.TimeUse        = ts.TotalMilliseconds;
                    dtl.TimesPerSecond = ts.TotalMilliseconds / 1000;
                    dtl.Insert();
                }

                apiVer.Insert(); //执行成功后,版本号在插入里面.
            }
            catch (Exception ex)
            {
                BP.WF.UnitTesting.TestSample dtl = new BP.WF.UnitTesting.TestSample();
                dtl.Delete(BP.WF.UnitTesting.TestSampleAttr.FK_Ver, apiVer.No);
                throw ex;
            }

            this.AddNote("查看数据: <a href=''></a>");
        }
 public string Port_Login(string userNo, string pass)
 {
     BP.Port.Emp emp = new BP.Port.Emp(userNo);
     if (emp.CheckPass(pass) == false)
     {
         return(null);
     }
     return(BP.WF.Dev2Interface.Port_Login(userNo));
 }
Example #6
0
        void btn_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;

            if (btn.ID == "Btn_Cancel")
            {
                this.Response.Redirect("../MyFlow.aspx?FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node + "&WorkID=" + this.WorkID + "&FID=" + this.FID, true);
                return;
            }

            Int64  workid  = Int64.Parse(this.Request.QueryString["WorkID"]);
            int    fk_node = int.Parse(this.Request.QueryString["FK_Node"]);
            string askFor  = (Pub2.FindControl("HID_SelectedEmps") as HiddenField).Value; // this.Pub2.GetTextBoxByID("TB_Worker").Text;
            //string askFor = this.Pub2.GetTextBoxByID("TB_Worker").Text;
            string note = this.Pub2.GetTextBoxByID("TB_Note").Text;

            BP.Port.Emp emp = new BP.Port.Emp();
            emp.No = askFor;
            bool i = emp.RetrieveByAttrOr(BP.Port.EmpAttr.No, askFor, BP.Port.EmpAttr.Name, askFor);

            if (i == false)
            {
                this.Alert("输入的加签人(" + askFor + ")不正确,加签人只能选择一个。");
                return;
            }

            if (emp.No == WebUser.No)
            {
                this.Alert("不能让自己加签。");
                return;
            }

            BP.WF.AskforHelpSta sta = BP.WF.AskforHelpSta.AfterDealSend;
            bool is1 = this.Pub2.GetRadioButtonByID("RB_0").Checked;

            if (is1)
            {
                sta = BP.WF.AskforHelpSta.AfterDealSend;
            }

            is1 = this.Pub2.GetRadioButtonByID("RB_1").Checked;
            if (is1)
            {
                sta = BP.WF.AskforHelpSta.AfterDealSendByWorker;
            }

            try
            {
                string info = BP.WF.Dev2Interface.Node_Askfor(workid, sta, askFor, note);
                this.ToMsg(info, "Info");
            }
            catch (Exception ex)
            {
                this.Pub2.AddMsgOfWarning("err", ex.Message);
            }
        }
Example #7
0
        public bool SetNextNodeFH(string flowid, Int64 workid, int nodeid, string emps, int fid)
        {
            try
            {
                BP.WF.Nodes nodes  = BP.WF.Dev2Interface.WorkOpt_GetToNodes(flowid, nodeid, workid, fid);
                int         nodeID = 0;

                foreach (BP.WF.Node node in nodes)
                {
                    nodeID = node.NodeID;
                    break;
                }

                string[] empData = emps.Split(',');

                foreach (string emp in empData)
                {
                    Compeader.Data.Comleader_NodeWork nodeWork = new Compeader.Data.Comleader_NodeWork();

                    string[] empAndTag = emp.Split('@');

                    string userName = "";
                    string tag      = "";
                    string userNo   = "";
                    if (empAndTag.Length >= 2)
                    {
                        tag    = empAndTag[1];
                        userNo = empAndTag[0];

                        try
                        {
                            BP.Port.Emp empSingle = new BP.Port.Emp(userNo);
                            userName = empSingle.Name;
                        }
                        catch (Exception ex)
                        {
                            continue;
                        }
                    }
                    nodeWork.MyPk     = Guid.NewGuid().ToString("N");
                    nodeWork.OID      = workid;
                    nodeWork.NodeID   = nodeid;
                    nodeWork.UserNo   = userNo;
                    nodeWork.Tag      = tag;
                    nodeWork.UserName = userName;
                    nodeWork.Insert();
                }

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Example #8
0
        public string SetSubInc(string userNo)
        {
            //检查是否有该用户.
            BP.Port.Emp emp = new BP.Port.Emp();
            emp.No = userNo;
            if (emp.RetrieveFromDBSources() == 0)
            {
                return("err@用户编号错误:" + userNo);
            }

            AdminEmp ad = new AdminEmp();

            ad.No = userNo + "@" + this.No;
            if (ad.RetrieveFromDBSources() == 1)
            {
                return("err@该用户已经是该公司的管理员了.");
            }

            ad.Copy(emp);
            ad.No         = userNo + "@" + this.No; //增加一个影子版本.
            ad.RootOfDept = this.No;
            ad.RootOfFlow = "Inc" + this.No;
            ad.RootOfForm = "Inc" + this.No;
            ad.UserType   = 1;
            ad.UseSta     = 1;
            ad.Insert();

            //设置二级管理员.
            ad.No = userNo;
            if (ad.RetrieveFromDBSources() == 0)
            {
                ad.Copy(emp);
                ad.RootOfDept = this.No;
                ad.RootOfFlow = "Inc" + this.No;
                ad.RootOfForm = "Inc" + this.No;
                ad.UserType   = 1;
                ad.UseSta     = 1;
                ad.Insert();
            }
            else
            {
                ad.RootOfDept = this.No;
                ad.RootOfFlow = "Inc" + this.No;
                ad.RootOfForm = "Inc" + this.No;
                ad.UserType   = 1;
                ad.UseSta     = 1;
                ad.Update();
            }

            //初始化表单树,流程树.
            InitFlowSortTree();

            return("设置成功,[" + ad.No + "," + ad.Name + "]重新登录就可以看到.");
        }
Example #9
0
        public void BatchReNameByDeptPinYin()
        {
            string    sql = "SELECT * FROM Port_Emp"; //要重命名的范围.
            DataTable dt  = BP.DA.DBAccess.RunSQLReturnTable(sql);

            foreach (DataRow dr in dt.Rows)
            {
                BP.Port.Emp emp      = new BP.Port.Emp(dr["No"].ToString());
                string      deptName = BP.DA.DataType.ParseStringToPinyin(emp.FK_DeptText);

                string isExit = "SELECT * FROM port_emp where no='" + deptName + "'";
                if (DBAccess.RunSQLReturnTable(isExit).Rows.Count > 0)
                {
                    continue;
                }

                sql = "UPDATE Port_Emp Set No='" + deptName + "' where no='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);

                sql = "UPDATE WF_Emp Set No='" + deptName + "' where no='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);


                sql = "UPDATE Port_EmpStation Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);

                sql = "UPDATE Port_EmpDept Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);

                sql = "UPDATE WF_NodeEmp Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);



                sql = "UPDATE GPM_ByEmp Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);


                sql = "UPDATE GPM_EmpApp Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);


                sql = "UPDATE GPM_EmpMenu Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);


                sql = "UPDATE GPM_GroupEmp Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);

                sql = "UPDATE GPM_UserMenu Set FK_Emp='" + deptName + "' WHERE FK_Emp='" + emp.No + "'";
                BP.DA.DBAccess.RunSQL(sql);
            }
        }
Example #10
0
        void btn_Click(object sender, EventArgs e)
        {
            string lang = "CH";

            // 首先安装GPM.
            BP.GPM.Glo.DoInstallDataBase(lang, "Inc");

            //是否要安装demo.
            bool isDemo = this.Pub1.GetRadioButtonByID("RB_DemoOn").Checked;

            if (BP.WF.Glo.OSModel == BP.WF.OSModel.BPM)
            {
                //运行GPM的安装
                BP.GPM.Glo.DoInstallDataBase(lang, "Inc");
            }

            //运行ccflow的安装
            BP.WF.Glo.DoInstallDataBase(lang, isDemo);

            //安装CCIM
            if (this.Pub1.GetRadioButtonByID("RB_CCIM_Y").Checked)
            {
                BP.WF.Glo.DoInstallCCIM();
            }

            //加注释.
            BP.Sys.PubClass.AddComment();

            // 装载演示数据.
            if (this.Pub1.GetRadioButtonByID("RB_DemoOn").Checked)
            {
                BP.Port.Emp emp = new BP.Port.Emp("admin");
                BP.Web.WebUser.SignInOfGener(emp);

                //装载数据模版.
                BP.WF.DTS.LoadTemplete l = new BP.WF.DTS.LoadTemplete();
                string msg = l.Do() as string;
            }

            try
            {
                //增加图片签名
                BP.WF.DTS.GenerSiganture gs = new BP.WF.DTS.GenerSiganture();
                gs.Do();
            }
            catch
            {
            }
            this.Response.Redirect("DBInstall.aspx?DoType=OK", true);
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string[] emps = this.IDs.Split(',');
            this.Pub1.AddTable();
            this.Pub1.AddCaption("流程模拟自动运行");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("IDX");
            this.Pub1.AddTDTitle("模拟执行人员");
            this.Pub1.AddTDTitle("参数(可以为空)");
            this.Pub1.AddTREnd();

            int idx = 0;

            foreach (string empStr in emps)
            {
                if (string.IsNullOrEmpty(empStr))
                {
                    continue;
                }

                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);

                BP.Port.Emp emp = new BP.Port.Emp(empStr);
                CheckBox    cb  = new CheckBox();
                cb.Text    = emp.No + "-" + emp.Name;
                cb.Checked = true;
                cb.ID      = "CB_" + emp.No;
                this.Pub1.AddTD(cb);

                TextBox tb = new TextBox();
                tb.ID    = "TB_" + emp.No;
                tb.Width = 300;
                this.Pub1.AddTD(tb);
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();

            this.Pub1.Add("格式为: @Para1=Value1@Para2=Value2)比如:@QingJiaTianShu=20");

            Button btn = new Button();

            btn.ID     = "ss";
            btn.Text   = "执行";
            btn.Click += new EventHandler(btn_Click);
            this.Pub1.Add(btn);
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 检查是否是安装了ccflow如果没有就让其安装.
            if (BP.DA.DBAccess.IsExitsObject("WF_Emp") == false)
            {
                this.Response.Redirect("../DBInstall.aspx", true);
                return;
            }
            #endregion 检查是否是安装了ccflow如果没有就让其安装.

            if (this.Request.QueryString["DoType"] == "Logout")
            {
                //退出.
                BP.WF.Dev2Interface.Port_SigOut();
            }

            if (this.Request.QueryString["DoType"] == "Login")
            {
                string user = TB_UserName.Value.Trim();
                string pass = TB_Password.Value.Trim();
                try
                {
                    if (WebUser.No != null)
                    {
                        BP.WF.Dev2Interface.Port_SigOut();
                    }

                    BP.Port.Emp em = new BP.Port.Emp(user);
                    if (em.CheckPass(pass))
                    {
                        BP.WF.Dev2Interface.Port_Login(user);
                        WebUser.Token = this.Session.SessionID;
                        this.Response.Redirect("Default.aspx?SID=" + this.Session.SessionID, false);
                        return;
                    }
                    else
                    {
                        BP.Sys.PubClass.Alert("用户名密码错误,注意密码区分大小写,请检查是否按下了CapsLock.。");
                    }
                }
                catch (System.Exception ex)
                {
                    BP.Sys.PubClass.Alert("用户名密码错误,注意密码区分大小写,请检查是否按下了CapsLock.。");

                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "kesy", "<script language=JavaScript>alert('@用户名密码错误!@检查是否按下了CapsLock.@更详细的信息:" + ex.Message + "');</script>");
                }
            }
        }
Example #13
0
 public string LetAdminLogin(string lang, bool islogin)
 {
     try
     {
         if (islogin)
         {
             BP.Port.Emp emp = new BP.Port.Emp("admin");
             WebUser.SignInOfGener(emp, lang, "admin", true, false);
         }
     }
     catch (Exception exception)
     {
         return(exception.Message);
     }
     return(string.Empty);
 }
Example #14
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <returns></returns>
        private string GetWebUserInfo()
        {
            try
            {
                if (WebUser.No == null)
                {
                    return(Newtonsoft.Json.JsonConvert.SerializeObject(new { success = false, msg = "当前用户没有登录,请登录后再试。", data = new { } }));
                }
                BP.Port.Emp emp = new BP.Port.Emp(WebUser.No);

                return(Newtonsoft.Json.JsonConvert.SerializeObject(new { success = true, msg = string.Empty, data = new { No = emp.No, Name = emp.Name, FK_Dept = emp.FK_Dept, SID = emp.SID } }));
            }
            catch (Exception ex)
            {
                return(Newtonsoft.Json.JsonConvert.SerializeObject(new { success = false, msg = ex.Message, data = new { } }));
            }
        }
Example #15
0
        public static void LoadConfigByFile()
        {
            //BP.WF.Glo.IntallPath = PathOfVisualFlow;
            BP.SystemConfig.IsBSsystem_Test = false;
            BP.SystemConfig.IsBSsystem      = false;
            SystemConfig.IsBSsystem         = false;

            string path = PathOfVisualFlow + "\\web.config"; //如果有这个文件就装载它。

            if (System.IO.File.Exists(path) == false)
            {
                MessageBox.Show("配置文件没有找到:" + path);
                return;
                //throw new Exception("配置文件没有找到:" + path);
            }

            BP.DA.ClassFactory.LoadConfig(path);
            try
            {
                try
                {
                    BP.Port.Emp em = new BP.Port.Emp("admin");
                }
                catch
                {
                    BP.Port.Emp em = new BP.Port.Emp("admin");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("连接数据库出现异常:" + ex.Message);
                return;
            }

            SystemConfig.IsBSsystem_Test = false;
            SystemConfig.IsBSsystem      = false;
            SystemConfig.IsBSsystem      = false;
            //   BP.Win.WF.Global.FlowImagePath = BP.WF.Global.PathOfVisualFlow + "\\Data\\FlowDesc\\";
            BP.Web.WebUser.SysLang = "CH";

            BP.SystemConfig.IsBSsystem_Test = false;
            BP.SystemConfig.IsBSsystem      = false;
            SystemConfig.IsBSsystem         = false;
        }
Example #16
0
        public bool SetNextCC(Int64 workid, int nodeid, string emps)
        {
            try
            {
                Compeader.Data.Comleader_CCList cclist = new Compeader.Data.Comleader_CCList();

                cclist.CheckPhysicsTable();

                cclist.OID    = workid;
                cclist.NodeID = nodeid;
                int i = cclist.RetrieveFromDBSources();
                if (i > 0)
                {
                    cclist.DirectDelete();
                }

                foreach (string emp in emps.Split(','))
                {
                    try
                    {
                        if (!string.IsNullOrEmpty(emp))
                        {
                            BP.Port.Emp empSingle = new BP.Port.Emp(emp);
                            cclist.OID      = workid;
                            cclist.NodeID   = nodeid;
                            cclist.UserNo   = empSingle.No;
                            cclist.UserName = empSingle.Name;
                            cclist.MyPk     = Guid.NewGuid().ToString("N");
                            cclist.DirectInsert();
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region 执行功能.
            switch (this.DoType)
            {
            case "Del":
                BP.Port.Emp en = new BP.Port.Emp();
                en.No = this.RefNo;
                //en.Delete();
                break;

            default:
                break;
            }
            #endregion 执行功能.

            this.Pub1.AddTable("width=100%");
            this.Pub1.AddCaption("操作员列表");
            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("序");
            this.Pub1.AddTDTitle("编号");
            this.Pub1.AddTDTitle("名称");
            this.Pub1.AddTDTitle("部门");
            this.Pub1.AddTDTitle("操作");
            this.Pub1.AddTREnd();

            BP.Port.Emps ens = new BP.Port.Emps();
            ens.RetrieveAllFromDBSource();
            int idx = 0;
            foreach (BP.Port.Emp en in ens)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(idx);
                this.Pub1.AddTD(en.No);
                this.Pub1.AddTD(en.Name);
                this.Pub1.AddTD(en.FK_DeptText);
                this.Pub1.AddTD("<a href=\"javascript:Del('" + en.No + "')\" ><img src='/WF/Img/Btn/Delete.gif' border=0/>操作</a>");
                this.Pub1.AddTREnd();
            }
            this.Pub1.AddTableEnd();
        }
Example #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.Request.Browser.Cookies == false)
            {
                //this.Response.Write("您的浏览器不支持cookies功能,无法使用该系统。");
                //return;
            }

            if (this.PassKey != BP.Sys.SystemConfig.AppSettings["PassKey"])
            {
                return;
            }

            //if (this.Lang == null || this.Lang == "")
            //    throw new Exception("语言编号错误。");

            //   BP.Sys.SystemConfig.DoClearCash();
            BP.Port.Emp emp = new BP.Port.Emp("admin");
            BP.Web.WebUser.SignInOfGenerLang(emp, "CH");

            string fk_flow = this.Request.QueryString["FK_Flow"];
            string fk_Node = this.Request.QueryString["FK_Node"];

            string FK_MapData = this.Request.QueryString["FK_MapData"];

            if (string.IsNullOrEmpty(FK_MapData))
            {
                FK_MapData = this.Request.QueryString["PK"];
            }

            switch (this.DoType)
            {
            case "DownFormTemplete":
                DataSet        ds   = BP.Sys.MapData.GenerHisDataSet(FK_MapData);
                BP.Sys.MapData md   = new BP.Sys.MapData(FK_MapData);
                string         file = BP.Sys.SystemConfig.PathOfTemp + md.No + ".xml";
                ds.WriteXml(file);
                System.IO.FileInfo f = new System.IO.FileInfo(file);
                BP.Sys.PubClass.DownloadFile(f.FullName, md.Name + ".xml");
                this.Pub1.AddFieldSet("下载提示");

                string url = "../../../Temp/" + md.No + ".xml";
                this.Pub1.AddH2("ccflow 已经完成模板的生成了,正在执行下载如果您的浏览器没有反应请<a href='" + url + "' >点这里进行下载</a>。");
                this.Pub1.Add("如果该xml文件是在ie里直接打开的,请把鼠标放在连接上右键目标另存为,保存该模板。");
                this.Pub1.AddFieldSetEnd();
                return;

            case "Ens":     // 实体编辑.
                this.Response.Redirect("../../Comm/Batch.aspx?EnsName=" + this.EnsName, true);
                break;

            case "En":     // 单个实体编辑.
                switch (this.EnName)
                {
                case "BP.WF.Flow":
                    Flow fl = new Flow(this.PK);
                    if (fl.FlowAppType == FlowAppType.DocFlow)
                    {
                        this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.FlowDocs&No=" + this.PK, true);
                    }
                    else
                    {
                        this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.FlowSheets&No=" + this.PK, true);
                    }
                    return;

                case "BP.WF.Template.FlowSheet":
                case "BP.WF.Template.Ext.FlowSheet":
                    this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.FlowSheets&No=" + this.PK, true);
                    return;

                case "BP.WF.Template.Ext.NodeExts":
                    this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.NodeExts&No=" + this.PK, true);
                    return;

                case "BP.WF.Node":
                    Node nd = new Node(this.PK);
                    this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.NodeSheets&PK=" + this.PK, true);
                    return;

                case "BP.WF.Template.FlowExt":
                    this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.FlowExts&PK=" + this.PK, true);
                    return;

                case "BP.WF.Template.NodeExt":
                    this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.NodeExts&PK=" + this.PK, true);
                    return;

                case "BP.WF.Template.FlowSort":
                    this.Response.Redirect("../../Comm/RefFunc/UIEn.aspx?EnsName=BP.WF.Template.FlowSorts&PK=" + this.PK, true);
                    return;

                default:
                    throw new Exception("err");
                    //this.Response.Redirect("./Comm/RefFunc/UIEn.aspx?EnsName=" + this.EnsName + "&No=" + this.PK, true);
                }

            case "FrmLib":     //"表单库"
                this.Response.Redirect("../BindFrms.aspx?ShowType=SelectedFrm&FK_Flow=" + fk_flow + "&FK_Node=" + fk_Node + "&Lang=" + BP.Web.WebUser.SysLang, true);
                break;

            case "FlowFrms":     //"独立表单"
                this.Response.Redirect("../BindFrms.aspx?ShowType=FlowFrms&FK_Flow=" + fk_flow + "&FK_Node=" + fk_Node + "&Lang=" + BP.Web.WebUser.SysLang, true);
                break;

            case "StaDef":     // 节点岗位.
                this.Response.Redirect("../../Comm/RefFunc/Dot2Dot.aspx?EnName=BP.WF.Template.NodeSheet&AttrKey=BP.WF.Template.NodeStations&PK=" + this.PK + "&NodeID=" + this.PK + "&RunModel=0&FLRole=0&FJOpen=0&r=" + this.PK, true);
                break;

            case "StaDefNew":     // 新版本.. http://localhost:13432/WF/Comm/RefFunc/Dot2DotSingle.aspx
                this.Response.Redirect("../../Comm/RefFunc/Dot2DotSingle.aspx?EnsName=BP.WF.Template.NodeSheets&EnName=BP.WF.Template.NodeSheet&AttrKey=BP.WF.Template.NodeStations&NodeID=" + this.PK + "&r=0319061642&1=FK_StationType&ShowWay=None" + this.PK, true);
                break;

            case "WFRpt":     // 报表设计.r
                this.Response.Redirect("../../Rpt/OneFlow.aspx?FK_MapData=ND" + int.Parse(this.PK) + "Rpt&FK_Flow=" + this.PK, true);
                break;

            case "MapDef":     //表单定义.
                int  nodeid = int.Parse(this.PK.Replace("ND", ""));
                Node nd1    = new Node();
                nd1.NodeID = nodeid;
                nd1.RetrieveFromDBSources();
                if (nd1.HisFormType == NodeFormType.FreeForm)
                {
                    this.Response.Redirect("../../MapDef/CCForm/Frm.aspx?FK_MapData=" + this.PK + "&FK_Flow=" + nd1.FK_Flow + "&FK_Node=" + this.FK_Node, true);
                }
                else
                {
                    this.Response.Redirect("../../MapDef/MapDef.aspx?PK=" + this.PK + "&FK_Flow=" + nd1.FK_Flow + "&FK_Node=" + this.FK_Node, true);
                }
                break;

            case "MapDefFixModel":     // 表单定义.
            case "FormFixModel":
                this.Response.Redirect("../../MapDef/MapDef.aspx?FK_MapData=" + FK_MapData + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node, true);
                break;

            case "MapDefFreeModel":     // 表单定义.
            case "FormFreeModel":
                this.Response.Redirect("../../MapDef/CCForm/Frm.aspx?FK_MapData=" + FK_MapData + "&FK_Flow=" + this.FK_Flow + "&FK_Node=" + this.FK_Node, true);
                break;

            case "MapDefFree":     //表单定义.
                int  nodeidFree = int.Parse(this.PK.Replace("ND", ""));
                Node ndFree     = new Node(nodeidFree);
                this.Response.Redirect("../MapDef/CCForm/Frm.aspx?FK_MapData=" + this.PK + "&FK_Flow=" + ndFree.FK_Flow + "&FK_Node=" + ndFree.NodeID, true);
                break;

            case "MapDefF4":     //表单定义.
                int  nodeidF4 = int.Parse(this.PK.Replace("ND", ""));
                Node ndF4     = new Node(nodeidF4);
                this.Response.Redirect("../../MapDef/MapDef.aspx?PK=" + this.PK + "&FK_Flow=" + ndF4.FK_Flow + "&FK_Node=" + nodeidF4, true);
                break;

            case "Dir":     // 方向。
                this.Response.Redirect("../Admin/ConditionLine.aspx?CondType=" + this.Request.QueryString["CondType"] + "&FK_Flow=" + this.Request.QueryString["FK_Flow"] + "&FK_MainNode=" + this.Request.QueryString["FK_MainNode"] + "&FK_Node=" + this.Request.QueryString["FK_Node"] + "&FK_Attr=" + this.Request.QueryString["FK_Attr"] + "&DirType=" + this.Request.QueryString["DirType"] + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                break;

            case "RunFlow":     //运行流程
                this.Response.Redirect("../Admin/StartFlow.aspx?FK_Flow=" + fk_flow + "&Lang=" + BP.Web.WebUser.SysLang, true);
                break;

            case "FlowCheck":     // 流程设计
                this.Response.Redirect("../Admin/DoType.aspx?RefNo=" + this.Request.QueryString["RefNo"] + "&DoType=" + this.DoType, true);
                break;

            case "ExpFlowTemplete":     //流程设计.
                Flow   flow    = new Flow(FK_Flow);
                string fileXml = flow.GenerFlowXmlTemplete();

                BP.Sys.PubClass.DownloadFile(fileXml, flow.Name + ".xml");
                BP.Sys.PubClass.WinClose();
                break;

            case "UploadShare":
                upload();
                break;

            case "ShareToFtp":
                // BP.Web.Common.ShareToFtp();
                break;

            default:
                throw new Exception("Error:" + this.DoType);
            }
        }
Example #19
0
        /// <summary>
        /// 用户登陆
        /// </summary>
        private static void UserLogin(string userNo)
        {
            var emp = new BP.Port.Emp(userNo);

            BP.Web.WebUser.SignInOfGener(emp);
        }
Example #20
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Response.AddHeader("P3P", "CP=CAO PSA OUR");
            Response.AddHeader("Cache-Control", "no-store");
            Response.AddHeader("Expires", "0");
            Response.AddHeader("Pragma", "no-cache");
            string url = this.Request.RawUrl;

            if (url.Contains("DTT=") == false)
            {
                //this.Response.Redirect(url + "&DTT=" + DateTime.Now.ToString("mmDDhhmmss"), true);
                //return;
            }

            try
            {
                switch (this.ActionType)
                {
                case "Focus":     //把任务放入任务池.
                    BP.WF.Dev2Interface.Flow_Focus(Int64.Parse(this.Request.QueryString["WorkID"]));
                    this.WinClose("ss");
                    break;

                case "PutOne":     //把任务放入任务池.
                    Int64 workid42 = Int64.Parse(this.Request.QueryString["WorkID"]);
                    BP.WF.Dev2Interface.Node_TaskPoolPutOne(workid42);
                    this.WinClose("ss");
                    break;

                case "DoAppTask":     // 申请任务.
                    Int64 workid2 = Int64.Parse(this.Request.QueryString["WorkID"]);
                    BP.WF.Dev2Interface.Node_TaskPoolTakebackOne(workid2);
                    this.WinClose("ss");
                    return;

                case "DoOpenCC":
                    string fk_flow1 = this.Request.QueryString["FK_Flow"];
                    string fk_node1 = this.Request.QueryString["FK_Node"];
                    string workid1  = this.Request.QueryString["WorkID"];
                    string fid1     = this.Request.QueryString["FID"];
                    string Sta      = this.Request.QueryString["Sta"];
                    if (Sta == "0")
                    {
                        BP.WF.Template.CCList cc1 = new BP.WF.Template.CCList();
                        cc1.MyPK = this.Request.QueryString["MyPK"];
                        cc1.Retrieve();
                        cc1.HisSta = CCSta.Read;
                        cc1.Update();
                    }
                    this.Response.Redirect("./WorkOpt/OneWork/Track.aspx?FK_Flow=" + fk_flow1 + "&FK_Node=" + fk_node1 + "&WorkID=" + workid1 + "&FID=" + fid1, false);
                    return;

                case "DelCC":     //删除抄送.
                    CCList cc = new CCList();
                    cc.MyPK = this.MyPK;
                    cc.Retrieve();
                    cc.HisSta = CCSta.Del;
                    cc.Update();
                    this.WinClose();
                    break;

                case "DelSubFlow":     //删除进程。
                    try
                    {
                        BP.WF.Dev2Interface.Flow_DeleteSubThread(this.FK_Flow, this.WorkID, "手工删除");
                        this.WinClose();
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                    }
                    break;

                case "DownBill":
                    Bill b = new Bill(this.MyPK);
                    b.DoOpen();
                    break;

                case "DelDtl":
                    GEDtls dtls = new GEDtls(this.EnsName);
                    GEDtl  dtl  = (GEDtl)dtls.GetNewEntity;
                    dtl.OID = this.RefOID;
                    if (dtl.RetrieveFromDBSources() == 0)
                    {
                        this.WinClose();
                        break;
                    }
                    FrmEvents fes = new FrmEvents(this.EnsName);     //获得事件.

                    // 处理删除前事件.
                    try
                    {
                        fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelBefore, dtl);
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                        break;
                    }
                    dtl.Delete();

                    // 处理删除后事件.
                    try
                    {
                        fes.DoEventNode(BP.WF.XML.EventListDtlList.DtlItemDelAfter, dtl);
                    }
                    catch (Exception ex)
                    {
                        this.WinCloseWithMsg(ex.Message);
                        break;
                    }
                    this.WinClose();
                    break;

                case "EmpDoUp":
                    BP.WF.Port.WFEmp ep = new BP.WF.Port.WFEmp(this.RefNo);
                    ep.DoUp();

                    BP.WF.Port.WFEmps emps111 = new BP.WF.Port.WFEmps();
                    //  emps111.RemoveCash();
                    emps111.RetrieveAll();
                    this.WinClose();
                    break;

                case "EmpDoDown":
                    BP.WF.Port.WFEmp ep1 = new BP.WF.Port.WFEmp(this.RefNo);
                    ep1.DoDown();

                    BP.WF.Port.WFEmps emps11441 = new BP.WF.Port.WFEmps();
                    //  emps11441.RemoveCash();
                    emps11441.RetrieveAll();
                    this.WinClose();
                    break;

                case "Track":     //通过一个串来打开一个工作.
                    string   mySid  = this.Request.QueryString["SID"];
                    string[] mystrs = mySid.Split('_');

                    Int64  myWorkID = int.Parse(mystrs[1]);
                    string fk_emp   = mystrs[0];
                    int    fk_node  = int.Parse(mystrs[2]);
                    Node   mynd     = new Node();
                    mynd.NodeID = fk_node;
                    mynd.RetrieveFromDBSources();

                    string fk_flow = mynd.FK_Flow;
                    string myurl   = "./WorkOpt/OneWork/Track.aspx?FK_Node=" + mynd.NodeID + "&WorkID=" + myWorkID + "&FK_Flow=" + fk_flow;
                    Web.WebUser.SignInOfGener(new BP.Port.Emp(fk_emp), true);
                    this.Response.Write("<script> window.location.href='" + myurl + "'</script> *^_^*  <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + myurl + "'>点这里进入。</a>");
                    return;

                case "OF":     //通过一个串来打开一个工作.
                    string          sid  = this.Request.QueryString["SID"];
                    string[]        strs = sid.Split('_');
                    GenerWorkerList wl   = new GenerWorkerList();
                    int             i    = wl.Retrieve(GenerWorkerListAttr.FK_Emp, strs[0],
                                                       GenerWorkerListAttr.WorkID, strs[1],
                                                       GenerWorkerListAttr.FK_Node, strs[2]);
                    if (i == 0)
                    {
                        this.Response.Write("<h2>提示</h2>此工作已经被别人处理或者此流程已删除。");
                        return;
                    }

                    BP.Port.Emp empOF = new BP.Port.Emp(wl.FK_Emp);
                    Web.WebUser.SignInOfGener(empOF, true);
                    string u = "MyFlow.aspx?FK_Flow=" + wl.FK_Flow + "&WorkID=" + wl.WorkID + "&FK_Node=" + wl.FK_Node + "&FID=" + wl.FID;
                    this.Response.Write("<script> window.location.href='" + u + "'</script> *^_^*  <br><br>正在进入系统请稍后,如果长时间没有反应,请<a href='" + u + "'>点这里进入。</a>");
                    return;

                case "ExitAuth":
                    BP.Port.Emp emp = new BP.Port.Emp(this.FK_Emp);
                    //首先退出,再进行登录
                    BP.Web.WebUser.Exit();
                    BP.Web.WebUser.SignInOfGenerLang(emp, WebUser.SysLang);
                    this.WinClose();
                    return;

                case "LogAs":
                    BP.WF.Port.WFEmp wfemp = new BP.WF.Port.WFEmp(this.FK_Emp);
                    if (wfemp.AuthorIsOK == false)
                    {
                        this.WinCloseWithMsg("授权失败");
                        return;
                    }
                    BP.Port.Emp emp1 = new BP.Port.Emp(this.FK_Emp);
                    BP.Web.WebUser.SignInOfGener(emp1, WebUser.SysLang, WebUser.No, true, false);
                    this.WinClose();
                    return;

                case "TakeBack":     // 取消授权。
                    BP.WF.Port.WFEmp myau = new BP.WF.Port.WFEmp(WebUser.No);
                    BP.DA.Log.DefaultLogWriteLineInfo("取消授权:" + WebUser.No + "取消了对(" + myau.Author + ")的授权。");
                    myau.Author    = "";
                    myau.AuthorWay = 0;
                    myau.Update();
                    this.WinClose();
                    return;

                case "AutoTo":     // 执行授权。
                    BP.WF.Port.WFEmp au = new BP.WF.Port.WFEmp();
                    au.No = WebUser.No;
                    au.RetrieveFromDBSources();
                    au.AuthorDate = BP.DA.DataType.CurrentData;
                    au.Author     = this.FK_Emp;
                    au.AuthorWay  = 1;
                    au.Save();
                    BP.DA.Log.DefaultLogWriteLineInfo("执行授权:" + WebUser.No + "执行了对(" + au.Author + ")的授权。");
                    this.WinClose();
                    return;

                case "UnSend":     //执行撤消发送。
                    this.Response.Redirect("./WorkOpt/UnSend.aspx?WorkID=" + this.WorkID + "&FK_Flow=" + this.FK_Flow, false);
                    return;

                case "SetBillState":
                    break;

                case "WorkRpt":
                    Bill bk1 = new Bill(this.Request.QueryString["OID"]);
                    Node nd  = new Node(bk1.FK_Node);
                    this.Response.Redirect("WFRpt.aspx?WorkID=" + bk1.WorkID + "&FID=" + bk1.FID + "&FK_Flow=" + nd.FK_Flow + "&NodeId=" + bk1.FK_Node, false);
                    //this.WinOpen();
                    //this.WinClose();
                    break;

                case "PrintBill":
                    //Bill bk2 = new Bill(this.Request.QueryString["OID"]);
                    //Node nd2 = new Node(bk2.FK_Node);
                    //this.Response.Redirect("NodeRefFunc.aspx?NodeId=" + bk2.FK_Node + "&FlowNo=" + nd2.FK_Flow + "&NodeRefFuncOID=" + bk2.FK_NodeRefFunc + "&WorkFlowID=" + bk2.WorkID);
                    ////this.WinClose();
                    break;

                //删除流程中第一个节点的数据,包括待办工作
                case "DeleteFlow":
                    string fk_flowDel = this.Request.QueryString["FK_Flow"];
                    Int64  workid     = Int64.Parse(this.Request.QueryString["WorkID"]);
                    //调用DoDeleteWorkFlowByReal方法
                    WorkFlow wf = new WorkFlow(new Flow(fk_flowDel), workid);
                    wf.DoDeleteWorkFlowByReal(true);
                    //  Glo.ToMsg("流程删除成功");
                    BP.WF.Glo.ToMsg("流程删除成功");



                    //this.ToWFMsgPage("流程删除成功");
                    break;

                default:
                    throw new Exception("ActionType error" + this.ActionType);
                }
            }
            catch (Exception ex)
            {
                this.ToErrorPage("执行其间如下异常:<BR>" + ex.Message);
            }
        }
Example #21
0
        public string DoType(string doType, string v1, string v2, string v3, string v4, string v5)
        {
            try
            {
                switch (doType)
                {
                case "FrmTreeUp":     // 表单树
                    SysFormTree sft = new SysFormTree();
                    sft.DoUp();
                    return(null);

                case "FrmTreeDown":     // 表单树
                    SysFormTree sft1 = new SysFormTree();
                    sft1.DoDown();
                    return(null);

                case "FrmUp":
                    MapData md1 = new MapData(v1);
                    md1.DoOrderDown();
                    return(null);

                case "FrmDown":
                    MapData md = new MapData(v1);
                    md.DoOrderDown();
                    return(null);

                case "AdminLogin":
                    try
                    {
                        //if (BP.Sys.SystemConfig.IsDebug == true)
                        //    return null;

                        BP.Port.Emp emp = new BP.Port.Emp();
                        emp.No = v1;
                        emp.RetrieveFromDBSources();

                        if (emp.Pass == v2)
                        {
                            BP.Web.WebUser.SignInOfGener(emp);

                            return
                                (Newtonsoft.Json.JsonConvert.SerializeObject(
                                     new
                            {
                                success = true,
                                msg = string.Empty,
                                data = new { no = emp.No, name = emp.Name, sid = BP.Web.WebUser.SID }
                            }));
                        }

                        return(Newtonsoft.Json.JsonConvert.SerializeObject(
                                   new { success = false, msg = "用户名或密码错误" }));
                    }
                    catch (Exception ex)
                    {
                        return(Newtonsoft.Json.JsonConvert.SerializeObject(
                                   new { success = false, msg = ex.Message }));
                    }

                case "DeleteFrmSort":
                    SysFormTree fs = new SysFormTree();
                    fs.No = v1;
                    fs.Delete();
                    SysFormTree ft = new SysFormTree();
                    ft.No = v1;
                    ft.Delete();
                    return(null);

                case "DeleteFrm":     //删除表单.
                case "DelFrm":
                    MapData md4 = new MapData();
                    md4.No = v1;
                    md4.Delete();
                    return(null);

                case "InitDesignerXml":
                    string  path = BP.Sys.SystemConfig.PathOfData + "\\Xml\\Designer.xml";
                    DataSet ds   = new DataSet();
                    ds.ReadXml(path);
                    ds = this.TurnXmlDataSet2SLDataSet(ds);
                    return(Silverlight.DataSetConnector.Connector.ToXml(ds));

                default:
                    throw new Exception("没有判断的,功能编号" + doType);
                }
            }
            catch (Exception ex)
            {
                BP.DA.Log.DefaultLogWriteLineError("执行错误,功能编号" + doType + " error:" + ex.Message);
                throw new Exception("执行错误,功能编号" + doType + " error:" + ex.Message);
            }
        }
Example #22
0
 public void LetAdminLogin()
 {
     BP.Port.Emp emp = new BP.Port.Emp("admin");
     BP.Web.WebUser.SignInOfGener(emp);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                switch (this.DoType)
                {
                case "DownTempFrm":
                    MapData md   = new MapData(this.FK_MapData);
                    DataSet ds   = md.GenerHisDataSet();
                    string  name = "ccflow表单模板." + md.Name + "." + md.No + ".xml";
                    string  file = this.Request.PhysicalApplicationPath + "\\Temp\\" + this.FK_MapData + ".xml";
                    ds.WriteXml(file);
                    this.Response.Redirect("../../Temp/" + this.FK_MapData + ".xml", true);
                    this.WinClose();
                    break;

                case "CCForm":
                    this.Application.Clear();
                    if (WebUser.NoOfRel != "admin")
                    {
                        BP.Port.Emp emp = new BP.Port.Emp("admin");
                        BP.Web.WebUser.SignInOfGener(emp);
                    }

                    MapAttr mattr = new MapAttr();
                    mattr.MyPK = this.Request.QueryString["MyPK"];
                    int i = mattr.RetrieveFromDBSources();
                    mattr.KeyOfEn    = this.Request.QueryString["KeyOfEn"];
                    mattr.FK_MapData = this.Request.QueryString["FK_MapData"];
                    mattr.MyDataType = int.Parse(this.Request.QueryString["DataType"]);

                    if (!string.IsNullOrEmpty(this.Request.QueryString["UIBindKey"] + ""))
                    {
                        mattr.UIBindKey = this.Request.QueryString["UIBindKey"];
                    }
                    mattr.UIContralType = (UIContralType)int.Parse(this.Request.QueryString["UIContralType"]);
                    mattr.LGType        = (BP.En.FieldTypeS) int.Parse(this.Request.QueryString["LGType"]);
                    if (i == 0)
                    {
                        mattr.Name       = System.Web.HttpUtility.UrlDecode(this.Request.QueryString["KeyName"], System.Text.Encoding.GetEncoding("GB2312"));
                        mattr.UIIsEnable = true;
                        mattr.UIVisible  = true;
                        if (mattr.LGType == FieldTypeS.Enum)
                        {
                            mattr.DefVal = "0";
                        }
                        mattr.Insert();
                    }
                    else
                    {
                        mattr.Update();
                    }

                    switch (mattr.LGType)
                    {
                    case BP.En.FieldTypeS.Enum:
                        this.Response.Redirect("EditEnum.aspx?MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK, true);
                        return;

                    case BP.En.FieldTypeS.Normal:
                        this.Response.Redirect("EditF.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true);
                        return;

                    case BP.En.FieldTypeS.FK:
                        this.Response.Redirect("EditTable.aspx?DoType=Edit&MyPK=" + mattr.FK_MapData + "&RefNo=" + mattr.MyPK + "&FType=" + mattr.MyDataType + "&GroupField=0", true);
                        return;

                    default:
                        break;
                    }
                    break;

                case "DobackToF":
                    MapAttr ma = new MapAttr(this.RefNo);
                    switch (ma.LGType)
                    {
                    case FieldTypeS.Normal:
                        this.Response.Redirect("EditF.aspx?RefNo=" + this.RefNo, true);
                        return;

                    case FieldTypeS.FK:
                        this.Response.Redirect("EditTable.aspx?RefNo=" + this.RefNo, true);
                        return;

                    case FieldTypeS.Enum:
                        this.Response.Redirect("EditEnum.aspx?RefNo=" + this.RefNo, true);
                        return;

                    default:
                        return;
                    }
                    break;

                case "AddEnum":
                    SysEnumMain sem1    = new SysEnumMain(this.Request.QueryString["EnumKey"]);
                    MapAttr     attrAdd = new MapAttr();
                    attrAdd.KeyOfEn = sem1.No;
                    if (attrAdd.IsExit(MapAttrAttr.FK_MapData, this.MyPK, MapAttrAttr.KeyOfEn, sem1.No))
                    {
                        BP.Sys.PubClass.Alert("字段已经存在 [" + sem1.No + "]。");
                        BP.Sys.PubClass.WinClose();
                        return;
                    }

                    attrAdd.FK_MapData    = this.MyPK;
                    attrAdd.Name          = sem1.Name;
                    attrAdd.UIContralType = UIContralType.DDL;
                    attrAdd.UIBindKey     = sem1.No;
                    attrAdd.MyDataType    = BP.DA.DataType.AppInt;
                    attrAdd.LGType        = FieldTypeS.Enum;
                    attrAdd.DefVal        = "0";
                    attrAdd.UIIsEnable    = true;
                    if (this.Idx == null || this.Idx == "")
                    {
                        MapAttrs attrs1 = new MapAttrs(this.MyPK);
                        attrAdd.Idx = 0;
                    }
                    else
                    {
                        attrAdd.Idx = int.Parse(this.Idx);
                    }
                    attrAdd.Insert();
                    this.Response.Redirect("EditEnum.aspx?MyPK=" + this.MyPK + "&RefNo=" + attrAdd.MyPK, true);
                    this.WinClose();
                    return;

                case "DelEnum":
                    string      eKey = this.Request.QueryString["EnumKey"];
                    SysEnumMain sem  = new SysEnumMain();
                    sem.No = eKey;
                    sem.Delete();
                    this.WinClose();
                    return;

                case "AddSysEnum":
                    this.AddFEnum();
                    break;

                case "AddSFTable":
                    this.AddSFTable();
                    break;

                case "AddSFTableAttr":
                    SFTable sf = new SFTable(this.Request.QueryString["RefNo"]);
                    this.Response.Redirect("EditTable.aspx?MyPK=" + this.MyPK + "&SFKey=" + sf.No, true);
                    this.WinClose();
                    return;

                case "AddFG":     /*执行一个插入列组的命令.*/
                    switch (this.RefNo)
                    {
                    case "IsPass":
                        MapDtl dtl = new MapDtl(this.FK_MapData);
                        dtl.IsEnablePass = true;         /*更新是否启动审核分组字段.*/
                        MapAttr attr = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "Check_Note";
                        attr.Name          = "审核意见";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.DefVal        = "同意";
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = true;
                        attr.MaxLen        = 4000;
                        attr.ColSpan       = 4;   // 默认为4列。
                        attr.Idx           = 1;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "Checker";
                        attr.Name          = "审核人";// "审核人";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.DefVal        = "@WebUser.Name";
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.Idx           = 2;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "IsPass";
                        attr.Name          = "通过否?";// "审核人";
                        attr.MyDataType    = DataType.AppBoolean;
                        attr.UIContralType = UIContralType.CheckBok;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.DefVal        = "1";
                        attr.Idx           = 2;
                        attr.DefVal        = "0";
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "Check_RDT";
                        attr.Name          = "审核日期"; // "审核日期";
                        attr.MyDataType    = DataType.AppDateTime;
                        attr.UIContralType = UIContralType.TB;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.DefVal        = "@RDT";
                        attr.UIIsEnable    = false;
                        attr.Idx           = 3;
                        attr.Insert();

                        /* 处理批次ID*/
                        attr            = new MapAttr();
                        attr.FK_MapData = this.FK_MapData;
                        attr.KeyOfEn    = "BatchID";
                        attr.Name       = "BatchID";  // this.ToE("IsPass", "是否通过");// "审核人";
                        attr.MyDataType = DataType.AppInt;
                        attr.UIIsEnable = false;
                        attr.UIIsLine   = false;
                        attr.UIIsEnable = false;
                        attr.UIVisible  = false;
                        attr.Idx        = 2;
                        attr.DefVal     = "0";
                        attr.Insert();

                        dtl.Update();
                        this.WinClose();
                        return;

                    case "Eval":         /* 质量评价 */
                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalEmpNo";
                        attr.Name          = "被评价人员编号";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.Idx           = 1;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalEmpName";
                        attr.Name          = "被评价人员名称";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = false;
                        attr.IsSigan       = true;
                        attr.Idx           = 2;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalCent";
                        attr.Name          = "工作得分";
                        attr.MyDataType    = DataType.AppFloat;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsLine      = false;
                        attr.UIIsEnable    = true;
                        attr.Idx           = 3;
                        attr.Insert();

                        attr               = new MapAttr();
                        attr.FK_MapData    = this.FK_MapData;
                        attr.KeyOfEn       = "EvalNote";
                        attr.Name          = "评价信息";
                        attr.MyDataType    = DataType.AppString;
                        attr.UIContralType = UIContralType.TB;
                        attr.MaxLen        = 50;
                        attr.MinLen        = 0;
                        attr.UIIsEnable    = true;
                        attr.UIIsEnable    = true;
                        attr.Idx           = 4;
                        attr.Insert();
                        this.WinClose();
                        return;

                    default:
                        break;
                    }
                    break;

                case "AddFGroup":
                    this.AddFGroup();
                    return;

                case "AddF":
                case "ChoseFType":
                    this.AddF();
                    break;

                case "Up":
                    MapAttr attrU = new MapAttr(this.RefNo);
                    if (this.Request.QueryString["IsDtl"] != null)
                    {
                        attrU.DoDtlUp();
                    }
                    else
                    {
                        attrU.DoUp();
                    }

                    this.WinClose();
                    break;

                case "Down":     //让一个字段下移动.
                    MapAttr attrD = new MapAttr(this.RefNo);
                    attrD.DoDown();
                    this.WinClose();
                    break;

                case "DownAttr":     //让一个字段下移动.
                    MapAttr attrAttr = new MapAttr(this.RefNo);
                    attrAttr.DoDtlDown();
                    this.WinClose();
                    break;

                case "Jump":
                    MapAttr attrFrom = new MapAttr(this.Request.QueryString["FromID"]);
                    MapAttr attrTo   = new MapAttr(this.Request.QueryString["ToID"]);
                    attrFrom.DoJump(attrTo);
                    this.WinClose();
                    break;

                case "MoveTo":
                    string  toID     = this.Request.QueryString["ToID"];
                    int     toGFID   = int.Parse(this.Request.QueryString["ToGID"]);
                    int     fromGID  = int.Parse(this.Request.QueryString["FromGID"]);
                    string  fromID   = this.Request.QueryString["FromID"];
                    MapAttr fromAttr = new MapAttr();
                    fromAttr.MyPK = fromID;
                    fromAttr.Retrieve();
                    if (toGFID == fromAttr.GroupID && fromAttr.MyPK == toID)
                    {
                        /* 如果没有移动. */
                        this.WinClose();
                        return;
                    }
                    if (toGFID != fromAttr.GroupID && fromAttr.MyPK == toID)
                    {
                        MapAttr toAttr = new MapAttr(toID);
                        fromAttr.Update(MapAttrAttr.GroupID, toAttr.GroupID, MapAttrAttr.Idx, toAttr.Idx);
                        this.WinClose();
                        return;
                    }
                    this.Response.Redirect(this.Request.RawUrl.Replace("MoveTo", "Jump"), true);
                    return;

                case "Edit":
                    Edit();
                    break;

                case "Del":
                    MapAttr attrDel = new MapAttr();
                    attrDel.MyPK = this.RefNo;
                    attrDel.Delete();
                    this.WinClose();
                    break;

                case "GFDoUp":
                    GroupField gf = new GroupField(this.RefOID);
                    gf.DoUp();
                    gf.Retrieve();
                    if (gf.Idx == 0)
                    {
                        this.WinClose();
                        return;
                    }
                    int oidIdx = gf.Idx;
                    gf.Idx = gf.Idx - 1;
                    GroupField gfUp = new GroupField();
                    if (gfUp.Retrieve(GroupFieldAttr.EnName, gf.EnName, GroupFieldAttr.Idx, gf.Idx) == 1)
                    {
                        gfUp.Idx = oidIdx;
                        gfUp.Update();
                    }
                    gf.Update();
                    this.WinClose();
                    break;

                case "GFDoDown":
                    GroupField mygf = new GroupField(this.RefOID);
                    mygf.DoDown();
                    mygf.Retrieve();
                    int oidIdx1 = mygf.Idx;
                    mygf.Idx = mygf.Idx + 1;
                    GroupField gfDown = new GroupField();
                    if (gfDown.Retrieve(GroupFieldAttr.EnName, mygf.EnName, GroupFieldAttr.Idx, mygf.Idx) == 1)
                    {
                        gfDown.Idx = oidIdx1;
                        gfDown.Update();
                    }
                    mygf.Update();
                    this.WinClose();
                    break;

                case "AthDoUp":
                    FrmAttachment frmAth = new FrmAttachment(this.MyPK);
                    if (frmAth.RowIdx > 0)
                    {
                        frmAth.RowIdx = frmAth.RowIdx - 1;
                        frmAth.Update();
                    }
                    this.WinClose();
                    break;

                case "AthDoDown":
                    FrmAttachment frmAthD = new FrmAttachment(this.MyPK);
                    if (frmAthD.RowIdx < 10)
                    {
                        frmAthD.RowIdx = frmAthD.RowIdx + 1;
                        frmAthD.Update();
                    }
                    this.WinClose();
                    break;

                case "DtlDoUp":
                    MapDtl dtl1 = new MapDtl(this.MyPK);
                    if (dtl1.RowIdx > 0)
                    {
                        dtl1.RowIdx = dtl1.RowIdx - 1;
                        dtl1.Update();
                    }
                    this.WinClose();
                    break;

                case "DtlDoDown":
                    MapDtl dtl2 = new MapDtl(this.MyPK);
                    if (dtl2.RowIdx < 10)
                    {
                        dtl2.RowIdx = dtl2.RowIdx + 1;
                        dtl2.Update();
                    }
                    this.WinClose();
                    break;

                case "M2MDoUp":
                    MapM2M ddtl1 = new MapM2M(this.MyPK);
                    if (ddtl1.RowIdx > 0)
                    {
                        ddtl1.RowIdx = ddtl1.RowIdx - 1;
                        ddtl1.Update();
                    }
                    this.WinClose();
                    break;

                case "M2MDoDown":
                    MapM2M ddtl2 = new MapM2M(this.MyPK);
                    if (ddtl2.RowIdx < 10)
                    {
                        ddtl2.RowIdx = ddtl2.RowIdx + 1;
                        ddtl2.Update();
                    }
                    this.WinClose();
                    break;

                case "FrameDoUp":
                    MapFrame frame1 = new MapFrame(this.MyPK);
                    if (frame1.RowIdx > 0)
                    {
                        frame1.RowIdx = frame1.RowIdx - 1;
                        frame1.Update();
                    }
                    this.WinClose();
                    break;

                case "FrameDoDown":
                    MapFrame frame2 = new MapFrame(this.MyPK);
                    if (frame2.RowIdx < 10)
                    {
                        frame2.RowIdx = frame2.RowIdx + 1;
                        frame2.Update();
                    }
                    this.WinClose();
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                this.Pub1.AddMsgOfWarning("错误:", ex.Message + " <br>" + this.Request.RawUrl);
            }
        }
Example #24
0
        void btn_Click(object sender, EventArgs e)
        {
            string accepters = (Pub1.FindControl("HID_SelectedEmps") as HiddenField).Value;// this.Pub1.GetTextBoxByID("TB_Accepter").Text;

            accepters = accepters.Trim();
            if (string.IsNullOrEmpty(accepters))
            {
                this.Alert("接受人不能为空");
                return;
            }
            string title = this.Pub1.GetTextBoxByID("TB_Title").Text;

            if (string.IsNullOrEmpty(title))
            {
                this.Alert("标题不能为空");
                return;
            }
            string doc = this.Pub1.GetTextBoxByID("TB_Doc").Text;

            //节点.
            BP.WF.Node nd = new BP.WF.Node(this.FK_Node);

            /*检查人员是否有问题.*/
            string[]    emps   = accepters.Split(',');
            BP.Port.Emp myemp  = new BP.Port.Emp();
            string      errMsg = "";

            foreach (string emp in emps)
            {
                if (string.IsNullOrEmpty(emp))
                {
                    continue;
                }
                myemp.No = emp;
                if (myemp.IsExits == false)
                {
                    errMsg += "@人员(" + emp + ")拼写错误。";
                }
            }

            if (string.IsNullOrEmpty(errMsg) == false)
            {
                this.Alert(errMsg);
                return;
            }

            //抄送信息.

            string msg = "";

            foreach (string emp in emps)
            {
                if (string.IsNullOrEmpty(emp))
                {
                    continue;
                }

                myemp.No = emp;
                myemp.Retrieve();

                msg += "(" + myemp.No + "," + myemp.Name + ")";

                // 根据节点属性的配置写入数据.
                switch (nd.CCWriteTo)
                {
                case BP.WF.CCWriteTo.All:
                    BP.WF.Dev2Interface.Node_CC_WriteTo_CClist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name, title, doc);
                    BP.WF.Dev2Interface.Node_CC_WriteTo_Todolist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name);
                    break;

                case BP.WF.CCWriteTo.CCList:
                    BP.WF.Dev2Interface.Node_CC_WriteTo_CClist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name, title, doc);
                    break;

                case BP.WF.CCWriteTo.Todolist:
                    BP.WF.Dev2Interface.Node_CC_WriteTo_Todolist(this.FK_Node, this.FK_Node, this.WorkID, emp, myemp.Name);
                    break;

                default:
                    break;
                }
            }

            //写入日志.
            BP.WF.Dev2Interface.WriteTrack(nd.FK_Flow, nd.NodeID, this.WorkID, this.FID, "抄送给:" + msg, BP.WF.ActionType.CC,
                                           null, null, null);

            //  this.WinCloseWithMsg("抄送成功...");
            this.WinClose("1");
        }
Example #25
0
        /// <summary>
        /// 步骤1 让zhanghaicheng 发起流程.
        /// </summary>
        public void Step1()
        {
            //给发起人赋值.
            starterEmp = new Port.Emp(userNo);

            //让 userNo 登录.
            BP.WF.Dev2Interface.Port_Login(userNo);

            //创建空白工作, 发起开始节点.
            workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fk_flow, null, null,
                                                              WebUser.No, null, 0, null);

            #region 检查创建工作是否符合预期.
            //检查开始节点写入的数据是否正确?
            sql = "SELECT * FROM ND2301 WHERE OID=" + workID;
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count != 1)
            {
                throw new Exception("@发起流程出错误,不应该找不到开始节点的数据.");
            }
            foreach (DataColumn dc in dt.Columns)
            {
                string val = dt.Rows[0][dc.ColumnName].ToString();
                switch (dc.ColumnName)
                {
                case WorkAttr.CDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("CDT,日期错误.现在的日期是:" + val);
                    }
                    break;

                case WorkAttr.RDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("RDT,日期错误.现在的日期是:" + val);
                    }
                    break;

                case WorkAttr.Emps:
                    if (val.Contains(WebUser.No) == false)
                    {
                        throw new Exception("应当包含当前人员,现在是:" + val);
                    }
                    break;

                case WorkAttr.FID:
                    if (val != "0")
                    {
                        throw new Exception("应当 = 0,现在是:" + val);
                    }
                    break;

                case WorkAttr.MD5:
                    //if (Glo.ism
                    //if (val !="0")
                    //    throw new Exception("应当 = 0,现在是:"+val);
                    break;

                case WorkAttr.MyNum:
                    if (val != "1")
                    {
                        throw new Exception("应当 = 1,现在是:" + val);
                    }
                    break;

                case WorkAttr.Rec:
                    if (val != WebUser.No)
                    {
                        throw new Exception("应当 Rec= " + WebUser.No + ",现在是:" + val);
                    }
                    break;

                //case WorkAttr.Sender:
                //    if (val != WebUser.No)
                //        throw new Exception("应当 Sender= " + WebUser.No + ",现在是:" + val);
                //    break;
                default:
                    break;
                }
            }


            //检查流程表的数据.
            sql = "SELECT * FROM " + fl.PTable + " WHERE OID=" + workID;
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count != 1)
            {
                throw new Exception("@流程报表数据被删除了.");
            }
            foreach (DataColumn dc in dt.Columns)
            {
                string val = dt.Rows[0][dc.ColumnName].ToString();
                switch (dc.ColumnName)
                {
                case GERptAttr.FID:
                    if (val != "0")
                    {
                        throw new Exception("@应当是0");
                    }
                    break;

                case GERptAttr.FK_Dept:
                    if (val != WebUser.FK_Dept)
                    {
                        throw new Exception("@应当是" + WebUser.FK_Dept + ", 现在是:" + val);
                    }
                    break;

                case GERptAttr.FK_NY:
                    if (val != DataType.CurrentYearMonth)
                    {
                        throw new Exception("@应当是" + DataType.CurrentYearMonth + ", 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowDaySpan:
                    if (val != "0")
                    {
                        throw new Exception("@应当是 0 , 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEmps:
                    if (val.Contains(WebUser.No) == false)
                    {
                        throw new Exception("@应当是包含当前人员, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEnder:
                    if (val != WebUser.No)
                    {
                        throw new Exception("@应当是 当前人员, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEnderRDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("@应当是 当前日期, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEndNode:
                    if (val != "2301")
                    {
                        throw new Exception("@应当是 2301, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowStarter:
                    if (val != WebUser.No)
                    {
                        throw new Exception("@应当是  WebUser.No, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowStartRDT:
                    if (string.IsNullOrEmpty(val))
                    {
                        throw new Exception("@应当不能为空,现在是:" + val);
                    }
                    break;

                case GERptAttr.Title:
                    if (string.IsNullOrEmpty(val))
                    {
                        throw new Exception("@不能为空title" + val);
                    }
                    break;

                case GERptAttr.WFState:
                    WFState sta = (WFState)int.Parse(val);
                    if (sta != WFState.Blank)
                    {
                        throw new Exception("@应当是  WFState.Blank 现在是" + sta.ToString());
                    }
                    break;

                default:
                    break;
                }
            }

            #endregion 检查创建工作是否符合预期

            //定义一个参数.
            Hashtable ht = new System.Collections.Hashtable();
            ht.Add("GoTo", 1);
            ht.Add("MyPara", "TestPara");

            //执行发送.
            objs = BP.WF.Dev2Interface.Node_SendWork(fk_flow, workID, ht);

            #region 第1步: 检查发送对象.
            //从获取的发送对象里获取到下一个工作者. zhangyifan(张一帆)、zhoushengyu(周升雨).
            if (objs.VarAcceptersID != "zhoupeng")
            {
                throw new Exception("@下一步的接受人不正确, 应当是: zhoupeng.现在是:" + objs.VarAcceptersID);
            }

            if (objs.VarToNodeID != 2302)
            {
                throw new Exception("@应该是 2302 节点. 现在是:" + objs.VarToNodeID);
            }

            if (objs.VarWorkID != workID)
            {
                throw new Exception("@主线程的workid不应该变化:" + objs.VarWorkID);
            }

            if (objs.VarCurrNodeID != 2301)
            {
                throw new Exception("@当前节点的编号不能变化:" + objs.VarCurrNodeID);
            }

            if (objs.VarTreadWorkIDs != null)
            {
                throw new Exception("@不应当获得子线程WorkID.");
            }

            #endregion 第1步: 检查发送对象.

            #region 第2步: 检查流程引擎表.
            //检查创建这个空白是否有数据完整?
            sql = "SELECT * FROM WF_EmpWorks WHERE WorkID=" + workID + " AND FK_Emp='" + objs.VarAcceptersID + "'";
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count == 0)
            {
                throw new Exception("@不应该找不到当前人员的待办.");
            }

            gwf = new GenerWorkFlow(workID);
            if (gwf.Starter != WebUser.No || gwf.StarterName != WebUser.Name)
            {
                throw new Exception("没有写入发起人的信息.");
            }

            if (gwf.FK_Dept != starterEmp.FK_Dept)
            {
                throw new Exception("@发起人的部门有变化,应当是" + starterEmp.FK_Dept + ",现在是:" + gwf.FK_Dept);
            }

            if (gwf.Starter != starterEmp.No)
            {
                throw new Exception("@发起人的 No 有变化,应当是" + starterEmp.No + ",现在是:" + gwf.Starter);
            }


            //判断当前点.
            if (gwf.FK_Node != 2302)
            {
                throw new Exception("@当前点应该是 2302 现在是:" + gwf.FK_Node);
            }

            //判断当前点.
            if (gwf.FID != 0)
            {
                throw new Exception("@当前点应该是 FID=0  现在是:" + gwf.FID);
            }

            //判断PWorkID,没有谁调用它,应当是 0.
            if (gwf.PWorkID != 0)
            {
                throw new Exception("@没有谁调用它, 当前点应该是 PWorkID=0  现在是:" + gwf.PWorkID);
            }

            //判断 WFState .
            if (gwf.WFState != WFState.Runing)
            {
                throw new Exception("@应当是 WFState=Runing 现在是:" + gwf.WFState.ToString());
            }

            //检查开始节点 发送人的WF_GenerWorkerList的.
            gwl = new GenerWorkerList();
            gwl.CheckPhysicsTable();

            gwl.FK_Emp  = Web.WebUser.No;
            gwl.FK_Node = 2301;
            gwl.WorkID  = workID;
            gwl.Retrieve();

            // 没有分合流应当是 0 .
            if (gwl.FID != 0)
            {
                throw new Exception("@没有分合流应当是 0.");
            }

            if (gwl.IsEnable == false)
            {
                throw new Exception("@应该是启用的状态 ");
            }

            if (gwl.IsPass == false)
            {
                throw new Exception("@应该是通过的状态 ");
            }

            if (gwl.Sender.Contains(WebUser.No) == false)
            {
                throw new Exception("@应该是 包含当前状态 . ");
            }

            if (gwl.Paras != "@MyPara=TestPara@GoTo=1")
            {
                throw new Exception("@参数应当是:@MyPara=TestPara@GoTo=1 .现在是:" + gwl.Paras);
            }

            //检查接受人的 WF_GenerWorkerList 的.
            gwl         = new GenerWorkerList();
            gwl.FK_Emp  = objs.VarAcceptersID;
            gwl.FK_Node = 2302;
            gwl.WorkID  = workID;
            gwl.Retrieve();

            // 没有分合流应当是 0 .
            if (gwl.FID != 0)
            {
                throw new Exception("@没有分合流应当是 0.");
            }

            if (gwl.IsEnable == false)
            {
                throw new Exception("@应该是启用的状态 ");
            }

            if (gwl.IsPass == true)
            {
                throw new Exception("@应该是未通过的状态 ");
            }

            if (gwl.Sender.Contains(WebUser.No) == false)
            {
                throw new Exception("@应该是 当前人发送的,现在是: " + gwl.Sender);
            }
            #endregion 第2步: 检查流程引擎表.

            #region 第3步: 检查节点数据表.
            sql = "SELECT * FROM ND2301 WHERE OID=" + workID;
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count != 1)
            {
                throw new Exception("@发起流程出错误,不应该找不到开始节点的数据.");
            }
            foreach (DataColumn dc in dt.Columns)
            {
                string val = dt.Rows[0][dc.ColumnName].ToString();
                switch (dc.ColumnName)
                {
                case WorkAttr.CDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("CDT,日期错误.");
                    }
                    break;

                case WorkAttr.RDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("RDT,日期错误.");
                    }
                    break;

                case WorkAttr.Emps:
                    if (val.Contains(WebUser.No) == false)
                    {
                        throw new Exception("应当包含当前人员,现在是:" + val);
                    }
                    break;

                case WorkAttr.FID:
                    if (val != "0")
                    {
                        throw new Exception("应当 = 0,现在是:" + val);
                    }
                    break;

                case WorkAttr.MD5:
                    //if (Glo.ism
                    //if (val !="0")
                    //    throw new Exception("应当 = 0,现在是:"+val);
                    break;

                case WorkAttr.MyNum:
                    if (val != "1")
                    {
                        throw new Exception("应当 = 1,现在是:" + val);
                    }
                    break;

                case WorkAttr.Rec:
                    if (val != WebUser.No)
                    {
                        throw new Exception("应当 Rec= " + WebUser.No + ",现在是:" + val);
                    }
                    break;

                //case WorkAttr.Sender:
                //    if (val != WebUser.No)
                //        throw new Exception("应当 Sender= " + WebUser.No + ",现在是:" + val);
                //    break;
                default:
                    break;
                }
            }

            //检查节点2的数据.
            sql = "SELECT * FROM ND2302 WHERE OID=" + workID;
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count != 1)
            {
                throw new Exception("@发起流程出错误,不应该找不到 ND2302 的数据.");
            }
            foreach (DataColumn dc in dt.Columns)
            {
                string val = dt.Rows[0][dc.ColumnName].ToString();
                switch (dc.ColumnName)
                {
                case WorkAttr.CDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("CDT,日期错误.");
                    }
                    break;

                case WorkAttr.RDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("RDT,日期错误.");
                    }
                    break;

                case WorkAttr.Emps:
                    if (val.Contains("zhoupeng") == false)
                    {
                        throw new Exception("第二步骤的处理人员,应当zhoupeng ,现在是:" + val);
                    }
                    break;

                case WorkAttr.FID:
                    if (val != "0")
                    {
                        throw new Exception("应当 = 0,现在是:" + val);
                    }
                    break;

                case WorkAttr.MD5:
                    //if (Glo.ism
                    //if (val !="0")
                    //    throw new Exception("应当 = 0,现在是:"+val);
                    break;

                case WorkAttr.MyNum:
                    if (val != "1")
                    {
                        throw new Exception("应当 = 1,现在是:" + val);
                    }
                    break;

                case WorkAttr.Rec:
                    if (val != "zhoupeng")
                    {
                        throw new Exception("应当 Rec= zhoupeng,现在是:" + val);
                    }
                    break;

                default:
                    break;
                }
            }

            //检查流程表的数据.
            sql = "SELECT * FROM " + fl.PTable + " WHERE OID=" + workID;
            dt  = DBAccess.RunSQLReturnTable(sql);
            if (dt.Rows.Count != 1)
            {
                throw new Exception("@流程报表数据被删除了.");
            }
            foreach (DataColumn dc in dt.Columns)
            {
                string val = dt.Rows[0][dc.ColumnName].ToString();
                switch (dc.ColumnName)
                {
                case GERptAttr.FID:
                    if (val != "0")
                    {
                        throw new Exception("@应当是0");
                    }
                    break;

                case GERptAttr.FK_Dept:
                    if (val != WebUser.FK_Dept)
                    {
                        throw new Exception("@应当是" + WebUser.FK_Dept + ", 现在是:" + val);
                    }
                    break;

                case GERptAttr.FK_NY:
                    if (val != DataType.CurrentYearMonth)
                    {
                        throw new Exception("@应当是" + DataType.CurrentYearMonth + ", 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowDaySpan:
                    if (val != "0")
                    {
                        throw new Exception("@应当是 0 , 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEmps:
                    if (val.Contains(WebUser.No) == false)
                    {
                        throw new Exception("@应当是包含当前人员, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEnder:
                    if (val != WebUser.No)
                    {
                        throw new Exception("@应当是 当前人员, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEnderRDT:
                    if (val.Contains(DataType.CurrentData) == false)
                    {
                        throw new Exception("@应当是 当前日期, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowEndNode:
                    if (val != "2302")
                    {
                        throw new Exception("@应当是 2302, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowStarter:
                    if (val != WebUser.No)
                    {
                        throw new Exception("@应当是  WebUser.No, 现在是:" + val);
                    }
                    break;

                case GERptAttr.FlowStartRDT:
                    if (string.IsNullOrEmpty(val))
                    {
                        throw new Exception("@应当不能为空,现在是:" + val);
                    }
                    break;

                case GERptAttr.Title:
                    if (string.IsNullOrEmpty(val))
                    {
                        throw new Exception("@不能为空title" + val);
                    }
                    break;

                case GERptAttr.WFState:
                    WFState sta = (WFState)int.Parse(val);
                    if (sta != WFState.Runing)
                    {
                        throw new Exception("@应当是  WFState.Runing 现在是" + sta.ToString());
                    }
                    break;

                default:
                    break;
                }
            }
            #endregion 第3步: 检查节点数据表.
        }
Example #26
0
        /// <summary>
        /// 测试默认的请假流程发送与退回.
        /// zhanghaicheng登录,
        /// zhoupeng 审批.
        /// liping 核实.
        /// </summary>
        public void Test002()
        {
            //流程编号.
            string fk_flow = "002";

            userNo = "liyan";

            //给发起人赋值.
            starterEmp = new Port.Emp(userNo);

            //让 userNo 登录.
            BP.WF.Dev2Interface.Port_Login(userNo);

            //检查201节点是否有短消息?
            PushMsgs msgs = new PushMsgs(201);

            if (msgs.Count > 0)
            {
                throw new Exception("@测试模版变化,以下的测试将会不正确。");
            }

            //创建空白工作, 发起开始节点.
            workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fk_flow);

            //删除消息.
            BP.DA.DBAccess.RunSQL("DELETE FROM Sys_SMS");

            //执行发送工作.
            BP.WF.Dev2Interface.Node_SendWork(fk_flow, workID, null, null);

            #region 检查是否有消息产生.
            BP.WF.SMSs smss = new SMSs();
            smss.RetrieveAllFromDBSource();
            if (smss.Count == 0)
            {
                throw new Exception("@执行了发送,应该产生消息,而没有产生。");
            }

            if (smss.Count != 1)
            {
                throw new Exception("@应该产生1条,现在产生了多条。");
            }

            foreach (BP.WF.SMS sm in smss)
            {
                if (sm.HisEmailSta != MsgSta.UnRun)
                {
                    throw new Exception("@应该是邮件启用状态,但是目前状态是:" + sm.HisEmailSta);
                }

                if (sm.MsgType != SMSMsgType.SendSuccess)
                {
                    throw new Exception("@应该是 SendSuccess 的类型,但是目前状态是:" + sm.MsgType);
                }

                if (sm.SendToEmpNo != "liping")
                {
                    throw new Exception("@应该是 liping 是接受人ID,但是目前是:" + sm.SendToEmpNo);
                }

                if (sm.Sender != BP.Web.WebUser.No)
                {
                    throw new Exception("@应该 Sender= " + BP.Web.WebUser.No + " ,但是目前是:" + sm.Sender);
                }

                if (sm.IsRead != 0)
                {
                    throw new Exception("@应该是 IsRead=0 ,但是目前是:" + sm.IsRead);
                }
            }
            #endregion 检查是否有消息产生.

            /*
             * 让 zhanghaicheng 登录,走申请 __>> 总经理审批 __>> 人力资源备案.
             */

            //让 zhanghaicheng 登录,
            BP.WF.Dev2Interface.Port_Login("zhanghaicheng");
            //创建空白工作, 发起开始节点.
            workID = BP.WF.Dev2Interface.Node_CreateBlankWork(fk_flow);
            //让zhanghaicheng发送.
            BP.WF.Dev2Interface.Node_SendWork(fk_flow, workID, null, null);

            //让 zhoupeng 登录.
            BP.WF.Dev2Interface.Port_Login("zhoupeng");

            //删除消息.
            BP.DA.DBAccess.RunSQL("DELETE FROM Sys_SMS");

            //让zhoupeng发送, 发送到人力资源备案. 并且人力资源有短消息提醒.
            SendReturnObjs objs = BP.WF.Dev2Interface.Node_SendWork(fk_flow, workID, null, null);

            //到达HR节点ID.
            int      nodeIDOfHR = objs.VarToNodeID;
            PushMsgs pms        = new PushMsgs(nodeIDOfHR);
            if (pms.Count != 1)
            {
                throw new Exception("@请假流程的消息机制模版, 人力资源部审批,设置的短消息到达,被改变。");
            }

            //检查是否有消息存在.
            smss = new SMSs();
            smss.RetrieveAllFromDBSource();
            if (smss.Count == 0)
            {
                throw new Exception("@执行了发送,应该产生消息,而没有产生,应该产生一条短消息.");
            }

            //遍历消息.
            foreach (BP.WF.SMS item in smss)
            {
                if (item.MsgType == "WorkArrive")
                {
                    if (item.SendToEmpNo != "liping")
                    {
                        throw new Exception("@应该是 liping 现在是:" + item.SendToEmpNo);
                    }

                    if (item.Sender != "zhoupeng")
                    {
                        throw new Exception("@应该是 zhoupeng 现在是:" + item.SendToEmpNo);
                    }

                    if (item.HisMobileSta != MsgSta.UnRun)
                    {
                        throw new Exception("@ MsgSta 状态写入不正确 UnRun 现在是:" + item.SendToEmpNo);
                    }
                }
            }
        }
Example #27
0
 public string LetLogin()
 {
     BP.Port.Emp emp = new BP.Port.Emp("admin");
     WebUser.SignInOfGener(emp);
     return("登录成功.");
 }
Example #28
0
        public string GetRunning(string userNo, string[][] queryParams, int?page, int?pageSize)
        {
            UserLogin(userNo);

            DataTable table = BP.WF.Dev2Interface.DB_GenerRuning(userNo, null);
            string    url   = "";

            table.Columns.Add("TitleUrl");
            table.Columns.Add("WFStateText");
            table.Columns.Add("FlowEmps");
            table.Columns.Add("UnSendUrl");
            table.Columns.Add("PressUrl");

            foreach (DataRow row in table.Rows)
            {
                url             = BP.Sys.SystemConfig.AppSettings["BaseUrl"] + "/WF/WFRpt.aspx?WorkID=" + row["WorkID"] + "&FK_Flow=" + row["FK_Flow"] + "&FID=" + row["FID"] + "&UserNo=" + userNo;
                row["TitleUrl"] = url;

                string unSendUrl = BP.Sys.SystemConfig.AppSettings["BaseUrl"] + "/AppDemoLigerUI/Base/DataService.aspx?method=unsend&FK_Flow=" + row["FK_Flow"] + "&WorkID=" + row["WorkID"] + "&UserNo=" + userNo;
                string pressUrl  = BP.Sys.SystemConfig.AppSettings["BaseUrl"] + "/WF/WorkOpt/Press.aspx?FID=" + row["FID"] + "&WorkID=" + row["WorkID"] + "&FK_Flow=" + row["FK_Flow"] + "&UserNo=" + userNo;
                //  row["Operation"] = "<a href=\"javascript:winOperation('" + url + "','false')\">撤销</a>-<a href=\"javascript:winOpen('" + pressUrl + "'))\">催办</a>";
                row["UnSendUrl"] = unSendUrl;
                row["PressUrl"]  = pressUrl;

                string emps = row["Emps"] + "";

                foreach (string single in emps.Split('@'))
                {
                    if (!string.IsNullOrEmpty(single))
                    {
                        try
                        {
                            row["FlowEmps"] += new BP.Port.Emp(single).Name + ";";
                        }
                        catch (Exception ex)
                        {
                            row["FlowEmps"] += single + ";";
                        }
                    }
                }

                string text = "";
                switch (row["WFState"] + "")
                {
                case "2":
                    text = "运行中";
                    break;

                case "3":
                    text = "已完成";
                    break;

                case "4":
                    text = "挂起";
                    break;

                case "5":
                    text = "退回";
                    break;

                case "6":
                    text = "移交";
                    break;

                case "7":
                    text = "删除(逻辑)";
                    break;

                case "8":
                    text = "加签";
                    break;

                case "9":
                    text = "冻结";
                    break;

                case "10":
                    text = "批处理";
                    break;

                case "11":
                    text = "加签回复";
                    break;

                default:
                    break;
                }

                row["WFStateText"] = text;
            }


            DataTable filterTable = FilterTable(queryParams, table);

            DataTable finalTable = PageTable(page, pageSize, table);


            string xml = WriteTableToXml(finalTable, filterTable.Rows.Count);

            return(xml);
        }
Example #29
0
        void btn_Click(object sender, EventArgs e)
        {
            string lang = "CH";
            string db   = "SQLServer";
            string hj   = "Inc";

            if (this.Pub1.GetRadioButtonByID("RB_SQL").Checked)
            {
                db = "SQLServer";
            }

            if (this.Pub1.GetRadioButtonByID("RB_Oracle").Checked)
            {
                db = "Oracle";
            }

            if (this.Pub1.GetRadioButtonByID("RB_DB2").Checked)
            {
                db = "DB2";
            }

            if (this.Pub1.GetRadioButtonByID("RB_MYSQL").Checked)
            {
                db = "MySQL";
            }

            BP.WF.XML.Langs langs = new BP.WF.XML.Langs();
            langs.RetrieveAll();
            foreach (BP.WF.XML.Lang xml in langs)
            {
                if (this.Pub1.GetRadioButtonByID("RB_" + xml.No).Checked)
                {
                    lang = xml.No;
                }
            }

            if (this.Pub1.GetRadioButtonByID("RB_Inc").Checked)
            {
                hj = "Inc";
            }

            if (this.Pub1.GetRadioButtonByID("RB_Gov").Checked)
            {
                hj = "Gov";
            }

            hj = "Inc";
            //运行。
            BP.WF.Glo.DoInstallDataBase(lang, hj, this.Pub1.GetRadioButtonByID("RB_DemoOn").Checked);

            //加注释.
            BP.PubClass.AddComment();

            // 装载演示数据.
            if (this.Pub1.GetRadioButtonByID("RB_DemoOn").Checked)
            {
                BP.Port.Emp emp = new BP.Port.Emp("admin");
                BP.Web.WebUser.SignInOfGener(emp);
                BP.WF.DTS.LoadTemplete l = new BP.WF.DTS.LoadTemplete();
                string msg = l.Do() as string;
            }

            try
            {
                //增加图片签名
                BP.WF.DTS.GenerSiganture gs = new BP.WF.DTS.GenerSiganture();
                gs.Do();
            }
            catch
            {
            }


            this.Response.Redirect("DBInstall.aspx?DoType=OK", true);
        }
Example #30
0
        /// <summary>
        /// 测试学生请假流程.
        /// </summary>
        public void Test055()
        {
            //先执行一次流程检查.
            BP.WF.Flow fl = new Flow("055");
            fl.DoCheck();

            //让客户登录 0001登录,光头强.
            BP.WF.Dev2InterfaceGuest.Port_Login("0001", "光头强");
            //删除消息.
            BP.DA.DBAccess.RunSQL("DELETE FROM Sys_SMS");

            //创建workid.
            workID = BP.WF.Dev2InterfaceGuest.Node_CreateBlankWork("055", null, null, BP.Web.GuestUser.No, BP.Web.GuestUser.Name);

            //生成参数格式,把他传入给流程引擎,让其向这个手机写入消息。
            Hashtable ht = new Hashtable();

            ht.Add("SQRSJH", "18660153393");

            //向下发送.
            SendReturnObjs objs = BP.WF.Dev2Interface.Node_SendWork("055", workID, ht, null);

            string empNo = objs.VarAcceptersID;

            if (empNo != "guoxiangbin")
            {
                throw new Exception("@应该发送给guoxiangbin 处理但是发送到了:" + empNo);
            }
            #region 检查消息发送的结果.

            //系统设置了向下一步接受人员发送邮件,向指定字段的作为手机号发送短信。
            BP.WF.SMSs smss = new SMSs();
            smss.RetrieveAllFromDBSource();
            if (smss.Count != 1)
            {
                throw new Exception("@应该产生 1 条,现在产生了" + smss.Count + "条。");
            }

            foreach (BP.WF.SMS sms in smss)
            {
                if (sms.MsgType != SMSMsgType.SendSuccess)
                {
                    throw new Exception("@应该是 SendSuccess 禁用状态,现在是:" + sms.MsgType);
                }

                if (sms.HisMobileSta != MsgSta.UnRun)
                {
                    throw new Exception("@应该是 短消息 禁用状态,但是目前状态是:" + sms.HisMobileSta);
                }

                if (sms.Sender != BP.Web.WebUser.No)
                {
                    throw new Exception("@应该 Sender= " + BP.Web.WebUser.No + " ,但是目前是:" + sms.Sender);
                }

                if (sms.IsRead != 0)
                {
                    throw new Exception("@应该是 IsRead=0 ,但是目前是:" + sms.IsRead);
                }
            }
            #endregion 检查消息发送的结果.

            //给发起人赋值.
            starterEmp = new Port.Emp(empNo);
            //让 userNo 登录.
            BP.WF.Dev2Interface.Port_Login(empNo);
        }