示例#1
0
        public override string ToString()
        {
            string bs = String.Format("Книга:\n Автор: {0}\n Название: {1}\n Год издания: {2}\n {3} стр.\n Стоимость аренды: {4}\n Издательство: {5}",
                                      Author, Title, Year, Pages, Book.price, Pub1.ToString());

            return(bs);
        }
示例#2
0
        /// <summary>
        /// 数据源
        /// </summary>
        /// <param name="attrs">数据字符串,规则如下:
        /// <para>1.每个字段间用 ^ 来分隔</para>
        /// <para>2.字段的信息间用 ~ 来分隔</para>
        /// <para>3.字段的信息分别为:英文名称,中文名称,数据类型,最大长度,逻辑类型,序号</para>
        /// </param>
        /// <param name="tableName">数据表名称</param>
        public void InitMapAttr(string tableName, string attrs)
        {
            Pub1.AddEasyUiPanelInfo("发送信息", attrs);
            return;

            //删除有可能存在的临时数据.
            string tempStr = tableName + "Tmp";

            MapAttr ma = new MapAttr();

            ma.Delete(MapAttrAttr.FK_MapData, tempStr);

            string[] strs = attrs.Split('^');
            foreach (string str in strs)
            {
                if (string.IsNullOrEmpty(str))
                {
                    continue;
                }

                string[] mystrs = str.Split('~');
                ma            = new MapAttr();
                ma.KeyOfEn    = mystrs[0];
                ma.Name       = mystrs[1];
                ma.FK_MapData = tempStr;
                ma.MyDataType = int.Parse(mystrs[2]);
                ma.MaxLen     = int.Parse(mystrs[3]);
                ma.LGType     = (BP.En.FieldTypeS) int.Parse(mystrs[4]);
                ma.Idx        = int.Parse(mystrs[5]);
                ma.MyPK       = tempStr + "_" + ma.KeyOfEn;
                ma.Insert();
            }
        }
示例#3
0
        void ddl_SelectedIndexChanged(object sender, EventArgs e)
        {
            var openway = (SpecOperWay)Pub1.GetDDLByID("DDL_" + CondAttr.SpecOperWay).SelectedItemIntVal;
            var lbl     = Pub1.GetLabelByID("LBL1");
            var tb      = Pub1.GetTBByID("TB_" + CondAttr.SpecOperPara);

            switch (openway)
            {
            case SpecOperWay.SpecNodeOper:
                lbl.Text = "节点编号:";
                break;

            case SpecOperWay.SpecSheetField:
                lbl.Text = "表单字段:";
                break;

            case SpecOperWay.SpenEmpNo:
                lbl.Text = "操作员编号:";
                break;

            case SpecOperWay.CurrOper:
                lbl.Text = "参数:";
                break;
            }

            tb.Text    = string.Empty;
            tb.Enabled = openway != SpecOperWay.CurrOper;
        }
示例#4
0
        /// <summary>
        /// Pub1中添加LinkBtn按钮
        /// </summary>
        /// <param name="btnId">按钮的id</param>
        /// <param name="btnText">按钮的文字</param>
        private void AddButton(string btnId, string btnText)
        {
            LinkBtn btn = new LinkBtn(false, btnId, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + btnText);

            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);
        }
示例#5
0
        private void DecoratingActionWithEvent()
        {
            Console.WriteLine("Decorating Action with event attribute");
            Pub1 pub = new Pub1();

            pub.OnChange += () => Console.WriteLine("Called from method 1");
            pub.OnChange += () => Console.WriteLine("Called from method 2");
            //p.OnChange();
            Console.WriteLine("On Change cannot be called from the subscriber");
            pub.Raise();
            Console.WriteLine("Changes happened with using event syntax:");
            Console.WriteLine("1:We are no longer using a public property but a public field which due to event syntax is protected by compiler from unwanted access");
            Console.WriteLine("2:Event cannot be assigned to = operator instead of +=");
            Console.WriteLine("3:No outside uers can raise the event");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            OneWorkXmls xmls = new OneWorkXmls();

            xmls.RetrieveAll();

            string pageId = this.PageID;

            foreach (OneWorkXml item in xmls)
            {
                string url = string.Format("{0}.aspx?FK_Node={1}&WorkID={2}&FK_Flow={3}&FID={4}", item.No, this.FK_Node, this.WorkID, this.FK_Flow, this.FID);

                Pub1.AddLi(string.Format("<div{2}><a href='{0}'><span class='nav'>{1}</span></a></div>{3}", url, item.Name, item.No == pageId ? "  class='selected'" : "", Environment.NewLine));
            }
        }
        private void DecoratingActionWithEvent()
        {
            Console.WriteLine("Decorating Action with event attribute");
            Pub1 pub = new Pub1();
            pub.OnChange += () => Console.WriteLine("Called from method 1");
            pub.OnChange += () => Console.WriteLine("Called from method 2");
            //p.OnChange();
            Console.WriteLine("On Change cannot be called from the subscriber");
            pub.Raise();
            Console.WriteLine("Changes happened with using event syntax:");
            Console.WriteLine("1:We are no longer using a public property but a public field which due to event syntax is protected by compiler from unwanted access");
            Console.WriteLine("2:Event cannot be assigned to = operator instead of +=");
            Console.WriteLine("3:No outside uers can raise the event");


        }
示例#8
0
        void btn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(Pub1.GetTBByID("TB_SelectStatement").Text))
            {
                EasyUiHelper.AddEasyUiMessagerAndBack(this, "查询语句不能为空", "错误", "error");
                return;
            }

            string url = "SFGuide.aspx?Step=3&FK_SFDBSrc=" + this.FK_SFDBSrc + "&DDL_ColValue=" + this.Pub1.GetDDLByID("DDL_ColValue").SelectedItemStringVal;

            url += "&LB_Table=" + this.Pub1.GetLBByID("LB_Table").SelectedItemStringVal;
            url += "&DDL_ColText=" + this.Pub1.GetDDLByID("DDL_ColText").SelectedItemStringVal;
            url += "&DDL_ColParentNo=" + this.Pub1.GetDDLByID("DDL_ColParentNo").SelectedItemStringVal;
            url += "&TB_SelectStatement=" + Uri.EscapeDataString(Pub1.GetTBByID("TB_SelectStatement").Text);
            url += "&DDL_SFTableType=" + Pub1.GetDDLByID("DDL_SFTableType").SelectedItemStringVal;

            Response.Redirect(url, true);
        }
示例#9
0
        public void EditAutoJL()
        {
            //  string mypk= this.DoType
            string   mypk  = this.ExtType + "_" + this.FK_MapData + "_" + this.RefNo;
            MapExt   myme  = new MapExt(mypk);
            MapAttrs attrs = new MapAttrs(myme.FK_MapData);

            string[] strs = myme.Tag.Split('$');

            this.Pub1.AddTableNormal();
            this.Pub1.AddTRGroupTitle("<a href='TBFullCtrl.aspx?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a> - 设置级连菜单");

            foreach (MapAttr attr in attrs)
            {
                if (attr.LGType == FieldTypeS.Normal)
                {
                    continue;
                }
                if (attr.UIIsEnable == false)
                {
                    continue;
                }

                TextBox tb = new TextBox();
                tb.ID = "TB_" + attr.KeyOfEn;
                tb.Style.Add("width", "100%");
                tb.Columns  = 90;
                tb.Rows     = 4;
                tb.TextMode = TextBoxMode.MultiLine;

                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(attr.KeyOfEn + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                this.Pub1.AddTR();
                this.Pub1.AddTD(attr.Name + " " + attr.KeyOfEn + " 字段");
                this.Pub1.AddTREnd();

                this.Pub1.AddTR();
                this.Pub1.AddTD(tb);
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();

            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullJilian_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullJilian_Click);
            this.Pub1.Add(mybtn);
        }
示例#10
0
        /// <summary>
        /// 新建文本框自动完成
        /// </summary>
        public void EditAutoFullDtl_TB()
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapDtls dtls = new MapDtls(myme.FK_MapData);

            if (dtls.Count == 0)
            {
                this.Pub1.Clear();
                Pub1.AddEasyUiPanelInfo("设置自动填充从表", "<p>该表单下没有从表,所以您不能为从表设置自动填充。<a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a></p>");
                return;
            }

            Pub1.AddTableNormal();
            Pub1.AddTRGroupTitle("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");

            string[] strs = myme.Tag1.Split('$');
            foreach (MapDtl dtl in dtls)
            {
                TextBox tb = new TextBox();
                tb.ID      = "TB_" + dtl.No;
                tb.Columns = 70;
                tb.Style.Add("width", "100%");
                tb.Rows     = 5;
                tb.TextMode = TextBoxMode.MultiLine;
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(dtl.No + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                //this.Pub1.AddFieldSet("编号:" + dtl.No + ",名称:" + dtl.Name);
                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.Add("编号:" + dtl.No + ",名称:" + dtl.Name);
                Pub1.AddBR();
                Pub1.Add(tb);
                Pub1.AddBR();

                string   fs    = "可填充的字段:";
                MapAttrs attrs = new MapAttrs(dtl.No);
                foreach (MapAttr item in attrs)
                {
                    if (item.KeyOfEn == "OID" || item.KeyOfEn == "RefPKVal")
                    {
                        continue;
                    }
                    fs += item.KeyOfEn + ",";
                }

                this.Pub1.Add(fs.Substring(0, fs.Length - 1));
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
            }

            //this.Pub1.AddHR();
            Pub1.AddTableEnd();
            Pub1.AddBR();

            //Button mybtn = new Button();
            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullDtl_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullDtl_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddBR();
            //this.Pub1.AddFieldSetEnd();

            //this.Pub1.AddFieldSet("帮助:");
            Pub1.AddEasyUiPanelInfoBegin("帮助", "icon-help");
            this.Pub1.Add("在这里您需要设置一个查询语句");
            this.Pub1.AddBR("例如:SELECT XLMC AS suozaixianlu, bustype as V_BusType FROM [V_XLVsBusType] WHERE jbxx_htid='@Key'");
            this.Pub1.AddBR("这个查询语句要与从表的列对应上就可以在文本框的值发生改变时而自动填充。");
            this.Pub1.AddBR("注意:");
            this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
            this.Pub1.AddBR("2,从表列字段字名,与填充sql列字段大小写匹配。");
            //this.Pub1.AddFieldSetEnd();
            Pub1.AddEasyUiPanelInfoEnd();
        }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //  BP.Sys.MapData.GenerSpanHeight(null, 2);
            BP.WF.Flow fl  = new BP.WF.Flow(this.FK_Flow);
            string     sql = "SELECT Title FROM " + fl.PTable + " WHERE OID=" + this.WorkID;

            if (this.FID != 0)
            {
                sql = "SELECT Title FROM " + fl.PTable + " WHERE OID=" + this.FID;
            }
            string title = BP.DA.DBAccess.RunSQLReturnStringIsNull(sql, null);

            if (title == null)
            {
                this.Pub1.AddFieldSet("错误", "系统出现异常,请联系管理员。");
            }

            this.Title = "工作抄送";
            this.Pub1.AddTable("width='100%' border=1");
            this.Pub1.AddCaptionLeft("请选择或者输入人员(多个人员用逗号隔开),然后点发送按钮...");
            this.Pub1.AddTR();
            //this.Pub1.AddTDTitle("接受人:");
            this.Pub1.Add("<TD style='text-align:center;' width='20%' valign='middle'><h5>接受人:</h5></TD>");

            HiddenField hidden = new HiddenField();

            hidden.ID = "HID_SelectedEmps";

            TextBox tb = new TextBox();

            tb.ID    = "TB_Accepter";
            tb.Width = 500;

            Pub1.AddTDBegin("width='530'");
            Pub1.Add(tb);
            Pub1.Add(hidden);
            Pub1.AddTDEnd();

            Button mybtn = new Button();

            mybtn.CssClass       = "Btn";
            mybtn.Text           = "选择接受人";
            mybtn.OnClientClick += "javascript:ShowIt(" + tb.ClientID + "," + hidden.ClientID + ");";
            this.Pub1.AddTD(mybtn);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            //this.Pub1.AddTDTitle("标题:");
            this.Pub1.Add("<TD style='text-align:center;' valign='middle'><h5>标题:</h5></TD>");
            tb       = new TextBox();
            tb.ID    = "TB_Title";
            tb.Width = 500;
            tb.Text  = title;
            this.Pub1.AddTD(" colspan=2", tb);
            //this.Pub1.AddTD();
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            //this.Pub1.AddTDTitle("消<BR>息<BR>内<br>容");
            this.Pub1.Add("<TD style='text-align:center;' valign='middle'><h5>消<BR><BR>息<BR><BR>内<br><BR>容</h5></TD>");
            tb          = new TextBox();
            tb.ID       = "TB_Doc";
            tb.Width    = 500;
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Rows     = 12;
            this.Pub1.AddTD(" colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTD("");
            Button btn = new Button();

            btn.CssClass = "Btn";
            btn.ID       = "btn";
            btn.Click   += new EventHandler(btn_Click);
            btn.Text     = "执行抄送";
            this.Pub1.AddTD(" colspan=2", btn);
            //this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
示例#12
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");
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string receiver = this.Request.QueryString["RE"];
            string mypk     = this.Request.QueryString["MyPK"];

            BP.WF.SMS sms = null;
            if (mypk != null)
            {
                sms      = new SMS();
                sms.MyPK = mypk;
                sms.RetrieveFromDBSources();
            }

            this.Pub1.AddTable();            // (" id='recTable' class='Table' cellpadding='0' cellspacing='0' border='0' style='width:100%;margin-left:auto;margin-right:auto;' ");
            this.Pub1.AddCaptionMsg("消息回复"); //("<caption><div class='CaptionMsg'>消息</div></caption>");
            this.Pub1.AddTR();
            this.Pub1.AddTD("接受人:");

            TB tb = new TB();

            tb.ID    = "rec";
            tb.Width = 430;
            if (!string.IsNullOrEmpty(receiver) && !string.IsNullOrEmpty(mypk))
            {
                Emp emp = new Emp(receiver);
                tb.Text     = emp.Name;
                tb.ReadOnly = true;
                this.Pub1.AddTD(tb);
            }
            else
            {
                this.Pub1.AddTDBegin();
                this.Pub1.Add(tb);

                HiddenField hid = new HiddenField();
                hid.ID = "Hid_FQR";
                Pub1.Add(hid);

                this.Pub1.Add("<a onclick=\"openSelectEmp('" + hid.ClientID + "','" + tb.ClientID + "')\" href='javascript:;'>添加人员</a>");
                this.Pub1.AddTDEnd();
            }
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("标题");
            tb    = new TB();
            tb.ID = "title";
            if (sms != null)
            {
                tb.Text = "RE:" + sms.Title;
            }

            tb.Width = 430;
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTD("正文");
            tb          = new TB();
            tb.ID       = "con";
            tb.TextMode = TextBoxMode.MultiLine;
            tb.Width    = 430;
            tb.Height   = 120;

            if (sms != null)
            {
                tb.Text = "\t\n ------------------ \t\n " + sms.DocOfEmail;
            }

            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();


            this.Pub1.AddTR();
            this.Pub1.AddTDBegin(" colspan=2 ");
            Button btn = new Button();

            btn.ID     = "Btn_Save";
            btn.Text   = "发送";
            btn.Click += new EventHandler(btn_Save_Click);

            Button btnClose = new Button();

            btnClose.ID     = "Btn_Close";
            btnClose.Text   = "取消";
            btnClose.Click += new EventHandler(btnClose_Click);

            this.Pub1.Add(btn);
            this.Pub1.Add(btnClose);
            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();

            this.Pub1.AddTableEnd();
        }
示例#14
0
        void btn_Click(object sender, EventArgs e)
        {
            var pm = new PushMsg();

            pm.Retrieve(PushMsgAttr.FK_Event, this.Event, PushMsgAttr.FK_Node, this.NodeID);

            if (!string.IsNullOrWhiteSpace(pm.MyPK))
            {
                pm.Delete();
            }

            pm.FK_Event = this.Event;
            pm.FK_Node  = int.Parse(this.NodeID);

            var ddl = Pub1.GetDDLByID("DDL_" + PushMsgAttr.PushWay);

            pm.PushWay = ddl.SelectedItemIntVal;
            pm.PushDoc = string.Empty;

            switch ((PushWay)pm.PushWay)
            {
            case PushWay.ByParas:

                #region  照系统指定参数

                var rb = Pub1.GetRadioBtnByID("RB_0");

                if (rb.Checked)
                {
                    pm.PushDoc = "0";
                    pm.Tag     = Pub1.GetTBByID("TB_" + PushMsgAttr.Tag).Text;
                }
                else
                {
                    rb = Pub1.GetRadioBtnByID("RB_1");

                    if (rb.Checked)
                    {
                        pm.PushDoc = "1";
                    }

                    pm.Tag = Pub1.GetDDLByID("DDL_" + PushMsgAttr.Tag).SelectedItemStringVal;
                }

                #endregion

                break;

            case PushWay.NodeWorker:

                #region  照指定结点的工作人员

                CheckBox cb = null;

                foreach (var ctrl in Pub1.Controls)
                {
                    cb = ctrl as CheckBox;
                    if (cb == null || !cb.ID.StartsWith("CB_") || !cb.Checked)
                    {
                        continue;
                    }

                    pm.PushDoc += "@" + cb.ID.Substring(3) + "@";
                }

                #endregion

                break;

            case PushWay.SpecDepts:

                #region  照指定的部门

                foreach (var ctrl in Pub1.Controls)
                {
                    cb = ctrl as CheckBox;
                    if (cb == null || !cb.ID.StartsWith("CB_") || !cb.Checked)
                    {
                        continue;
                    }

                    pm.PushDoc += "@" + cb.ID.Substring(3) + "@";
                }

                #endregion

                break;

            case PushWay.SpecEmps:

                #region  照指定的人员

                var hid = Pub1.FindControl("HID_Users") as HiddenField;

                if (!string.IsNullOrWhiteSpace(hid.Value))
                {
                    pm.PushDoc = hid.Value.Split(',').Select(o => "@" + o + "@").Aggregate(string.Empty,
                                                                                           (curr, next) =>
                                                                                           curr + next);
                }
                //foreach (var ctrl in Pub1.Controls)
                //{
                //    cb = ctrl as CheckBox;
                //    if (cb == null || !cb.ID.StartsWith("CB_E_") || !cb.Checked) continue;

                //    pm.PushDoc += "@" + cb.ID.Substring(5) + "@";
                //}

                #endregion

                break;

            case PushWay.SpecSQL:

                #region  照指定的SQL查询语句

                pm.PushDoc = Pub1.GetTBByID("TB_" + PushMsgAttr.PushDoc).Text;

                #endregion

                break;

            case PushWay.SpecStations:

                #region  照指定的岗位

                foreach (var ctrl in Pub1.Controls)
                {
                    cb = ctrl as CheckBox;
                    if (cb == null || !cb.ID.StartsWith("CB_S_") || !cb.Checked)
                    {
                        continue;
                    }

                    pm.PushDoc += "@" + cb.ID.Substring(5) + "@";
                }

                #endregion

                break;
            }

            pm.Save();
            Response.Redirect(string.Format("ActionPush2Spec.aspx?NodeID={0}&MyPK={1}&Event={2}&FK_Flow={3}&tk={4}", NodeID, MyPK, Event,
                                            FK_Flow, new Random().NextDouble()), true);
        }
示例#15
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            /*BPM 模式*/
            BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
            tps.RetrieveAll();

            BP.GPM.Stations sts = new BP.GPM.Stations();
            sts.RetrieveAll();

            string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
            DataTable dt  = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count != 0)
            {
                if (tps.Count == 0)
                {
                    var stp = new BP.GPM.StationType {
                        No = "01", Name = "普通岗"
                    };
                    stp.Save();
                    tps.AddEntity(stp);
                }

                //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                foreach (BP.GPM.Station st in sts)
                {
                    st.FK_StationType = tps[0].No;
                    st.Update();
                }
            }

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            foreach (BP.GPM.StationType tp in tps)
            {
                this.Pub1.AddTR();
                CheckBox mycb = new CheckBox();
                mycb.Text = tp.Name;
                mycb.ID   = "CB_s_d" + tp.No;
                this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                this.Pub1.AddTREnd();

                int    i      = 0;
                string ctlIDs = "";

                foreach (BP.GPM.Station st in sts)
                {
                    if (st.FK_StationType != tp.No)
                    {
                        continue;
                    }

                    i++;

                    if (i == 4)
                    {
                        i = 1;
                    }

                    if (i == 1)
                    {
                        Pub1.AddTR();
                    }

                    CheckBox cb = new CheckBox();
                    cb.ID   = "CB_" + st.No;
                    ctlIDs += cb.ID + ",";
                    cb.Text = st.Name;
                    if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (i == 3)
                    {
                        Pub1.AddTREnd();
                    }
                }

                mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                switch (i)
                {
                case 1:
                    Pub1.AddTD();
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                case 2:
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                default:
                    break;
                }
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();

            #region //增加“指定的操作员”选项,added by liuxc,2015-10-7
            var ddl = new DDL();
            ddl.ID    = "DDL_" + CondAttr.SpecOperWay;
            ddl.Width = 200;
            ddl.Items.Add(new ListItem("当前操作员", "0"));
            ddl.Items.Add(new ListItem("指定节点的操作员", "1"));
            ddl.Items.Add(new ListItem("指定表单字段作为操作员", "2"));
            ddl.Items.Add(new ListItem("指定操作员编号", "3"));
            ddl.SetSelectItem((int)cond.SpecOperWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            Pub1.Add("指定的操作员:");
            Pub1.Add(ddl);
            Pub1.AddBR();
            Pub1.AddBR();

            var lbl = new Label();
            lbl.ID = "LBL1";

            switch (cond.SpecOperWay)
            {
            case SpecOperWay.SpecNodeOper:
                lbl.Text = "节点编号:";
                break;

            case SpecOperWay.SpecSheetField:
                lbl.Text = "表单字段:";
                break;

            case SpecOperWay.SpenEmpNo:
                lbl.Text = "操作员编号:";
                break;

            case SpecOperWay.CurrOper:
                lbl.Text = "参数:";
                break;
            }

            Pub1.Add(lbl);

            var tb = new TB();
            tb.ID      = "TB_" + CondAttr.SpecOperPara;
            tb.Width   = 200;
            tb.Text    = cond.SpecOperPara;
            tb.Enabled = cond.SpecOperWay != SpecOperWay.CurrOper;
            Pub1.Add(tb);
            Pub1.AddSpace(1);
            Pub1.Add("多个值请用英文“逗号”来分隔。");
            Pub1.AddBR();
            Pub1.AddBR();
            #endregion

            Pub1.AddSpace(1);
            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#16
0
        /// <summary>
        /// 加载选中表的所有列信息
        /// </summary>
        private void ShowSelectedTableColumns()
        {
            var src       = new SFDBSrc(this.FK_SFDBSrc);
            var colTables = src.GetColumns(this.Pub1.GetLBByID("LB_Table").SelectedItemStringVal);

            colTables.Columns.Add("text", typeof(string));

            var    cols = new List <string>();
            string type;
            var    length = 0;

            foreach (DataRow dr in colTables.Rows)
            {
                cols.Add(dr["name"].ToString());
                type   = dr["type"].ToString().ToLower();
                length = int.Parse(dr["length"].ToString());

                dr["text"] = dr["name"] + " (" + (LengthTypes.Contains(type) ?
                                                  (string.Format("{0}{1}", type,
                                                                 (length == -1 || length == 0) ?
                                                                 (MaxTypes.Contains(type) ? "(max)" : "")
                      : string.Format("({0})", length))) : type) + ")";
            }

            //自动判断是否符合规则
            var regColValue    = cols.FirstOrDefault(o => regs[0].Contains(o.ToLower()));
            var regColText     = cols.FirstOrDefault(o => regs[1].Contains(o.ToLower()));
            var regColParentNo = cols.FirstOrDefault(o => regs[2].Contains(o.ToLower()));

            var ddl = this.Pub1.GetDDLByID("DDL_ColValue");

            ddl.Items.Clear();
            ddl.Bind(colTables, "name", "text");

            if (regColValue != null)
            {
                ddl.SetSelectItem(regColValue);
            }

            ddl = this.Pub1.GetDDLByID("DDL_ColText");
            ddl.Items.Clear();
            ddl.Bind(colTables, "name", "text");

            if (regColText != null)
            {
                ddl.SetSelectItem(regColText);
            }

            ddl = this.Pub1.GetDDLByID("DDL_ColParentNo");
            ddl.Items.Clear();
            ddl.Bind(colTables, "name", "text");

            if (regColParentNo != null)
            {
                ddl.SetSelectItem(regColParentNo);
            }

            Pub1.GetTBByID("TB_SelectStatement").Text = string.Empty;
            Pub1.GetDDLByID("DDL_SFTableType").SetSelectItem((regColValue != null && regColText != null &&
                                                              regColParentNo != null)
                                                                  ? "1"
                                                                  : "0");
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            #region Step = 1

            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();


                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:请选择数据源");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                Pub1.AddLi("<div><a href='SFGuide.aspx?Step=12&FK_SFDBsrc=local'><img src='../../Img/New.gif' align='middle' /><span>创建本地编码字典表</span></a></div>");

                foreach (BP.Sys.SFDBSrc item in ens)
                {
                    Pub1.AddLi("<div><a href='SFGuide.aspx?Step=2&FK_SFDBSrc=" + item.No + "'><span class='nav'>" + item.No + "  -  " + item.Name + "</span></a></div>");
                }

                Pub1.AddLi("<div><a href=\"javascript:WinOpen('../RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");

                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                Pub1.AddTableEnd();
            }
            #endregion

            #region Step = 2

            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 表/视图'\" style='width:200px;'>",
                                       src.No));

                var lb = new LB();
                lb.ID = "LB_Table";
                lb.BindByTableNoName(src.GetTables());
                lb.Style.Add("width", "100%");
                lb.Style.Add("height", "100%");
                lb.AutoPostBack          = true;
                lb.SelectedIndexChanged += new EventHandler(lb_SelectedIndexChanged);
                Pub1.Add(lb);

                Pub1.AddDivEnd();

                Pub1.Add("<div data-options=\"region:'center',title:'第2步:请填写基础信息'\" style='padding:5px;'>");
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");

                var dbType = src.DBSrcType;
                if (dbType == DBSrcType.Localhost)
                {
                    switch (SystemConfig.AppCenterDBType)
                    {
                    case DBType.MSSQL:
                        dbType = DBSrcType.SQLServer;
                        break;

                    case DBType.Oracle:
                        dbType = DBSrcType.Oracle;
                        break;

                    case DBType.MySQL:
                        dbType = DBSrcType.MySQL;
                        break;

                    case DBType.Informix:
                        dbType = DBSrcType.Infomax;
                        break;

                    default:
                        throw new Exception("没有涉及到的连接测试类型...");
                    }
                }

                var islocal = (src.DBSrcType == DBSrcType.Localhost).ToString().ToLower();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "值(编号):");
                var ddl = new DDL();
                ddl.ID = "DDL_ColValue";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;编号列,比如:类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("标签(名称):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColText";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;显示的列,比如:类别名称");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("父结点值(字段):");
                ddl    = new DDL();
                ddl.ID = "DDL_ColParentNo";
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTDBegin();
                Pub1.Add(ddl);
                Pub1.Add("&nbsp;如果是树类型实体,该列设置有效,比如:上级类别编号");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("字典表类型:");

                ddl    = new DDL();
                ddl.ID = "DDL_SFTableType";
                ddl.SelfBindSysEnum(SFTableAttr.SFTableType);
                ddl.Attributes.Add("onchange", string.Format("generateSQL('{0}','{1}','{2}',{3})", src.No, src.DBName, dbType, islocal));
                Pub1.AddTD(ddl);
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDGroupTitle("查询语句:");
                var tb = new TB();
                tb.ID       = "TB_SelectStatement";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Columns  = 60;
                tb.Rows     = 10;
                tb.Style.Add("width", "99%");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("<br />&nbsp;说明:查询语句可以修改,但请保证查询语句的准确性及有效性!");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");

                Pub1.AddDivEnd();
                Pub1.AddDivEnd();

                if (!IsPostBack && lb.Items.Count > 0)
                {
                    lb.SelectedIndex = 0;
                    ShowSelectedTableColumns();
                }
            }
            #endregion

            #region Step = 12

            if (this.Step == 12)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第2步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Local_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion

            #region Step = 3

            if (this.Step == 3)
            {
                Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("colspan='2'", "第3步:创建");
                Pub1.AddTREnd();

                TextBox tb = new TextBox();
                tb.ID = "TB_No";
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("style='width:100px'", "表英文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;必须以字母或者下画线开头");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.Name;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "表中文名称:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;显示的标签");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                tb    = new TextBox();
                tb.ID = "TB_" + SFTableAttr.TableDesc;
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "描述:");
                Pub1.AddTDBegin();
                Pub1.Add(tb);
                Pub1.Add("&nbsp;表描述");
                Pub1.AddTDEnd();
                Pub1.AddTREnd();

                Pub1.AddTableEnd();
                Pub1.AddBR();
                Pub1.AddBR();
                Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Apply, "执行创建");
                btn.Click += new EventHandler(btn_Create_Click);
                Pub1.Add(btn);
                Pub1.AddSpace(1);

                Pub1.Add("<a href='" + Request.UrlReferrer + "' class='easyui-linkbutton'>上一步</a>");
            }
            #endregion
        }
示例#18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var    workId  = Request.QueryString["WorkID"];
                var    fk_flow = Request.QueryString["FK_Flow"];
                var    fid     = Request.QueryString["FID"];
                string url     = string.Empty;

                url = "ChartTrack.htm?FID=" + fid + "&FK_Flow=" + fk_flow + "&WorkID=" + workId;
                //content.Attributes.Add("src", url);
            }
            catch (Exception ee)
            {
                Response.Write("轨迹图加载错误:" + ee.Message);
            }

            string isZhidu = this.Request.QueryString["isZhiDu"];

            if (string.IsNullOrEmpty(isZhidu) == false)
            {
                string zhiduNo = this.Request.QueryString["ZhiDuNo"];
                if (!string.IsNullOrEmpty(zhiduNo))
                {
                    try
                    {
                        //BP.MS.ZhiDu zhidu = new BP.MS.ZhiDu();
                        //zhidu.No = zhiduNo;
                        //zhidu.Retrieve();

                        GenerWorkFlow workflow = new GenerWorkFlow();
                        workflow.WorkID = 0;// Int64.Parse(zhidu.OID);
                        workflow.Retrieve();
                        this.Response.Redirect("Ath.aspx?FK_Flow=" + workflow.FK_Flow + "&WorkID=" + workflow.WorkID + "&FID=" + workflow.FID + "&FK_Node=" + workflow.FK_Node, true);

                        return;
                    }
                    catch (Exception)
                    {
                        throw new Exception("该流程未完成或未找到对应的流程数据!");
                    }
                }
            }

            string flowID = int.Parse(this.FK_Flow).ToString();
            string sql    = "";

            if (string.IsNullOrEmpty(FK_Node))
            {
                sql = "SELECT * FROM Sys_FrmAttachmentDB WHERE FK_FrmAttachment IN (SELECT MyPK FROM Sys_FrmAttachment WHERE  " + BP.WF.Glo.MapDataLikeKey(this.FK_Flow, "FK_MapData") + "  AND IsUpload=1) AND RefPKVal='" + this.OID + "' ORDER BY RDT";
            }
            else
            {
                sql = "SELECT * FROM Sys_FrmAttachmentDB WHERE FK_FrmAttachment IN (SELECT MyPK FROM Sys_FrmAttachment WHERE  FK_MapData='ND" + FK_Node + "' ) AND RefPKVal='" + this.OID + "' ORDER BY RDT";
            }

            //string sql = "SELECT * FROM Sys_FrmAttachmentDB WHERE FK_FrmAttachment IN (SELECT MyPK FROM Sys_FrmAttachment WHERE  FK_MapData ='ND"+FK_Node+"'  AND IsUpload=1) AND RefPKVal='" + this.OID + "' ORDER BY RDT";
            DataTable dt = DBAccess.RunSQLReturnTable(sql);

            if (dt.Rows.Count > 0)
            {
                this.Pub1.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width: 100%'");
                this.Pub1.AddTR();
                this.Pub1.AddTDGroupTitle("style='text-align:center'", "序");
                this.Pub1.AddTDGroupTitle("附件编号");
                this.Pub1.AddTDGroupTitle("节点");
                this.Pub1.AddTDGroupTitle("名称");
                this.Pub1.AddTDGroupTitle("大小(kb)");
                this.Pub1.AddTDGroupTitle("上传人");
                this.Pub1.AddTDGroupTitle("上传日期");
                this.Pub1.AddTREnd();
                int i = 0;

                foreach (DataRow dr in dt.Rows)
                {
                    i++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(i);
                    this.Pub1.AddTD(dr["FK_FrmAttachment"].ToString());
                    string nodeName = "";
                    try
                    {
                        int  nodeID = int.Parse(dr["NodeID"].ToString());
                        Node node   = new Node(nodeID);
                        nodeName = node.Name;
                    }
                    catch
                    {
                    }

                    this.Pub1.AddTD(nodeName);
                    this.Pub1.AddTD("<a href='/WF/CCForm/AttachmentUpload.aspx?DoType=Down&MyPK=" + dr["MyPK"] + "' target=_sd ><img src='/WF/Img/FileType/" + dr["FileExts"] + ".gif' onerror=\"this.src='/WF/Img/FileType/Undefined.gif'\" border=0/>" + dr["FileName"].ToString() + "</a>");
                    this.Pub1.AddTD(dr["FileSize"].ToString());
                    this.Pub1.AddTD(dr["RecName"].ToString());
                    this.Pub1.AddTD(dr["RDT"].ToString());
                    this.Pub1.AddTREnd();
                }
                this.Pub1.AddTableEnd();
            }

            Bills bills = new Bills();

            bills.Retrieve(BillAttr.WorkID, this.OID);
            if (bills.Count > 0)
            {
                this.Pub1.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width: 100%'");
                this.Pub1.AddTR();
                this.Pub1.AddTDGroupTitle("style='text-align:center'", "序");
                this.Pub1.AddTDGroupTitle("名称");
                this.Pub1.AddTDGroupTitle("节点");
                this.Pub1.AddTDGroupTitle("打印人");
                this.Pub1.AddTDGroupTitle("日期");
                this.Pub1.AddTDGroupTitle("功能");
                this.Pub1.AddTREnd();
                int idx = 0;
                foreach (Bill bill in bills)
                {
                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(bill.FK_BillTypeT);
                    this.Pub1.AddTD(bill.FK_NodeT);
                    this.Pub1.AddTD(bill.FK_EmpT);
                    this.Pub1.AddTD(bill.RDT);
                    this.Pub1.AddTD("<a class='easyui-linkbutton' data-options=\"iconCls:'icon-print'\" href='" + this.Request.ApplicationPath + "WF/Rpt/Bill.aspx?MyPK=" + bill.MyPK + "&DoType=Print' >打印</a>");
                    this.Pub1.AddTREnd();
                }
                this.Pub1.AddTableEnd();
            }


            int num = bills.Count + dt.Rows.Count;

            if (num == 0)
            {
                Pub1.AddEasyUiPanelInfo("提示", "<h3>当前流程没有数据,或者该流程没有附件或者单据。</h3>");
            }
        }
示例#19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MapData ath = new MapData(this.FK_MapData);



            #region WebOffice控制方式.
            this.Pub1.AddTable("class='Table' cellpadding='0' cellspacing='0' border='0' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("colspan=3", "WebOffice控制方式.");
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            CheckBox cb = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableWF;
            cb.Text    = "是否启用weboffice?";
            cb.Checked = ath.IsWoEnableWF;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSave;
            cb.Text    = "是否启用保存?";
            cb.Checked = ath.IsWoEnableSave;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableReadonly;
            cb.Text    = "是否只读?";
            cb.Checked = ath.IsWoEnableReadonly;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableRevise;
            cb.Text    = "是否启用修订?";
            cb.Checked = ath.IsWoEnableRevise;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableViewKeepMark;
            cb.Text    = "是否查看用户留痕?";
            cb.Checked = ath.IsWoEnableViewKeepMark;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnablePrint;
            cb.Text    = "是否打印?";
            cb.Checked = ath.IsWoEnablePrint;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableOver;
            cb.Text    = "是否启用套红?";
            cb.Checked = ath.IsWoEnableOver;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableSeal;
            cb.Text    = "是否启用签章?";
            cb.Checked = ath.IsWoEnableSeal;
            this.Pub1.AddTD(cb);

            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableTemplete;
            cb.Text    = "是否启用模板文件?";
            cb.Checked = ath.IsWoEnableTemplete;
            this.Pub1.AddTD(cb);

            this.Pub1.AddTREnd();
            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableCheck;
            cb.Text    = "是否记录节点信息?";
            cb.Checked = ath.IsWoEnableCheck;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFlow;
            cb.Text    = "是否启用插入流程?";
            cb.Checked = ath.IsWoEnableInsertFlow;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableInsertFengXian;
            cb.Text    = "是否启用插入风险点?";
            cb.Checked = ath.IsWoEnableInsertFengXian;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTR();
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableMarks;
            cb.Text    = "是否进入留痕模式?";
            cb.Checked = ath.IsWoEnableMarks;
            this.Pub1.AddTD(cb);
            cb         = new CheckBox();
            cb.ID      = "CB_" + FrmAttachmentAttr.IsWoEnableDown;
            cb.Text    = "是否启用下载?";
            cb.Checked = ath.IsWoEnableDown;
            this.Pub1.AddTD(cb);
            this.Pub1.AddTD("");
            this.Pub1.AddTREnd();
            #endregion WebOffice控制方式.

            //确定模板文件
            string moduleFile = getModuleFile(new[] { ".doc", ".docx" });

            Pub1.AddTR();
            Pub1.AddTDBegin("colspan='3'");
            this.Pub1.Add("模版文件(必须是*.doc/*.docx文件):");

            Literal lit = new Literal();
            lit.ID = "litInfo";

            if (!string.IsNullOrEmpty(moduleFile))
            {
                lit.Text = "[<span style='color:green'>已上传Word表单模板:<a href='" + moduleFile +
                           "' target='_blank' title='下载或打开模版'>" + moduleFile +
                           "</a></span>]<br /><br />";

                this.Pub1.Add(lit);
            }
            else
            {
                lit.Text = "[<span style='color:red'>还未上传Word表单模板</span>]<br /><br />";
                this.Pub1.Add(lit);
            }

            FileUpload fu = new FileUpload();
            fu.ID    = "FU";
            fu.Width = 300;
            this.Pub1.Add(fu);
            this.Pub1.AddSpace(2);
            LinkBtn btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_SaveWordFrm_Click);
            this.Pub1.Add(btn);

            this.Pub1.AddTDEnd();
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
示例#20
0
        void btn_Save_Click(object sender, EventArgs e)
        {
            Cond cond = new Cond();

            cond.Delete(CondAttr.NodeID, this.FK_MainNode,
                        CondAttr.ToNodeID, this.ToNodeID,
                        CondAttr.CondType, (int)this.HisCondType);

            var btn = sender as LinkBtn;

            if (btn.ID == NamesOfBtn.Delete)
            {
                this.Response.Redirect(this.Request.RawUrl, true);
                return;
            }

            // 删除岗位条件.
            cond.MyPK = this.GenerMyPK;

            if (cond.RetrieveFromDBSources() == 0)
            {
                cond.HisDataFrom = ConnDataFrom.Stas;
                cond.NodeID      = this.FK_MainNode;
                cond.FK_Flow     = this.FK_Flow;
                cond.ToNodeID    = this.ToNodeID;
                cond.Insert();
            }

            string   val = "";
            Stations sts = new Stations();

            sts.RetrieveAllFromDBSource();

            foreach (Station st in sts)
            {
                if (this.Pub1.IsExit("CB_" + st.No) == false)
                {
                    continue;
                }
                if (this.Pub1.GetCBByID("CB_" + st.No).Checked)
                {
                    val += "@" + st.No;
                }
            }

            if (val == "")
            {
                cond.Delete();
                return;
            }

            val += "@";
            cond.OperatorValue = val;
            cond.HisDataFrom   = ConnDataFrom.Stas;
            cond.FK_Flow       = this.FK_Flow;
            cond.HisCondType   = this.HisCondType;
            cond.FK_Node       = this.FK_MainNode;

            #region //获取“指定的操作员”设置,added by liuxc,2015-10-7
            cond.SpecOperWay = (SpecOperWay)Pub1.GetDDLByID("DDL_" + CondAttr.SpecOperWay).SelectedItemIntVal;

            if (cond.SpecOperWay != SpecOperWay.CurrOper)
            {
                cond.SpecOperPara = Pub1.GetTBByID("TB_" + CondAttr.SpecOperPara).Text;
            }
            else
            {
                cond.SpecOperPara = string.Empty;
            }
            #endregion

            switch (this.HisCondType)
            {
            case CondType.Flow:
            case CondType.Node:
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            case CondType.Dir:
                cond.ToNodeID = this.ToNodeID;
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            case CondType.SubFlow:
                cond.ToNodeID = this.ToNodeID;
                cond.Update();
                this.Response.Redirect("CondStation.aspx?MyPK=" + cond.MyPK + "&FK_Flow=" + cond.FK_Flow + "&FK_Node=" + cond.FK_Node + "&FK_MainNode=" + cond.NodeID + "&CondType=" + (int)cond.HisCondType + "&FK_Attr=" + cond.FK_Attr + "&ToNodeID=" + this.Request.QueryString["ToNodeID"], true);
                return;

            default:
                throw new Exception("未设计的情况。");
            }
        }
示例#21
0
文件: Program.cs 项目: returnres/exam
        static void Main(string[] args)
        {
            testa te = new testa();

            te.faccio(3);

            #region opertori
            PippoTest pippoTest  = new PippoTest(1);
            PippoTest pippoTest1 = new PippoTest(2);
            PippoTest pippoTest2 = new PippoTest(2);
            //implicit
            int testt = pippoTest2;
            //explicit
            PippoTest testtt = (PippoTest)3;

            //somma tra pippotest
            var rrrr = pippoTest1 + pippoTest;
            var ssss = pippoTest2++;

            //somma tra int e pippotest
            var ressss = 3 + testtt;
            #endregion

            #region TraceSource

            /*
             * LISTNER
             *
             * ConsoleTraceListener	Standard output or error stream
             * DelimitedListTraceListener	TextWriter
             * EventLogTraceListener	EventLog
             * EventSchemaTraceListener	XML-encoded, schema-compliant log file
             * TextWriterTraceListener	TextWriter
             * XmlWriterTraceListener	XML-encoded data to a TextWriter or stream.
             */
            //configuro da codice
            Stream outfile = File.Create("log.txt");
            //creo listner
            TextWriterTraceListener textWriterTraceListener = new TextWriterTraceListener(outfile);
            TraceSource             traceSource             = new TraceSource("myT", SourceLevels.All);

            //cancello quello di default
            traceSource.Listeners.Clear();
            //aggiungo mio
            traceSource.Listeners.Add(textWriterTraceListener);

            traceSource.TraceInformation("");
            traceSource.TraceEvent(TraceEventType.Critical, 0, "");
            traceSource.TraceData(TraceEventType.Information, 1, "");
            traceSource.Flush();
            traceSource.Close();

            //TraceSource configuro da appsetting
            mySource.TraceEvent(TraceEventType.Error, 1,
                                "Error message.");
            mySource.TraceEvent(TraceEventType.Warning, 2,
                                "Warning message.");

            #endregion

            #region BooleanSwitch
            var sw = new System.Diagnostics.BooleanSwitch("QueryLogger", "QueryLogger");
            if (sw.Enabled)
            {
                Console.WriteLine("Booleanswitchenabled");
            }
            #endregion

            #region TraceSwitch

            /*
             * SourceSwitch e TraceSwitch sono altri due tipi di switch che servono a controllare
             * la verbosità del trace e la “sorgente” del trace.
             * Ovvero, se usi il tracing in maniera seria puoi, grazie al SourceSwitch,
             * definire varie sorgenti di tracing e regolarle a tua discrezione con il TraceSwitch.
             */
            ////Define this in the web config
            TraceSwitch generalSwitch = new TraceSwitch("General",
                                                        "Entire Application");

            string msgText = "1";

            // Write INFO type message, if switch is set to Verbose, type 4
            Trace.WriteIf(generalSwitch.TraceVerbose, msgText);

            msgText = "A2MC";

            // Write INFO type message, if switch is set to Verbose or Warning 4 0r 2
            Trace.WriteIf(generalSwitch.TraceWarning, msgText);

            // Write ERROR type message, if switch is set to Verbose, Warning, info or Error
            // 0 (off), 1 (error), 2 (warning), 3 (info), OR 4 (verbose)
            //If General switch in WEB CONFIG = 0 then it will not get into the if below
            if (generalSwitch.TraceError)
            {
                //Trace type, inthis case error will define how it will appear in the event log
                Trace.TraceError("Error");
                //Use your imagination to switch it on and off properly.
                //You can really imagine and apply.
            }
            #endregion

            #region EventLog
            if (!EventLog.SourceExists("Mysource"))
            {
                EventLog.CreateEventSource("MySource", "MyLog");
            }

            EventLog eventLog = new EventLog();
            eventLog.Source = "MySource";
            eventLog.WriteEntry("Ciao J0n");
            #endregion

            #region PerformanceCounter

            /* CounterCreationDataCollection
             * CounterCreationData (PerformanceCounterType)
             * PerformanceCounterCategory (si prende il collection che si prende il data) (PerformanceCounterCategoryType)
             * PerformanceCounter
             */

            var performanceCounterCategories = PerformanceCounterCategory.GetCategories();
            var first = performanceCounterCategories.FirstOrDefault(category => category.CategoryName == "Processor");

            var performanceCounters = first.GetCounters("_Total");

            Console.WriteLine("Displaying performance counters for Processor category:--\n");

            foreach (PerformanceCounter performanceCounter in performanceCounters)
            {
                Console.WriteLine(performanceCounter.CounterName);
            }

            //v2custom
            String customCategoryName = "Custom Performance Counter Category";
            string counterNameCustom  = "pippo";
            if (!PerformanceCounterCategory.Exists(customCategoryName))
            {
                CounterCreationDataCollection counterCreationDataCollection = new CounterCreationDataCollection();
                counterCreationDataCollection.Add(new CounterCreationData(counterNameCustom, "Sample Counter 1", PerformanceCounterType.ElapsedTime));
                //counterCreationDataCollection.Add(new CounterCreationData("Counter 2", "Sample Counter 2", PerformanceCounterType.SampleCounter));
                PerformanceCounterCategory.Create(customCategoryName, "This is just an example", PerformanceCounterCategoryType.SingleInstance, counterCreationDataCollection);
                var counter = new PerformanceCounter(customCategoryName, counterNameCustom, false);
                counter.Increment();
            }
            using (var counter = new PerformanceCounter(customCategoryName, counterNameCustom, false))
            {
                counter.Increment();
            }

            //v2custom
            string counterName  = "countername";
            string categoryName = "categoryname";
            if (!PerformanceCounterCategory.Exists("categoryname"))
            {
                CounterCreationDataCollection datacollection = new CounterCreationDataCollection();

                CounterCreationData numberOfItems = new CounterCreationData();
                numberOfItems.CounterType = PerformanceCounterType.NumberOfItems32;
                numberOfItems.CounterName = counterName;
                datacollection.Add(numberOfItems);

                // Create the category.
                PerformanceCounterCategory.Create(categoryName,
                                                  "Demonstrates usage of the AverageTimer32 performance counter type",
                                                  PerformanceCounterCategoryType.SingleInstance, datacollection);

                var counter = new PerformanceCounter(categoryName, counterName, false);

                counter.RawValue = 0;
                counter.Increment();
            }
            using (var counter = new PerformanceCounter(categoryName, counterName, false))
            {
                counter.Increment();
            }
            #endregion

            #region  OOP
            MyMethodCond();

            string main = "Main";
            Trace.Write("trace");
            Debug.Write("debug");
            Debug.Assert(main == "Main");

            Ciccio c = new Ciccio();
            c.Prova();
            ICiccio s = (ICiccio)c;
            s.Prova();
            ICiccio1 s1 = (ICiccio1)c;
            s1.Prova();
            c.Nano();

            double xxx = 0.0;
            double yyy = 0.0;
            //var reszzzz = xxx / yyy;NAN
            IIbabbo babbo11 = new Figliolo();
            babbo11.MioMetodo();

            Mio("ciao");
            Mio("ciao", paperino: 1);
            Mio("ciao", pluto: true, paperino: 1);
            //Mio("ciao",pluto:false,1);ERRORE
            //Pippo pippos = new Pippo();
            //pippos.DoSOmething();

            #endregion

            #region  GENERZIONE DINAMICA CODICE

            /*
             *
             * //System.Reflection.Emit
             * //creazione , lancio e salvataggoi IL a runtime
             * AssemblyName nameAss = new AssemblyName("DynamicAss");
             * AssemblyBuilder assemblyBuilder =
             *  AppDomain.CurrentDomain.DefineDynamicAssembly(nameAss, AssemblyBuilderAccess.RunAndSave);
             * ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("DynamicMod", "DynamicAss.dll");
             * //classe
             * TypeBuilder tb = moduleBuilder.DefineType("HelloClass", TypeAttributes.Class | TypeAttributes.Public);
             * //metodo
             * MethodBuilder mb =
             *  tb.DefineMethod("PrintHello", MethodAttributes.Public, null, new Type[] { typeof(string) });
             * ILGenerator myGenerator = mb.GetILGenerator();
             * myGenerator.Emit(OpCodes.Ldstr, "Hello");
             * myGenerator.Emit(OpCodes.Ldarg_1);
             * MethodInfo concatMetod = typeof(String).GetMethod("Concat", new Type[] { typeof(string), typeof(string) });
             * myGenerator.Emit(OpCodes.Call, concatMetod);
             * MethodInfo wrMethodInfo = typeof(Console).GetMethod("Write", new Type[] { typeof(string) });
             * myGenerator.Emit(OpCodes.Call, wrMethodInfo);
             * myGenerator.Emit(OpCodes.Ret);
             *
             * //istanzio ogetto
             * Type helloType = tb.CreateType();
             * object helloobj = Activator.CreateInstance(helloType);
             * MethodInfo hellMethodInfo = helloType.GetMethod("PrintHello", new[] { typeof(string) });
             *
             * //invoco metodo passando parametro
             * hellMethodInfo.Invoke(helloobj, new object[] { "J0n" });
             *
             * //salvo dll
             * assemblyBuilder.Save("DynamicAss.dll");
             #endregion
             *
             * HelloClass  helloClass = new HelloClass();
             * helloClass.PrintHello("ciao");
             */


            //System.CodeDom
            //creare  salvare e compilare  codice sorgente e runtime
            CodeCompileUnit codeCompileUnit = new CodeCompileUnit();
            CodeNamespace   codeNamespace   = new CodeNamespace("CodeDOM");
            codeNamespace.Imports.Add(new CodeNamespaceImport("System"));
            //classe
            CodeTypeDeclaration myclass = new CodeTypeDeclaration("Pippo");

            //metodo
            CodeMemberMethod codeMemberMethod = new CodeMemberMethod();
            codeMemberMethod.Name       = "DoSOmething";
            codeMemberMethod.Attributes = MemberAttributes.Public;
            CodeMethodInvokeExpression codeMethodInvokeExpression = new CodeMethodInvokeExpression(
                new CodeTypeReferenceExpression("Console"), "WriteLine", new CodePrimitiveExpression("Ciao Ciccio"));
            CodeMethodInvokeExpression codeMethodInvokeExpression1 = new CodeMethodInvokeExpression(
                new CodeTypeReferenceExpression("Console"), "ReadLine");
            codeCompileUnit.Namespaces.Add(codeNamespace);
            codeNamespace.Types.Add(myclass);
            myclass.Members.Add(codeMemberMethod);
            codeMemberMethod.Statements.Add(codeMethodInvokeExpression);
            codeMemberMethod.Statements.Add(codeMethodInvokeExpression1);

            //salva codice sorgente
            CSharpCodeProvider provider = new CSharpCodeProvider();

            string pathSource = @"../../bin/Debug/Pippo.cs";
            string pathOut    = @"../../bin/Debug/Pippos.dll";

            //string pathSource = @"../../autogenerated/Pippo.cs";
            //string pathOut = @"../../autogenerated/Pippos.exe";
            using (StreamWriter stream = new StreamWriter(pathSource, false))
            {
                IndentedTextWriter tw = new IndentedTextWriter(stream, "   ");
                provider.GenerateCodeFromCompileUnit(codeCompileUnit, tw, new CodeGeneratorOptions());
                tw.Close();
            }

            CompileCSharpCode(pathSource, pathOut);

            #endregion

            #region reflection
            //REFLECTION System.Assembly
            //assembly (IL codice compilato) exe/dll
            //carico in memoria assembly

            //PLUGIN
            //caricamento dinamico  assembly da path
            Assembly assm = Assembly.LoadFrom(@"C:\Users\rob\source\repos\Exam\Plugin1\bin\Debug\Plugin1.dll");
            Type[]   tips = assm.GetTypes();
            foreach (var item in tips)
            {
                //var objectType = Type.GetType(objectToInstantiate);
                Type objectType         = assm.GetType(item.FullName);
                var  instantiatedObject = Activator.CreateInstance(objectType);
            }
            //carica solo metadati dei tipi SENZA instanziare i tipi
            Assembly ass2 = Assembly.ReflectionOnlyLoadFrom("ClassLibrary1.dll");

            //var instantiatedObject1 = Activator.CreateInstance(typeof(Tipo));
            //var instantiatedObject2 = Activator.CreateInstance<Tipo>;
            string sss = new String(new char[3]);
            //assembly attualmente in esecuzione
            Assembly ass             = Assembly.GetExecutingAssembly();
            Assembly ass1            = Assembly.GetAssembly(typeof(string));
            Assembly ass12           = Assembly.GetAssembly(sss.GetType());
            var      mytype          = ass.GetType("ConsoleApp1.Program");
            var      fullname        = ass.FullName;
            var      nome            = mytype.Name;
            var      mytypeNamespace = mytype.Namespace;

            var typeinfo = typeof(MiaclasseProva).GetTypeInfo();
            var name     = typeinfo.FullName;

            //ottengo tipo classe
            MiaclasseProva miaclasseProva = new MiaclasseProva();

            var typeinfo1 = miaclasseProva.GetType().GetTypeInfo();

            //ottengo interafccia
            var interfaccie = typeinfo1.GetInterfaces();

            //ottengo metodi e parametri
            MethodInfo[] metodi = typeinfo1.GetMethods(BindingFlags.Instance);
            foreach (var metodo in metodi)
            {
                var pi = metodo.GetParameters();
                foreach (var parinfo in pi)
                {
                    Console.WriteLine($" parametro : {parinfo.ParameterType.Name}");
                }
            }

            //ottengo membri
            MemberInfo[] membri = typeinfo1.GetMembers(BindingFlags.Public | BindingFlags.NonPublic);
            foreach (var mambro in membri)
            {
                var mi = mambro.MemberType;
            }
            #endregion

            #region IComparable
            //confrontare oggetti
            ComparableMoto comparableMoto = new ComparableMoto();
            comparableMoto.Targa = "pippo";
            ComparableMoto comparableMoto1 = new ComparableMoto();
            comparableMoto1.Targa = "pluto";

            int ord = comparableMoto.CompareTo(comparableMoto1);

            List <ComparableMoto> comparableMotos = new List <ComparableMoto>();
            comparableMotos.Add(new ComparableMoto()
            {
                Targa = "A"
            });
            comparableMotos.Add(new ComparableMoto()
            {
                Targa = "B"
            });
            comparableMotos.Add(new ComparableMoto()
            {
                Targa = "C"
            });
            comparableMotos.Sort();

            //AppDomain.CurrentDomain.UnhandledException += OnUnhandleException;
            //ManageException manage = new ManageException();
            //manage.GeneroEccezioneNonGestita();
            #endregion

            #region ref out static class
            Figlio   figlio1  = new Figlio();
            Figlio   figlio   = new Figlio("as");
            Macchina macchina = new Macchina("320", "bmw");
            macchina.Parti();
            SmartPhone.Battery     battery = new SmartPhone.Battery();
            ConstructorStaticClass constructorStaticClass = new ConstructorStaticClass();
            ConstructorStaticClass miaclasse2             = new ConstructorStaticClass();
            Console.WriteLine(ConstructorStaticClass.contatore);
            ClassTest1 babbo   = new ClassTest1();
            var        testref = 0;
            double     resp2;
            double     resp3;

            //ref
            babbo.cambiaNumero(ref testref);
            //out scarta valore resp3
            babbo.potenza(2, out resp2, out _);
            var media = babbo.CalcolaMedia(18, 27, 27, 27);
            babbo.ParametriNome(nome: "rob", anni: 43);

            //c#7
            //double xresp2;
            //double xresp3;
            //babbo.potenza1(2,  xresp2,  xresp3);

            int x1 = 0;
            //block
            if (x1 == 0)//expression
            {
                //codice
            }

            int?    nullable = null;
            var     cliente  = new { nome = "rob" };
            Mesi    giorno   = Mesi.febbraio;
            int     mese     = (int)Mesi.febbraio;
            Mesi    mese1    = (Mesi)1;
            Pippolo pippo;
            pippo.a = 1;


            #endregion

            #region cast box unbox
            //cast
            int     i     = 123;
            object  box   = i;
            int     n     = (int)box;//unbox
            dynamic dd    = 1;
            int     inc   = dd + 1;
            var     ssss1 = Convert.ToString(1);
            dynamic dy    = new ExpandoObject();
            #endregion

            #region type

            //OTTENGO IL TIPO
            //GetType
            var  ti = typeof(string).GetTypeInfo();
            Type ts = Type.GetType("System.String");//se si trova in Mscorelib.dll

            TestClass tc   = new TestClass();
            Type      tipo = tc.GetType();

            //typeof
            Type type = typeof(Type);

            //CONTROLLO IL TIPO
            //is tipo | as tipo
            string obj = "";
            if (obj is string)
            {
                //cast ()
                string a  = (string)obj;   //se obj non è compatibile con string cast exception
                string a1 = obj as string; //se obj non compatobole con string ritorna null
            }


            #endregion

            #region array
            Console.WriteLine($"metodo {nameof(Main)}");

            /*
             * stack => vet
             * heap 1
             * heap 2
             * heap 3
             *
             * ARRAY MULTID:
             * -array rettangoli
             * 1234
             * 1234
             *
             * -array jagged (irregolare)
             * 123456
             * 234
             * 2343434343
             */

            //array
            int[] vet = new[] { 1, 2, 3 };

            //array regolari matrici
            int[,] matrix = new int[3, 4];
            matrix[0, 0]  = 1;

            int[,] matrix1 =
            {
                { 1, 2, 3, 4 },
                { 5, 6, 7, 8 }
            };

            //jagged array irregolari
            int[][] jagged = new int[3][];
            jagged[0] = new int[2] {
                1, 2
            };
            jagged[1] = new int[4] {
                1, 2, 3, 4
            };
            #endregion

            #region c7 PATTERN MATCHING

            /*
             * type => espr is tipo v
             * const => espr is constante
             * var
             *
             * */

            //type
            object obj1 = "";
            if (obj1 is string str)
            {
                Console.WriteLine(str);
            }

            //invece che

            if (obj1 is string)
            {
                string str1 = (string)obj;
                Console.WriteLine(str1);
            }

            //const
            Mesi giornomese = Mesi.febbraio;
            bool feb        = giornomese is Mesi.febbraio;//true se giorno di febbraio

            #endregion

            #region  Event
            //Event
            Pub pub = new Pub();
            //mi iscrivo e gli dico di fare questo quando viene sollevato evento evento
            pub.OnChange += () => Console.WriteLine("lambda");
            pub.OnChange += delegate { Console.WriteLine("delegate"); };

            //sollevo evento
            pub.Raise();

            Pub1 p1 = new Pub1();
            p1.OnChange += () => Console.WriteLine("lambda");
            p1.Raise();

            Pub2 p2 = new Pub2();
            p2.CreateAndRaise();

            Car        car = new Car();
            CarMonitor cm  = new CarMonitor(car);

            car.Decelerate();

            #endregion

            #region Expression Tree
            //Expression Tree
            Expression <Func <int, bool> > exp1 = x => x % 2 == 0;
            Func <int, bool> isPari             = exp1.Compile();//dopo che l'ho compliat posso eseguirla, prima era solo un albero di espressopmo
            if (isPari(4))
            {
                Console.WriteLine("pari");
            }
            #endregion

            #region delegate

            //assegno lambda (anonyous method)
            myDelegate myd = (x) => 1;
            Console.WriteLine(myd("0ciao"));

            //assegno metodo
            myDelegate myd1 = MethodForDel;
            Console.WriteLine(myd1("1ciao"));

            //assegno delegate
            myDelegate myd2 = delegate { return(1); };
            Console.WriteLine(myd2("2ciao"));
            #endregion

            #region VARIANZA
            //COVARIANZA OUT
            //ti faccio assegnare sia metodo che ritorna stringa
            //ma anche metodo che torna object perchè stringa deriva
            //da object (è piu specifica)
            Del          d1   = new Del();
            Cov <string> cov  = d1.Cov1;
            Cov <object> cov1 = d1.Cov2;
            Cov <object> cov3 = d1.Cov2;
            //Cov<string> cov2 = d1.Cov2;//no object non deriva da stringa

            //CONTROVARIANZA IN
            //ti faccio assegnare sia metodo che prende ingresso
            //classe piu generica object  ma ache classe piu specifica string
            Con <object> con  = d1.Con1;
            Con <string> con3 = d1.Con1;
            Con <string> con1 = d1.Con2;
            //Con<object> con2 = d1.Con2;//no

            var res3 = d1.MyCon(Convert.ToInt32, "5");
            var res4 = d1.MyCon1(Convert.ToInt32, "5");
            var res5 = d1.MyConGen(Convert.ToInt32, "5");
            var res6 = d1.MyConGen(Convert.ToBoolean, 0);
            var res7 = d1.MyConGen(Convert.ToString, 5);
            Console.WriteLine(res3);
            Console.WriteLine(res4);

            d1.UseMulticast();

            #endregion

            #region generics
            Task tx1 = Task.Run(() =>
            {
                Console.WriteLine("ciao");
            });
            Task[] tasksarr = new Task[1];
            tasksarr[0] = tx1;

            Gen1 gen1 = new Gen1();

            if (gen1.GetDefault <ConstructorStaticClass, Task>(tx1) != null)
            {
                gen1.ContinueTaskOrDefault(tx1, Console.WriteLine);
                Console.WriteLine("start task generic");
            }

            var mytaskList = gen1.ContinueTasksOrDefault(tasksarr, Console.WriteLine);


            if (mytaskList != null)
            {
                Console.WriteLine("starts tasks generic");
            }


            Gen2 <Constructor>             gen2       = new Gen2 <Constructor>();
            Gen2Figlia <Constructor>       gen2figlia = new Gen2Figlia <Constructor>();
            Gen1Figlia <Constructor, Task> tesFiglia  = new Gen1Figlia <Constructor, Task>();

            //variabile statico è diverso per tipo
            TestStaticGen <string> .Status = "rob";
            TestStaticGen <int> .Status    = 1;
            Console.WriteLine(TestStaticGen <string> .Status);
            Console.WriteLine(TestStaticGen <int> .Status);

            TestStatic.Status = "ciao";
            TestStatic.Status = "ciau";
            Console.WriteLine(TestStatic.Status);
            //

            Generica <string, int, DateTime, bool> gen = new Generica <string, int, DateTime, bool>();


            List <Lista <string> > genericiInnestati = new List <Lista <string> >();
            genericiInnestati.Add(new Lista <string>(5));
            genericiInnestati[0][0] = "ciao";
            genericiInnestati[0][1] = "come ";
            genericiInnestati[0][2] = "stai";
            genericiInnestati[0][3] = "rob";
            genericiInnestati[0][4] = "?";

            foreach (var item in genericiInnestati)
            {
                for (int j = 0; j < 5; j++)
                {
                    Console.WriteLine(item[j]);
                }
            }

            Lista <string> lista = new Lista <string>(5);
            lista[0] = "";
            #endregion

            #region programmazione parallela
            //PLINQ solo linq to onject NO linq to sql
            //prende base dati la divide in segmenti e fa query in parallelo su questi segmentie  pio unisce iriaultati
            // se i lavori nonn sono complessi e la base dati è minima la programmazione parallela non da buoni risultati
            var qy = from num in Enumerable.Range(1, 8).AsParallel()
                     select Math.Pow(2, num);

            //stampa da 1 a 9 (9 numeri NON in ordine)
            //iterazioni indipendenti l'una dall altra quindi per tutti e due ordine non è sequnziale
            Parallel.For(1, 10, g => Console.WriteLine("g-{0}", g));
            var result = Parallel.For(0, 50, (g, parallelLoopState) =>
            {
                if (g > 5)
                {
                    parallelLoopState.Break();
                }
            });

            if (!result.IsCompleted)
            {
                var o = result.LowestBreakIteration;
            }

            //non è sequnziale
            List <string> list = new List <string>()
            {
                "ciao", "come", "va?"
            };
            Parallel.ForEach(list, word => Console.WriteLine("{0}", word, word.Length));
            #endregion

            #region async await

            var res1 = DoCurlAsync();

            //net 4.5
            //await salva lo stato del contesto del caller e quando il metodo await si conclude
            //il contesto ritorna allo stato del chimante che puo eseguire il codice successivo
            //questo nel caso di ui permette di modiicare la ui che  proprieta nella app gui del thread
            //della ui e viene eseguito nel ui syncronization context (dispatchercontext nella ui)
            //DAL C#7 TUTTO PUO ESSERE AWAITABLE ED ESEGUITO AINCRONO E NON  SOLO ISTANZA DI TASK
            //QUALSIAIS OGGETTO CHE ESPONE METODO GETAWAITER INFATTI LA CLASSE TASK ESPONE METODO GETAWAITER
            //await non puo essere usato su unsafe, lock, main
            MetodoAsyn();
            Console.WriteLine("codice prima fine await)");

            Task <string> res = GetAsync();

            List <string> files = new List <string>()
            {
                "pippo.txt", "pippo1.txt"
            };
            files.ForEach(async file => await ReadFileAsync(file));

            //all block
            //.Wait()
            //.Result
            //.GetAwaiter()
            //.GetResult()

            #endregion

            #region task tpl

            //manca continuewhenall
            //continuewheany
            //task figli innestati

            //Task.WaitAll blocks the current thread until everything has completed.
            //Task.WhenAll returns a task which represents the action of waiting until everything has completed.
            //That means that from an async method, you can use:
            // A DIFFERENZA DI WAIT ALL TORNA SOLO LA PRIMA ECCEZIONE NON AGGREGATE
            Task[] tasksArray = new Task[3];
            tasksArray[0] = Task.Run(() => { Thread.Sleep(4000); });
            tasksArray[1] = Task.Run(() => { Thread.Sleep(4000); });
            tasksArray[2] = Task.Run(() => { Thread.Sleep(4000); });
            var ry = MyAsyncWhenAll(tasksArray);
            Console.WriteLine("tornato da MyAsyncWhenAll");


            Task tx = Task.Run(() =>
            {
                Thread.Sleep(1000);
            });
            Task ty = Task.Run(() =>
            {
                Thread.Sleep(1000);
            });

            Task taskall = Task.WhenAll((new Task[] { tx, ty }));

            //Task taskall = Task.WhenAny((new Task[] { t1, t2 }));
            taskall.Wait();

            Task <String> webtask = Task.Run(() =>
            {
                string url   = "http://www.google.it";
                WebClient wc = new WebClient();
                return(wc.DownloadString(url));
            });

            Task <String> headhtml = webtask.ContinueWith <string>(x =>
            {
                var res2 = x.Result;
                //fai qualcosa con res
                return(res2);
            });

            var tokenSource         = new CancellationTokenSource();
            CancellationToken token = tokenSource.Token;

            Task cancellabletask = null;
            try
            {
                cancellabletask = Task.Run(() =>
                {
                    token.ThrowIfCancellationRequested();
                    for (int d = 0; d < 2; d++)
                    {
                        Thread.Sleep(100);
                        if (token.IsCancellationRequested)
                        {
                            //eseguo altre cose
                            token.ThrowIfCancellationRequested();
                        }
                    }
                }, token);

                tokenSource.CancelAfter(1000);
                cancellabletask.Wait();
            }
            catch (AggregateException aggregateException)
            {
                if (aggregateException.InnerException is OperationCanceledException)
                {
                    Console.WriteLine("OperationCanceledException£");
                }
                if (cancellabletask != null && (cancellabletask.IsCanceled && cancellabletask.Status == TaskStatus.Canceled))
                {
                    Console.WriteLine(aggregateException.ToString());
                }
            }


            Task <String> task = Task.Run(() =>
            {
                string url   = "http://www.google.it";
                WebClient wc = new WebClient();
                return(wc.DownloadString(url));
            });
            var htmlUrl = task.Result;//blocco

            List <Task> tasks = new List <Task>();
            for (int r = 0; r < 5; r++)
            {
                int number = r;
                tasks.Add(
                    Task.Run(() =>
                {
                    Console.WriteLine(number);
                    Thread.Sleep(1000);
                }));
            }

            //Task.WaitAll(tasks.ToArray());
            Task.WaitAny(tasks.ToArray());
            Console.WriteLine("all task complete");

            Task longtask = Task.Run(() =>
            {
                Thread.Sleep(1000);
            });
            longtask.Wait(1000);


            Task verylong = Task.Factory.StartNew(() =>
            {
                Thread.Sleep(2000);
            }, TaskCreationOptions.LongRunning);
            #endregion tpl

            #region thread
            for (int w = 0; w < 5; w++)
            {
                ThreadPool.QueueUserWorkItem(LongOperation);
            }


            Thread threada = new Thread(IncrMon);
            Thread threadb = new Thread(IncrMon);
            threada.Start();
            threadb.Start();
            threada.Join();
            threadb.Join();
            Console.WriteLine("n={0}", n2);

            Thread thread1 = new Thread(Incr);
            Thread thread2 = new Thread(Incr);
            thread1.Start();
            thread2.Start();
            thread1.Join();
            thread2.Join();
            Console.WriteLine("n={0}", n1);

            Thread t = new Thread(() =>
            {
                Console.WriteLine(Thread.CurrentThread.Name);
                Thread.Sleep(1000);
            });

            Thread t1 = new Thread(() =>
            {
                Console.WriteLine(Thread.CurrentThread.Name);
                for (int z = 0; z < 10; z++)
                {
                    lock (lockobj)
                    {
                        n = n + 1;
                        Thread.Sleep(1);
                        Console.WriteLine("n={0}", n);
                    }
                }
            });
            Thread t2 = new Thread(() =>
            {
                Console.WriteLine(Thread.CurrentThread.Name);
                for (int x = 0; x < 10; x++)
                {
                    lock (lockobj)
                    {
                        n = n + 1;
                        Thread.Sleep(1);
                        Console.WriteLine("n={0}", n);
                    }
                }
            });

            t.IsBackground = true;                       //termina appena finisce la app
            t.Priority     = ThreadPriority.AboveNormal; //determinata quantita di cpu destinata al thread ma non è deterministico
            t.Start();
            t1.Start();
            t2.Start();
            t.Join();//il codice si blocca e attende che t finisce

            #endregion

            Console.ReadLine();
        }
示例#22
0
        /// <summary>
        /// 新建文本框自动完成
        /// </summary>
        public void EditAutoFullM2M_TB()
        {
            MapExt  myme = new MapExt(this.MyPK);
            MapM2Ms m2ms = new MapM2Ms(myme.FK_MapData);

            if (m2ms.Count == 0)
            {
                this.Pub1.Clear();
                //this.Pub1.AddFieldSet("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");
                //this.Pub1.Add("该表单下没有从表,所以您不能为从表设置自动填充。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfo("设置自动填充从表", "<p>该表单下没有从表,所以您不能为从表设置自动填充。<a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a></p>");
                return;
            }

            Pub1.AddTableNormal();
            Pub1.AddTRGroupTitle("设置自动填充从表. <a href='?ExtType=" + this.ExtType + "&MyPK=" + this.MyPK + "&FK_MapData=" + this.FK_MapData + "&RefNo=" + this.RefNo + "'>返回</a>");

            string[] strs       = myme.Tag2.Split('$');
            bool     isHaveM2M  = false;
            bool     isHaveM2MM = false;

            foreach (MapM2M m2m in m2ms)
            {
                if (m2m.HisM2MType == M2MType.M2M)
                {
                    isHaveM2M = true;
                }
                if (m2m.HisM2MType == M2MType.M2MM)
                {
                    isHaveM2MM = true;
                }

                TextBox tb = new TextBox();
                tb.ID      = "TB_" + m2m.NoOfObj;
                tb.Columns = 70;
                tb.Style.Add("width", "100%");
                tb.Rows     = 5;
                tb.TextMode = TextBoxMode.MultiLine;
                foreach (string s in strs)
                {
                    if (s == null)
                    {
                        continue;
                    }

                    if (s.Contains(m2m.NoOfObj + ":") == false)
                    {
                        continue;
                    }

                    string[] ss = s.Split(':');
                    tb.Text = ss[1];
                }

                //this.Pub1.AddFieldSet("编号:" + m2m.NoOfObj + ",名称:" + m2m.Name);
                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.Add("编号:" + m2m.NoOfObj + ",名称:" + m2m.Name);
                Pub1.Add(tb);
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                //this.Pub1.AddFieldSetEnd();
            }

            //this.Pub1.AddHR();
            Pub1.AddTableEnd();
            Pub1.AddBR();

            //Button mybtn = new Button();
            var mybtn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            mybtn.Click += new EventHandler(mybtn_SaveAutoFullM2M_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddSpace(1);

            mybtn        = new LinkBtn(false, NamesOfBtn.Cancel, "取消");
            mybtn.Click += new EventHandler(mybtn_SaveAutoFullM2M_Click);
            this.Pub1.Add(mybtn);
            Pub1.AddBR();
            //this.Pub1.AddFieldSetEnd();

            if (isHaveM2M)
            {
                //this.Pub1.AddFieldSet("帮助:一对多");
                Pub1.AddEasyUiPanelInfoBegin("帮助:一对多", "icon-help");
                this.Pub1.Add("在主表相关数据发生变化后,一对多数据要发生变化,变化的格式为:");
                this.Pub1.AddBR("实例:SELECT No,Name FROM WF_Emp WHERE FK_Dept='@Key' ");
                this.Pub1.AddBR("相关内容的值发生改变时而自动填充checkbox。");
                this.Pub1.AddBR("注意:");
                this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
                this.Pub1.AddBR("2,必须并且仅有No,Name两个列,顺序不要颠倒。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfoEnd();
            }

            if (isHaveM2MM)
            {
                //this.Pub1.AddFieldSet("帮助:一对多多");
                Pub1.AddEasyUiPanelInfoBegin("帮助:一对多多", "icon-help");
                this.Pub1.Add("在主表相关数据发生变化后,一对多多数据要发生变化,变化的格式为:");
                this.Pub1.AddBR("实例:SELECT a.FK_Emp M1ID, a.FK_Station as M2ID, b.Name as M2Name FROM " + BP.WF.Glo.EmpStation + " a, Port_Station b WHERE  A.FK_Station=B.No and a.FK_Emp='@Key'");
                this.Pub1.AddBR("相关内容的值发生改变时而自动填充checkbox。");
                this.Pub1.AddBR("注意:");
                this.Pub1.AddBR("1,@Key 是主表字段传递过来的变量。");
                this.Pub1.AddBR("2,必须并且仅有3个列 M1ID,M2ID,M2Name,顺序不要颠倒。第1列的ID对应列表的ID,第2,3列对应的是列表数据源的ID与名称。");
                //this.Pub1.AddFieldSetEnd();
                Pub1.AddEasyUiPanelInfoEnd();
            }
        }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PushMsgs msgs = new PushMsgs(this.FK_Flow);
            var      msg  = msgs.GetEntityByKey(PushMsgAttr.FK_Event, this.Event, PushMsgAttr.FK_Node, int.Parse(this.NodeID)) as PushMsg;

            if (msg == null)
            {
                msg          = new PushMsg();
                msg.FK_Event = this.Event;
                msg.FK_Node  = int.Parse(this.NodeID);
            }

            if (!string.IsNullOrWhiteSpace(this.ThePushWay))
            {
                if (this.ThePushWay != msg.PushWay.ToString())
                {
                    msg.PushDoc = string.Empty;
                    msg.Tag     = string.Empty;
                }

                msg.PushWay = int.Parse(this.ThePushWay);
            }

            this.Pub1.AddTable("class='Table' cellspacing='1' cellpadding='1' border='1' style='width:100%'");

            this.Pub1.AddTR();
            this.Pub1.AddTD("style='width:100px'", "推送设置方式:");
            var ddl = new DDL();

            ddl.BindSysEnum(PushMsgAttr.PushWay);
            ddl.ID = "DDL_" + PushMsgAttr.PushWay;
            ddl.SetSelectItem((int)msg.PushWay);
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);
            this.Pub1.AddTD(ddl);
            this.Pub1.AddTREnd();

            switch ((PushWay)msg.PushWay)
            {
            case PushWay.ByParas:

                #region  照系统指定参数

                Pub1.AddTR();
                Pub1.AddTD("输入参数名:");
                Pub1.AddTDBegin();

                var rad = new RadioBtn();
                rad.GroupName = "Para";
                rad.ID        = "RB_0";
                rad.Text      = "系统参数";
                rad.Checked   = msg.PushDoc == "0";

                Pub1.Add(rad);

                var tb = new TB();
                tb.ID = "TB_" + PushMsgAttr.Tag;

                if (msg.PushDoc == "0")
                {
                    tb.Text = msg.Tag;
                }
                else
                {
                    tb.Text = "NoticeTo";
                }

                Pub1.Add(tb);

                Pub1.Add("&nbsp;默认为NoticeTo");
                Pub1.AddBR();

                rad           = new RadioBtn();
                rad.GroupName = "Para";
                rad.ID        = "RB_1";
                rad.Text      = "表单字段参数";
                rad.Checked   = msg.PushDoc == "1";

                Pub1.Add(rad);

                MapAttrs attrs = new MapAttrs();
                attrs.Retrieve(MapAttrAttr.FK_MapData, "ND" + this.NodeID);

                MapAttrs attrNs = new MapAttrs();

                foreach (MapAttr attr in attrs)
                {
                    if (attr.IsBigDoc)
                    {
                        continue;
                    }

                    switch (attr.KeyOfEn)
                    {
                    case "Title":
                    case "FK_Emp":
                    case "MyNum":
                    case "FK_NY":
                    case WorkAttr.Emps:
                    case WorkAttr.OID:
                    case StartWorkAttr.Rec:
                    case StartWorkAttr.FID:
                        continue;

                    default:
                        break;
                    }

                    attrNs.AddEntity(attr);
                }

                ddl    = new DDL();
                ddl.ID = "DDL_" + PushMsgAttr.Tag;
                ddl.BindEntities(attrNs, MapAttrAttr.MyPK, MapAttrAttr.Name);
                ddl.AutoPostBack = false;

                if (msg.PushDoc == "1")
                {
                    ddl.SetSelectItem(msg.Tag);
                }

                Pub1.Add(ddl);
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.NodeWorker:

                #region  照指定结点的工作人员

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                Pub1.Add("请选择要推送到的节点工作人员:<br />");
                Nodes    nds = new Nodes(this.FK_Flow);
                CheckBox cb  = null;

                foreach (BP.WF.Node nd in nds)
                {
                    if (nd.NodeID == int.Parse(this.NodeID))
                    {
                        continue;
                    }

                    cb         = new CheckBox();
                    cb.ID      = "CB_" + nd.NodeID;
                    cb.Text    = nd.NodeID + " &nbsp;" + nd.Name;
                    cb.Checked = msg.PushDoc.Contains("@" + nd.NodeID + "@");
                    Pub1.Add(cb);
                    Pub1.AddBR();
                }

                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecDepts:

                #region  照指定的部门

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                this.Pub1.AddTR();
                this.Pub1.AddTD("colspan='3' class='GroupTitle'", "部门选择");
                this.Pub1.AddTREnd();

                //NodeDepts ndepts = new NodeDepts(int.Parse(this.NodeID));
                Depts depts = new Depts();
                depts.RetrieveAll();
                int i = 0;

                //foreach (NodeDept dept in ndepts)
                foreach (Dept dept in depts)
                {
                    i++;

                    if (i == 4)
                    {
                        i = 1;
                    }

                    if (i == 1)
                    {
                        Pub1.AddTR();
                    }

                    cb = new CheckBox();
                    //cb.ID = "CB_" + dept.FK_Dept;
                    //cb.Text = (depts.GetEntityByKey(dept.FK_Dept) as Dept).Name;
                    cb.ID   = "CB_" + dept.No;
                    cb.Text = dept.Name;

                    //if (msg.PushDoc.Contains("@" + dept.FK_Dept + "@"))
                    if (msg.PushDoc.Contains("@" + dept.No + "@"))
                    {
                        cb.Checked = true;
                    }

                    this.Pub1.AddTD(cb);

                    if (i == 3)
                    {
                        Pub1.AddTREnd();
                    }
                }

                switch (i)
                {
                case 1:
                    Pub1.AddTD();
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                case 2:
                    Pub1.AddTD();
                    Pub1.AddTREnd();
                    break;

                default:
                    break;
                }

                this.Pub1.AddTableEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecEmps:

                #region  照指定的人员

                Pub1.AddTR();
                //Pub1.AddTDBegin("colspan='2'");

                Pub1.AddTD("选择人员:");
                Pub1.AddTDBegin();

                tb          = new TB();
                tb.ID       = "TB_Users";
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Style.Add("width", "99%");
                tb.Rows     = 4;
                tb.ReadOnly = true;

                var hf = new HiddenField();
                hf.ID = "HID_Users";

                //加载已经选择的人员
                if (!string.IsNullOrWhiteSpace(msg.PushDoc))
                {
                    hf.Value = msg.PushDoc.Replace("@@", ",").Trim('@');

                    var emps = new Emps();
                    emps.RetrieveAll();

                    tb.Text =
                        hf.Value.Split(',').Select(o => (emps.GetEntityByKey(o) as Emp).Name).Aggregate(
                            string.Empty, (curr, next) => curr + next + ",").TrimEnd(',');
                }

                Pub1.Add(tb);
                Pub1.Add(hf);
                Pub1.AddBR();
                Pub1.AddBR();

                Pub1.Add(
                    "<a class='easyui-linkbutton' data-options=\"iconCls:'icon-user'\" href='javascript:void(0)' onclick=\"showWin('../Comm/Port/SelectUser_Jq.aspx','" +
                    tb.ClientID + "','" + hf.ClientID + "');\">选择人员...</a>");
                Pub1.AddTDEnd();
                //Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                //depts = new Depts();
                //depts.RetrieveAll();
                //var emps = new Emps();
                //emps.RetrieveAll();
                //var empDepts = new EmpDepts();
                //empDepts.RetrieveAll();
                //var nemps = new NodeEmps(int.Parse(this.NodeID));

                //Emp emp = null;

                //foreach (Dept dept in depts)
                //{
                //    this.Pub1.AddTR();
                //    var mycb = new CheckBox();
                //    mycb.Text = dept.Name;
                //    mycb.ID = "CB_D_" + dept.No;
                //    this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                //    this.Pub1.AddTREnd();

                //    i = 0;
                //    string ctlIDs = "";

                //    foreach (EmpDept ed in empDepts)
                //    {
                //        if (ed.FK_Dept != dept.No)
                //            continue;

                //        //排除非当前结点绑定的人员
                //        if (nemps.GetEntityByKey(NodeEmpAttr.FK_Emp, ed.FK_Emp) == null)
                //            continue;

                //        i++;

                //        if (i == 4)
                //            i = 1;

                //        if (i == 1)
                //            Pub1.AddTR();

                //        emp = emps.GetEntityByKey(ed.FK_Emp) as Emp;

                //        cb = new CheckBox();
                //        cb.ID = "CB_E_" + emp.No;
                //        ctlIDs += cb.ID + ",";
                //        cb.Text = emp.Name;
                //        if (msg.PushDoc.Contains("@" + emp.No + "@"))
                //            cb.Checked = true;

                //        Pub1.AddTD(cb);

                //        if (i == 3)
                //            Pub1.AddTREnd();
                //    }

                //    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                //    switch (i)
                //    {
                //        case 1:
                //            Pub1.AddTD();
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        case 2:
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        default:
                //            break;
                //    }
                //}

                //Pub1.AddTableEnd();

                //Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecSQL:

                #region  照指定的SQL查询语句

                Pub1.AddTR();

                this.Pub1.AddTDBegin("colspan='2'");
                this.Pub1.Add("SQL查询语句:<br />");
                tb         = new TB();
                tb.ID      = "TB_" + PushMsgAttr.PushDoc;
                tb.Columns = 50;
                tb.Style.Add("width", "99%");
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Rows     = 4;
                tb.Text     = msg.PushDoc;
                this.Pub1.Add(tb);
                this.Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;

            case PushWay.SpecStations:

                #region  照指定的岗位

                Pub1.AddTR();
                Pub1.AddTDBegin("colspan='2'");

                if (BP.WF.Glo.OSModel == OSModel.WorkFlow)
                {
                    SysEnums ses = new SysEnums("StaGrade");
                    Stations sts = new Stations();
                    sts.RetrieveAll();

                    string    sql = "SELECT No,Name FROM Port_Station WHERE StaGrade  NOT IN (SELECT IntKey FROM Sys_Enum WHERE EnumKey='StaGrade')";
                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    if (dt.Rows.Count != 0)
                    {
                        if (ses.Count == 0)
                        {
                            SysEnum se = new SysEnum();
                            se.EnumKey = "StaGrade";
                            se.Lab     = "普通岗";
                            se.IntKey  = 0;
                            se.Insert();

                            ses.AddEntity(se);
                        }

                        foreach (Station st in sts)
                        {
                            st.StaGrade = 0;
                            st.Save();
                        }
                    }

                    this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                    foreach (SysEnum se in ses)
                    {
                        this.Pub1.AddTR();
                        CheckBox mycb = new CheckBox();
                        mycb.Text = se.Lab;
                        mycb.ID   = "CB_SG_" + se.IntKey;
                        this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                        this.Pub1.AddTREnd();

                        i = 0;
                        string ctlIDs = "";

                        foreach (Station st in sts)
                        {
                            if (st.StaGrade != se.IntKey)
                            {
                                continue;
                            }

                            i++;

                            if (i == 4)
                            {
                                i = 1;
                            }

                            if (i == 1)
                            {
                                Pub1.AddTR();
                            }

                            cb      = new CheckBox();
                            cb.ID   = "CB_S_" + st.No;
                            ctlIDs += cb.ID + ",";
                            cb.Text = st.Name;

                            if (msg.PushDoc.Contains("@" + st.No + "@"))
                            {
                                cb.Checked = true;
                            }

                            Pub1.AddTD(cb);

                            if (i == 3)
                            {
                                Pub1.AddTREnd();
                            }
                        }

                        mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                        switch (i)
                        {
                        case 1:
                            Pub1.AddTD();
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        case 2:
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        default:
                            break;
                        }
                    }

                    this.Pub1.AddTableEnd();
                }
                else
                {
                    /*BPM 模式*/
                    BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
                    tps.RetrieveAll();

                    BP.GPM.Stations sts = new BP.GPM.Stations();
                    sts.RetrieveAll();

                    string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
                    DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                    if (dt.Rows.Count != 0)
                    {
                        if (tps.Count == 0)
                        {
                            var stp = new BP.GPM.StationType {
                                No = "01", Name = "普通岗"
                            };
                            stp.Save();

                            tps.AddEntity(stp);
                        }

                        //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                        foreach (BP.GPM.Station st in sts)
                        {
                            st.FK_StationType = tps[0].No;
                            st.Update();
                        }
                    }

                    this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                    foreach (BP.GPM.StationType tp in tps)
                    {
                        this.Pub1.AddTR();
                        CheckBox mycb = new CheckBox();
                        mycb.Text = tp.Name;
                        mycb.ID   = "CB_ST_" + tp.No;
                        this.Pub1.AddTD("colspan='3' class='GroupTitle'", mycb);
                        this.Pub1.AddTREnd();

                        i = 0;
                        string ctlIDs = "";

                        foreach (BP.GPM.Station st in sts)
                        {
                            if (st.FK_StationType != tp.No)
                            {
                                continue;
                            }

                            i++;

                            if (i == 4)
                            {
                                i = 1;
                            }

                            if (i == 1)
                            {
                                Pub1.AddTR();
                            }

                            cb      = new CheckBox();
                            cb.ID   = "CB_S_" + st.No;
                            ctlIDs += cb.ID + ",";
                            cb.Text = st.Name;

                            if (msg.PushDoc.Contains("@" + st.No + "@"))
                            {
                                cb.Checked = true;
                            }

                            this.Pub1.AddTD(cb);

                            if (i == 3)
                            {
                                Pub1.AddTREnd();
                            }
                        }

                        mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                        switch (i)
                        {
                        case 1:
                            Pub1.AddTD();
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        case 2:
                            Pub1.AddTD();
                            Pub1.AddTREnd();
                            break;

                        default:
                            break;
                        }
                    }

                    this.Pub1.AddTableEnd();
                }

                #region 原逻辑,只考虑了一种模式,停用
                //Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                //SysEnums ses = new SysEnums("StaGrade");
                //Stations sts = new Stations();
                //NodeStations nsts = new NodeStations(int.Parse(this.NodeID));
                //sts.RetrieveAll();

                //foreach (SysEnum se in ses)
                //{
                //    this.Pub1.AddTR();
                //    var mycb = new CheckBox();
                //    mycb.Text = se.Lab;
                //    mycb.ID = "CB_SG_" + se.IntKey;
                //    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                //    this.Pub1.AddTREnd();

                //    i = 0;
                //    string ctlIDs = "";

                //    foreach (Station st in sts)
                //    {
                //        if (st.StaGrade != se.IntKey)
                //            continue;

                //        //排除非当前结点的岗位
                //        if (nsts.GetEntityByKey(NodeStationAttr.FK_Station, st.No) == null)
                //            continue;

                //        i++;

                //        if (i == 4)
                //            i = 1;

                //        if (i == 1)
                //            Pub1.AddTR();

                //        cb = new CheckBox();
                //        cb.ID = "CB_S_" + st.No;
                //        ctlIDs += cb.ID + ",";
                //        cb.Text = st.Name;
                //        if (msg.PushDoc.Contains("@" + st.No + "@"))
                //            cb.Checked = true;

                //        Pub1.AddTD(cb);

                //        if (i == 3)
                //            Pub1.AddTREnd();
                //    }

                //    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                //    switch (i)
                //    {
                //        case 1:
                //            Pub1.AddTD();
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        case 2:
                //            Pub1.AddTD();
                //            Pub1.AddTREnd();
                //            break;
                //        default:
                //            break;
                //    }
                //}
                //Pub1.AddTableEnd();
                #endregion

                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                #endregion

                break;
            }

            Pub1.AddTableEnd();

            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");
            btn.Click += new EventHandler(btn_Click);
            Pub1.Add(btn);

            if (!string.IsNullOrWhiteSpace(msg.MyPK))
            {
                Pub1.AddSpace(1);
                btn        = new LinkBtn(false, NamesOfBtn.Delete, "删除");
                btn.Click += new EventHandler(btn_Delete_Click);
                btn.Attributes["onclick"] = "return confirm('你确定要删除此消息推送设置吗?');";
                Pub1.Add(btn);
            }
        }
示例#24
0
        public void DataPanelDtl(Entities ens, string ctrlId)
        {
            //   this.Controls.Clear();
            Entity myen         = ens.GetNewEntity;
            string pk           = myen.PK;
            string clName       = myen.ToString();
            Attrs  attrs        = myen.EnMap.Attrs;
            var    attrCount    = 0;
            var    visibleAttrs = new List <Attr>();

            foreach (Attr attrT in attrs)
            {
                if (attrT.UIVisible == false)
                {
                    continue;
                }

                if (attrT.Key == "Title" || attrT.Key == "MyNum")
                {
                    continue;
                }

                attrCount++;
                visibleAttrs.Add(attrT);
            }

            MapRpt md = new MapRpt(this.RptNo);

            this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("colspan=" + (attrCount + 2), myen.EnMap.EnDesc + " 记录:" + ens.Count + "条");
            this.Pub1.AddTREnd();
            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("style='text-align:center'", "序");
            this.Pub1.AddTDGroupTitle("标题");

            visibleAttrs.ForEach(attr => Pub1.AddTDGroupTitle(attr.Desc));

            bool isRefFunc = false;

            isRefFunc = true;
            int pageidx = this.PageIdx - 1;
            int idx     = SystemConfig.PageSize * pageidx;

            this.Pub1.AddTREnd();
            string style = WebUser.Style;

            foreach (Entity en in ens)
            {
                this.Pub1.AddTR();
                idx++;
                this.Pub1.AddTDIdx(idx);
                //this.Pub1.Add("<TD class='TD'><a href=\"javascript:WinOpen('../WorkOpt/OneWork/Track.aspx?FK_Flow=" + this.FK_Flow + "&WorkID=" + en.GetValStrByKey("OID") + "');\" ><img src='../Img/Track.png' border=0 />"+en.GetValStrByKey("Title")+"</a></TD>");
                this.Pub1.Add("<TD class='TD'><a href=\"javascript:WinOpen('../WorkOpt/OneWork/Track.aspx?FK_Flow=" + this.FK_Flow + "&WorkID=" + en.GetValStrByKey("OID") + "');\" ><img src='../Img/Track.png' border=0 />" + en.GetValStrByKey("Title") + "</a></TD>");

                foreach (var attr in visibleAttrs)
                {
                    if (attr.UIContralType == UIContralType.DDL)
                    {
                        if (attr.UIBindKey == "BP.Pub.NYs")
                        {
                            this.Pub1.AddTD(en.GetValStrByKey(attr.Key));
                        }
                        else
                        {
                            this.Pub1.AddTD(en.GetValRefTextByKey(attr.Key));
                        }
                        continue;
                    }

                    if (attr.UIHeight != 0)
                    {
                        this.Pub1.AddTDDoc("...", "...");
                        continue;
                    }

                    string str = en.GetValStrByKey(attr.Key);
                    switch (attr.MyDataType)
                    {
                    case DataType.AppDate:
                    case DataType.AppDateTime:
                        if (str == "" || str == null)
                        {
                            str = "&nbsp;";
                        }
                        this.Pub1.AddTD(str);
                        break;

                    case DataType.AppString:
                        if (str == "" || str == null)
                        {
                            str = "&nbsp;";
                        }
                        if (attr.UIHeight != 0)
                        {
                            this.Pub1.AddTDDoc(str, str);
                        }
                        else
                        {
                            this.Pub1.AddTD(str);
                        }
                        break;

                    case DataType.AppBoolean:
                        if (str == "1")
                        {
                            this.Pub1.AddTD("是");
                        }
                        else
                        {
                            this.Pub1.AddTD("否");
                        }
                        break;

                    case DataType.AppFloat:
                    case DataType.AppInt:
                    case DataType.AppRate:
                    case DataType.AppDouble:
                        this.Pub1.AddTDNum(str);
                        break;

                    case DataType.AppMoney:
                        this.Pub1.AddTDNum(decimal.Parse(str).ToString("0.00"));
                        break;

                    default:
                        throw new Exception("no this case ...");
                    }
                }

                this.Pub1.AddTREnd();
            }

            #region  求合计代码写在这里。

            bool IsHJ = false;
            foreach (Attr attr in attrs)
            {
                if (attr.MyFieldType == FieldType.RefText || attr.UIContralType == UIContralType.DDL)
                {
                    continue;
                }

                if (attr.Key == "OID" || attr.Key == "FID" ||
                    attr.Key == "MID" || attr.Key.ToUpper() == "WORKID" ||
                    attr.Key == BP.WF.Data.NDXRptBaseAttr.FlowEndNode ||
                    attr.Key == BP.WF.Data.NDXRptBaseAttr.PWorkID)
                {
                    continue;
                }

                switch (attr.MyDataType)
                {
                case DataType.AppDouble:
                case DataType.AppFloat:
                case DataType.AppInt:
                case DataType.AppMoney:
                    IsHJ = true;
                    break;

                default:
                    break;
                }
            }

            if (IsHJ)
            {
                // 找出配置是不显示合计的列。
                this.Pub1.Add("<TR class='TRSum'>");
                this.Pub1.AddTD("class=Sum", "合计");
                this.Pub1.AddTD("class=Sum", "");

                foreach (Attr attr in attrs)
                {
                    if (attr.MyFieldType == FieldType.RefText ||
                        attr.UIVisible == false ||
                        attr.Key == "MyNum")
                    {
                        continue;
                    }

                    if (attr.MyDataType == DataType.AppBoolean)
                    {
                        this.Pub1.AddTD("class=Sum", "");
                        continue;
                    }

                    if (attr.UIContralType == UIContralType.DDL)
                    {
                        this.Pub1.AddTD("class=Sum", "");
                        continue;
                    }

                    if (attr.Key == "OID" || attr.Key == "FID" ||
                        attr.Key == "MID" || attr.Key.ToUpper() == "WORKID")
                    {
                        this.Pub1.AddTD("class=Sum", "");
                        continue;
                    }

                    switch (attr.MyDataType)
                    {
                    case DataType.AppDouble:
                        this.Pub1.AddTDNum(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    case DataType.AppFloat:
                        this.Pub1.AddTDNum(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    case DataType.AppInt:
                        this.Pub1.AddTDNum(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    case DataType.AppMoney:
                        this.Pub1.AddTDJE(ens.GetSumDecimalByKey(attr.Key));
                        break;

                    default:
                        this.Pub1.AddTD("class=Sum", "");
                        break;
                    }
                }

                this.Pub1.AddTREnd();
            }
            #endregion

            this.Pub1.AddTableEnd();
        }
示例#25
0
        public void BindCond()
        {
            string msg  = "";
            string note = "";

            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            if (BP.WF.Glo.OSModel == OSModel.WorkFlow)
            {
                SysEnums ses = new SysEnums("StaGrade");
                Stations sts = new Stations();
                sts.RetrieveAll();

                string    sql = "SELECT No,Name FROM Port_Station WHERE StaGrade  NOT IN (SELECT IntKey FROM Sys_Enum WHERE EnumKey='StaGrade')";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    if (ses.Count == 0)
                    {
                        SysEnum se = new SysEnum();
                        se.EnumKey = "StaGrade";
                        se.Lab     = "普通岗";
                        se.IntKey  = 0;
                        se.Insert();

                        ses.AddEntity(se);
                    }

                    foreach (Station st in sts)
                    {
                        st.StaGrade = 0;
                        st.Save();
                    }

                    //Pub1.AddEasyUiPanelInfo("错误",
                    //                        "在ccflow的集成工作模式下,岗位表集成或者维护错误,有" + dt.Rows.Count +
                    //                        "个岗位枚举值对应不上:<br />{技术信息:排查的sql:" + sql + "}", "icon-no");
                    //return;
                }

                this.Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");

                foreach (SysEnum se in ses)
                {
                    this.Pub1.AddTR();
                    CheckBox mycb = new CheckBox();
                    mycb.Text = se.Lab;
                    mycb.ID   = "CB_s_d" + se.IntKey;
                    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                    this.Pub1.AddTREnd();

                    int    i      = 0;
                    string ctlIDs = "";

                    foreach (Station st in sts)
                    {
                        if (st.StaGrade != se.IntKey)
                        {
                            continue;
                        }

                        i++;

                        if (i == 4)
                        {
                            i = 1;
                        }

                        if (i == 1)
                        {
                            Pub1.AddTR();
                        }

                        CheckBox cb = new CheckBox();
                        cb.ID   = "CB_" + st.No;
                        ctlIDs += cb.ID + ",";
                        cb.Text = st.Name;
                        if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                        {
                            cb.Checked = true;
                        }

                        Pub1.AddTD(cb);

                        if (i == 3)
                        {
                            Pub1.AddTREnd();
                        }
                    }

                    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                    switch (i)
                    {
                    case 1:
                        Pub1.AddTD();
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    case 2:
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    default:
                        break;
                    }
                }
            }
            else
            {
                /*BPM 模式*/
                BP.GPM.StationTypes tps = new BP.GPM.StationTypes();
                tps.RetrieveAll();

                BP.GPM.Stations sts = new BP.GPM.Stations();
                sts.RetrieveAll();

                string    sql = "SELECT No,Name FROM Port_Station WHERE FK_StationType NOT IN (SELECT No FROM Port_StationType)";
                DataTable dt  = DBAccess.RunSQLReturnTable(sql);
                if (dt.Rows.Count != 0)
                {
                    if (tps.Count == 0)
                    {
                        var stp = new BP.GPM.StationType {
                            No = "01", Name = "普通岗"
                        };
                        stp.Save();

                        tps.AddEntity(stp);
                    }

                    //更新所有对不上岗位类型的岗位,岗位类型为01或第一个
                    foreach (BP.GPM.Station st in sts)
                    {
                        st.FK_StationType = tps[0].No;
                        st.Update();
                    }

                    //Pub1.AddEasyUiPanelInfo("错误",
                    //                        "在ccflow的集成工作模式下,岗位表集成或者维护错误,有" + dt.Rows.Count +
                    //                        "个岗位外键对应不上:<br />{技术信息:排查的sql:" + sql + "}", "icon-no");
                    //return;
                }

                this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
                foreach (BP.GPM.StationType tp in tps)
                {
                    this.Pub1.AddTR();
                    CheckBox mycb = new CheckBox();
                    mycb.Text = tp.Name;
                    mycb.ID   = "CB_s_d" + tp.No;
                    this.Pub1.AddTD("colspan=3 class='GroupTitle'", mycb);
                    this.Pub1.AddTREnd();

                    int    i      = 0;
                    string ctlIDs = "";

                    foreach (BP.GPM.Station st in sts)
                    {
                        if (st.FK_StationType != tp.No)
                        {
                            continue;
                        }

                        i++;

                        if (i == 4)
                        {
                            i = 1;
                        }

                        if (i == 1)
                        {
                            Pub1.AddTR();
                        }

                        CheckBox cb = new CheckBox();
                        cb.ID   = "CB_" + st.No;
                        ctlIDs += cb.ID + ",";
                        cb.Text = st.Name;
                        if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                        {
                            cb.Checked = true;
                        }

                        this.Pub1.AddTD(cb);

                        if (i == 3)
                        {
                            Pub1.AddTREnd();
                        }
                    }

                    mycb.Attributes["onclick"] = "SetSelected(this,'" + ctlIDs + "')";

                    switch (i)
                    {
                    case 1:
                        Pub1.AddTD();
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    case 2:
                        Pub1.AddTD();
                        Pub1.AddTREnd();
                        break;

                    default:
                        break;
                    }
                }
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#26
0
        private void BindSearch()
        {
            Flow fl   = new Flow(this.FK_Flow);
            var  gwfs = new GenerWorkFlows();
            var  qo   = new QueryObject(gwfs);

            qo.AddWhere(GenerWorkFlowAttr.FK_Flow, FK_Flow);

            if (!string.IsNullOrWhiteSpace(Depts))
            {
                qo.addAnd();
                qo.AddWhereIn(GenerWorkFlowAttr.FK_Dept, "(" + Depts + ")");
            }

            if (!string.IsNullOrWhiteSpace(Emps))
            {
                qo.addAnd();
                qo.AddWhereIn(GenerWorkFlowAttr.Starter, "(" + Emps.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Aggregate(string.Empty, (curr, next) => curr + "'" + next + "',").TrimEnd(',') + ")");
            }

            if (!string.IsNullOrWhiteSpace(DateFrom))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.RDT, ">", DateFrom);
            }

            if (!string.IsNullOrWhiteSpace(DateTo))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.RDT, "<=", DateTo);
            }

            if (!string.IsNullOrWhiteSpace(Keywords))
            {
                qo.addAnd();
                qo.AddWhere(GenerWorkFlowAttr.Title, "LIKE", "%" + Keywords + "%");
            }

            qo.addOrderBy(GenerWorkFlowAttr.RDT);

            var url = string.Format("FlowDB.aspx?FK_Flow={0}&WorkID={1}&IsSearch=1&Depts={2}&DeptsText={3}&Emps={4}&EmpsText={5}&DateFrom={6}&DateTo={7}&Keywords={8}", FK_Flow, WorkID, Depts, DeptsText, Emps, EmpsText, DateFrom, DateTo, Keywords);

            Pub2.BindPageIdxEasyUi(qo.GetCount(), url, this.PageIdx, SystemConfig.PageSize);

            qo.DoQuery(gwfs.GetNewEntity.PK, SystemConfig.PageSize, this.PageIdx);

            this.Pub1.AddTable("class='Table' cellspacing='0' cellpadding='0' border='0' style='width:100%'");

            Pub1.AddTR();
            Pub1.AddTDGroupTitle("colspan='8'", fl.Name);
            Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDGroupTitle("style='text-align:center'", "序号");
            this.Pub1.AddTDGroupTitle("部门");
            this.Pub1.AddTDGroupTitle("发起人");
            this.Pub1.AddTDGroupTitle("发起时间");
            this.Pub1.AddTDGroupTitle("当前停留节点");
            this.Pub1.AddTDGroupTitle("标题");
            this.Pub1.AddTDGroupTitle("处理人");
            this.Pub1.AddTDGroupTitle("操作");
            this.Pub1.AddTREnd();

            int idx = 0;

            foreach (GenerWorkFlow item in gwfs)
            {
                idx++;
                this.Pub1.AddTR();
                this.Pub1.AddTDIdx(SystemConfig.PageSize * (this.PageIdx - 1) + idx);
                this.Pub1.AddTD(item.DeptName);
                this.Pub1.AddTD(item.StarterName);
                this.Pub1.AddTD(item.RDT);
                this.Pub1.AddTD(item.NodeName);
                this.Pub1.AddTD(item.Title);
                this.Pub1.AddTD(item.TodoEmps);

                this.Pub1.AddTDBegin();
                this.Pub1.Add("<a href=\"javascript:WinOpen('./../../WFRpt.aspx?WorkID=" + item.WorkID + "&FK_Flow=" + this.FK_Flow + "&FID=" + item.FID + "','ds'); \" class='easyui-linkbutton'>轨迹</a>&nbsp;");
                //this.Pub1.Add("<a href=\"javascript:WinOpen('../../../WFRpt.aspx?WorkID=" + item.WorkID + "&FK_Flow=" + this.FK_Flow + "&FID=" + item.FID + "&FK_Node=" + item.FK_Node + "','ds'); \" >报告</a>-");
                this.Pub1.Add("<a href=\"javascript:DelIt('" + item.FK_Flow + "','" + item.WorkID + "');\" class='easyui-linkbutton' data-options=\"iconCls:'icon-delete'\" onclick=\"return confirm('您确定要删除吗?');\">删除</a>&nbsp;");
                this.Pub1.Add("<a href=\"javascript:FlowShift('" + item.FK_Flow + "','" + item.WorkID + "');\" class='easyui-linkbutton'>移交</a>&nbsp;");
                this.Pub1.Add("<a href=\"javascript:FlowSkip('" + item.FK_Flow + "','" + item.WorkID + "');\" class='easyui-linkbutton'>跳转</a>");
                this.Pub1.AddTDEnd();
                this.Pub1.AddTREnd();
            }

            this.Pub1.AddTableEnd();
        }
示例#27
0
        public void BindCond()
        {
            Cond cond = new Cond();

            cond.MyPK = this.GenerMyPK;
            cond.RetrieveFromDBSources();

            BP.WF.Node nd   = new BP.WF.Node(this.FK_MainNode);
            BP.WF.Node tond = new BP.WF.Node(this.ToNodeID);

            this.Pub1.AddTable("class='Table' cellSpacing='1' cellPadding='1'  border='1' style='width:100%'");
            this.Pub1.AddTR();
            this.Pub1.AddTD("colspan=3 class='GroupTitle'", "部门选择");
            this.Pub1.AddTREnd();

            Depts sts = new Depts();

            sts.RetrieveAllFromDBSource();

            int i = 0;

            foreach (Dept st in sts)
            {
                i++;

                if (i == 4)
                {
                    i = 1;
                }

                if (i == 1)
                {
                    Pub1.AddTR();
                }

                CheckBox cb = new CheckBox();
                cb.ID   = "CB_" + st.No;
                cb.Text = st.Name;
                if (cond.OperatorValue.ToString().Contains("@" + st.No + "@"))
                {
                    cb.Checked = true;
                }

                this.Pub1.AddTD(cb);

                if (i == 3)
                {
                    Pub1.AddTREnd();
                }
            }

            switch (i)
            {
            case 1:
                Pub1.AddTD();
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            case 2:
                Pub1.AddTD();
                Pub1.AddTREnd();
                break;

            default:
                break;
            }

            this.Pub1.AddTableEnd();
            Pub1.AddBR();
            Pub1.AddSpace(1);

            var btn = new LinkBtn(false, NamesOfBtn.Save, "保存");

            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
            Pub1.AddSpace(1);

            btn = new LinkBtn(false, NamesOfBtn.Delete, "删除");
            btn.Attributes["onclick"] = " return confirm('您确定要删除吗?');";
            btn.Click += new EventHandler(btn_Save_Click);
            this.Pub1.Add(btn);
        }
示例#28
0
        void btn_Click(object sender, EventArgs e)
        {
            var selectedColumns = string.Empty;

            foreach (Control ctrl in Pub1.Controls)
            {
                if (ctrl.GetType().Name != "CheckBox" || ctrl.ID == "CB_CheckAll" || !(ctrl as CheckBox).Checked)
                {
                    continue;
                }

                selectedColumns += ctrl.ID.Substring("CB_Col_".Length) + ",";
            }

            Response.Redirect(string.Format(
                                  "{0}?Step=3&FK_MapData={1}&FK_SFDBSrc={2}&STable={3}&SColumns={4}",
                                  Request.Url.AbsolutePath, this.FK_MapData, this.FK_SFDBSrc, this.STable ?? (Pub1.GetLBByID("LB_Table").SelectedItem.Value), selectedColumns));
        }
示例#29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "Del")
            {
                FrmEvent delFE = new FrmEvent();
                delFE.MyPK = this.FK_MapData + "_" + this.Request.QueryString["RefXml"];
                delFE.Delete();
            }

            FrmEvents ndevs = new FrmEvents();

            if (this.FK_MapData != null)
            {
                ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);
            }


            EventLists xmls = new EventLists();

            xmls.RetrieveAll();

            BP.WF.XML.EventSources ess = new EventSources();
            ess.RetrieveAll();

            string myEvent = this.Event;

            BP.WF.XML.EventList myEnentXml = null;

            #region //生成事件列表
            foreach (EventSource item in ess)
            {
                if (item.No != this.ShowType)
                {
                    continue;
                }

                Pub1.Add(string.Format("<div title='{0}' style='padding:10px; overflow:auto' data-options=''>", item.Name));
                Pub1.AddUL("class='navlist'");

                string msg = "";
                foreach (BP.WF.XML.EventList xml in xmls)
                {
                    if (xml.EventType != item.No)
                    {
                        continue;
                    }

                    msg = "";
                    if (xml.IsHaveMsg == true)
                    {
                        msg = "<img src='/WF/Img/Msg.png' />";
                    }

                    FrmEvent nde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, xml.No) as FrmEvent;
                    if (nde == null)
                    {
                        if (myEvent == xml.No)
                        {
                            CurrentEventGroup = item.Name;
                            myEnentXml        = xml;
                            Pub1.AddLi(string.Format("<div style='font-weight:bold'><a href='javascript:void(0)'><span class='nav'><img src='/WF/Img/Event.png' border=0/>" + msg + "{0}</span></a></div>{1}", xml.Name, Environment.NewLine));
                        }
                        else
                        {
                            Pub1.AddLi(string.Format("<div><a href='Action.aspx?NodeID={0}&Event={1}&FK_Flow={2}&tk={5}&FK_MapData={6}'><span class='nav'><img src='/WF/Img/Event.png' border=0/>" + msg + "{3}</span></a></div>{4}", NodeID, xml.No, FK_Flow, xml.Name, Environment.NewLine, new Random().NextDouble(), this.FK_MapData));
                        }
                    }
                    else
                    {
                        if (myEvent == xml.No)
                        {
                            CurrentEventGroup = item.Name;
                            myEnentXml        = xml;
                            Pub1.AddLi(string.Format("<div style='font-weight:bold'><a href='javascript:void(0)'><span class='nav'><img src='/WF/Img/Event.png' border=0/>" + msg + "{0}</span></a></div>{1}", xml.Name, Environment.NewLine));
                        }
                        else
                        {
                            Pub1.AddLi(string.Format("<div><a href='Action.aspx?NodeID={0}&Event={1}&FK_Flow={2}&MyPK={3}&tk={6}&FK_MapData={7}'><span class='nav'><img src='/WF/Img/Event.png' border=0/>" + msg + "{4}</span></a></div>{5}", NodeID, xml.No, FK_Flow, nde.MyPK, xml.Name, Environment.NewLine, new Random().NextDouble(), this.FK_MapData));
                        }
                    }
                }

                Pub1.AddULEnd();
                Pub1.AddDivEnd();
            }
            #endregion

            if (myEnentXml == null)
            {
                CurrentEvent = "帮助";

                this.Pub2.Add("<div style='width:100%; text-align:left' data-options='noheader:true'>");
                this.Pub2.AddH2("事件是ccbpm与您的应用程序接口");

                if (this.NodeID != "0")
                {
                    this.Pub2.AddFieldSet("节点事件");
                    this.Pub2.AddUL();
                    this.Pub2.AddLi("流程在运动过程中,有许多的事件,比如节点发送前、发送成功后、发送失败后、退回前、退回后、撤销发送前、这小发送后、流程结束前、结束后、删除前删除后。");
                    this.Pub2.AddLi("ccbpm把事件分为流程事件与节点事件,流程属性里定义流程事件,节点属性里定义节点事件。");
                    this.Pub2.AddLi("在这些事件里ccbpm允许调用您编写的业务逻辑,完成与界面交互、与其他系统交互、与其他流程参与人员交互。");
                    this.Pub2.AddLi("按照事件发生的类型,ccbpm把事件分为:节点、表单、流程三类的事件。");
                    this.Pub2.AddLi("在BPMN2.0规范里没有定义节点事件表单事件,这是ccbpm特有的概念与元素。");
                    this.Pub2.AddULEnd();
                    this.Pub2.AddFieldSetEnd();
                }

                if (this.FK_Flow != null && this.NodeID == "0")
                {
                    this.Pub2.AddFieldSet("流程事件");
                    this.Pub2.AddUL();
                    this.Pub2.AddLi("流程在运动过程中,有许多的事件,比如节点发送前、发送成功后、发送失败后、退回前、退回后、撤销发送前、这小发送后、流程结束前、结束后、删除前删除后。");
                    this.Pub2.AddLi("ccbpm把事件分为流程事件与节点事件,流程属性里定义流程事件,节点属性里定义节点事件。");
                    this.Pub2.AddLi("在这些事件里ccbpm允许调用您编写的业务逻辑,完成与界面交互、与其他系统交互、与其他流程参与人员交互。");
                    this.Pub2.AddLi("按照事件发生的类型,ccbpm把事件分为:节点、表单、流程三类的事件。");
                    this.Pub2.AddLi("在BPMN2.0规范里定义了,流程发起事件,流程发起错误事件。在ccbpm里取消了这些概念,取而代之的是开始节点的发送前、发送失败时、发送成功时的事件与之对应。");
                    this.Pub2.AddULEnd();
                    this.Pub2.AddFieldSetEnd();
                }

                if (this.FK_MapData != null && this.FK_MapData != "")
                {
                    this.Pub2.AddFieldSet("表单事件");
                    this.Pub2.AddUL();
                    this.Pub2.AddLi("流程在运动过程中,有许多的事件,比如节点发送前、发送成功后、发送失败后、退回前、退回后、撤销发送前、这小发送后、流程结束前、结束后、删除前删除后。");
                    this.Pub2.AddLi("ccbpm把事件分为流程事件与节点事件,流程属性里定义流程事件,节点属性里定义节点事件。");
                    this.Pub2.AddLi("在这些事件里ccbpm允许调用您编写的业务逻辑,完成与界面交互、与其他系统交互、与其他流程参与人员交互。");
                    this.Pub2.AddLi("按照事件发生的类型,ccbpm把事件分为:节点、表单、流程三类的事件。");
                    this.Pub2.AddLi("在BPMN2.0规范里定义了,流程发起事件,流程发起错误事件。在ccbpm里取消了这些概念,取而代之的是开始节点的发送前、发送失败时、发送成功时的事件与之对应。");
                    this.Pub2.AddULEnd();
                    this.Pub2.AddFieldSetEnd();
                }

                this.Pub2.AddDivEnd();
                return;
            }

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, myEvent) as FrmEvent;
            if (mynde == null)
            {
                mynde          = new FrmEvent();
                mynde.FK_Event = myEvent;
            }

            this.Title        = "设置:事件接口=》" + myEnentXml.Name;
            this.CurrentEvent = myEnentXml.Name;

            Pub2.Add("<div id='tabMain' class='easyui-tabs' data-options='fit:true'>");

            Pub2.Add("<div title='事件接口' style='padding:5px'>" + Environment.NewLine);
            Pub2.Add("<iframe id='src1' frameborder='0' src='' style='width:100%;height:100%' scrolling='auto'></iframe>");
            Pub2.Add("</div>" + Environment.NewLine);

            /*  该模块jflow暂时不翻译,注释掉 by fanleiwei 20160531
             * if (myEnentXml.IsHaveMsg == true)
             * {
             *  HaveMsg = true;
             *  Pub2.Add("<div title='向当事人推送消息' style='padding:5px'>" + Environment.NewLine);
             *  Pub2.Add("<iframe id='src2' frameborder='0' src='' style='width:100%;height:100%' scrolling='auto'></iframe>");
             *  Pub2.Add("</div>" + Environment.NewLine);
             *
             *  Pub2.Add("<div title='向其他指定的人推送消息' style='padding:5px'>" + Environment.NewLine);
             *  Pub2.Add("<iframe id='src3' frameborder='0' src='' style='width:100%;height:100%' scrolling='auto'></iframe>");
             *  Pub2.Add("</div>" + Environment.NewLine);
             * }
             */
            Pub2.Add("</div>");
        }
示例#30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.Response.Redirect("ImpTableField1504.aspx?EnsName=" + this.FK_MapData,
            //    true);
            //return;

            #region 第1步.
            if (this.Step == 1)
            {
                BP.Sys.SFDBSrcs ens = new BP.Sys.SFDBSrcs();
                ens.RetrieveAll();

                Pub1.AddTable("class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
                Pub1.AddTR();
                Pub1.AddTDGroupTitle("", "第1步:请选择数据源");
                Pub1.AddTREnd();

                Pub1.AddTR();
                Pub1.AddTDBegin();
                Pub1.AddUL("class='navlist'");

                foreach (BP.Sys.SFDBSrc item in ens)
                {
                    Pub1.AddLi("<div><a href='ImpTableField.aspx?Step=2&FK_MapData=" + this.FK_MapData + "&FK_SFDBSrc=" + item.No + "'><span class='nav'>" + item.No + "  -  " + item.Name + "</span></a></div>");
                }

                Pub1.AddLi("<div><a href=\"javascript:WinOpen('/WF/Comm/RefFunc/UIEn.aspx?EnsName=BP.Sys.SFDBSrcs')\" ><img src='../Img/New.gif' align='middle' /><span class='nav'>新建数据源</span></a></div>");

                Pub1.AddULEnd();
                Pub1.AddTDEnd();
                Pub1.AddTREnd();
                Pub1.AddTableEnd();
            }
            #endregion 第1步.

            #region 第2步.
            if (this.Step == 2)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);

                this.Pub1.Add("<div class='easyui-layout' data-options=\"fit:true\">");
                this.Pub1.Add(string.Format("<div data-options=\"region:'west',split:true,title:'选择 {0} 数据表/视图'\" style='width:200px;'>",
                                            src.DBName));

                DataTable dt = src.GetTables();
                this.Pub1.AddUL();
                foreach (DataRow dr in dt.Rows)
                {
                    string url = "?Step=" + this.Step + "&FK_MapData=" + this.FK_MapData + "&FK_SFDBSrc=" + this.FK_SFDBSrc + "&STable=" + dr["No"].ToString();
                    if (dr["No"].ToString() == this.STable)
                    {
                        this.Pub1.Add("<li><font color=red><b>" + dr["Name"] + "</font></b></li>");
                    }
                    else
                    {
                        this.Pub1.Add("<li><a href='" + url + "' >" + dr["Name"] + "</a></li>");
                    }
                }
                this.Pub1.AddULEnd();

                Pub1.AddDivEnd();

                this.Pub1.Add("<div data-options=\"region:'center',title:'第2步:请选择要导入的数据列(" + this.STable + ")'\" style='padding:5px;'>");

                //加载选中数据表/视图的列信息
                this.Pub1.AddTable(); // ("id='maintable' class='Table' cellSpacing='0' cellPadding='0'  border='0' style='width:100%'");
                this.Pub1.AddTR();

                var cb = new CheckBox();
                cb.ID = "CB_CheckAll";
                cb.Attributes["onclick"] = "CheckAll(this.checked)";

                this.Pub1.AddTDGroupTitle("style='width:40px;text-align:center'", cb);
                this.Pub1.AddTDGroupTitle("序");
                this.Pub1.AddTDGroupTitle("字段名");
                this.Pub1.AddTDGroupTitle("中文描述");
                this.Pub1.AddTDGroupTitle("style='width:80px;text-align:center'", "类型");
                this.Pub1.AddTDGroupTitle("style='width:50px;text-align:center'", "最大长度");
                this.Pub1.AddTREnd();

                MapAttrs attrs  = new MapAttrs(this.FK_MapData);
                bool     isHave = false;

                var tableColumns = src.GetColumns(this.STable);
                foreach (DataRow dr in tableColumns.Rows)
                {
                    cb         = new CheckBox();
                    cb.ID      = "CB_Col_" + dr["name"];
                    cb.Checked = this.SColumns == null ? false : this.SColumns.Contains(dr["name"] + ",");

                    //如果已经有该字段,就放弃.
                    if (attrs.Contains(MapAttrAttr.KeyOfEn, dr["name"].ToString()))
                    {
                        continue;
                        cb.Enabled = false;
                    }

                    this.Pub1.AddTR();
                    this.Pub1.AddTD(cb);
                    this.Pub1.AddTD(dr["colid"].ToString());
                    this.Pub1.AddTD(dr["name"].ToString());
                    this.Pub1.AddTD(dr["Desc"].ToString());
                    this.Pub1.AddTD(dr["type"].ToString());
                    this.Pub1.AddTD(Convert.ToInt32(dr["length"]));
                    this.Pub1.AddTREnd();
                }


                this.Pub1.AddTableEnd();
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Next, "下一步");
                btn.Click += new EventHandler(btn_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddSpace(1);

                this.Pub1.Add(string.Format("<a href='{0}?Step=1&FK_MapData={1}' class='easyui-linkbutton'>上一步</a>", Request.Url.AbsolutePath, this.FK_MapData));
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddDivEnd();
                this.Pub1.AddDivEnd();
            }
            #endregion 第2步.

            #region 第3步.
            if (this.Step == 3)
            {
                SFDBSrc src = new SFDBSrc(this.FK_SFDBSrc);
                this.Pub1.AddTable(); // ("id='maintable' class='Table' cellSpacing='0' cellPadding='0' border='0' style='width:100%'");
                this.Pub1.AddTDGroupTitle("序");
                this.Pub1.AddTDGroupTitle("字段名");
                this.Pub1.AddTDGroupTitle("中文描述");
                this.Pub1.AddTDGroupTitle("数据类型");
                this.Pub1.AddTDGroupTitle("逻辑类型");
                this.Pub1.AddTDGroupTitle("绑定值(双击选择)");
                this.Pub1.AddTDGroupTitle("最大长度");
                this.Pub1.AddTDGroupTitle("顺序");
                this.Pub1.AddTREnd();

                var tableColumns = src.GetColumns(this.STable);
                var idx          = 0;

                foreach (DataRow dr in tableColumns.Rows)
                {
                    if (this.SColumns.Contains(dr["name"] + ",") == false)
                    {
                        continue;
                    }

                    string typeString = dr["type"].ToString().ToLower();
                    int    mydatatype = 1;
                    if (typeString.Contains("int"))
                    {
                        mydatatype = BP.DA.DataType.AppInt;
                    }
                    if (typeString.Contains("float"))
                    {
                        mydatatype = BP.DA.DataType.AppFloat;
                    }
                    if (typeString.Contains("double"))
                    {
                        mydatatype = BP.DA.DataType.AppDouble;
                    }

                    idx++;
                    this.Pub1.AddTR();
                    this.Pub1.AddTDIdx(idx);
                    this.Pub1.AddTD(dr["name"].ToString());

                    //中文描述.
                    var tb = new TB();
                    tb.ID      = "TB_Desc_" + dr["name"];
                    tb.Columns = 20;
                    tb.Text    = dr["Desc"].ToString();
                    if (tb.Text.Length == 0)
                    {
                        tb.Text = dr["name"].ToString();
                    }
                    this.Pub1.AddTD(tb);

                    //数据类型.
                    var ddl = new DDL();
                    ddl.ID = "DDL_DBType_" + dr["name"];
                    ddl.SelfBindSysEnum(MapAttrAttr.MyDataType);
                    ddl.SetSelectItem(mydatatype); //设置选择的项目.
                    this.Pub1.AddTD(ddl);

                    //逻辑类型.
                    ddl    = new DDL();
                    ddl.ID = "DDL_LogicType_" + dr["name"];
                    ddl.SelfBindSysEnum(MapAttrAttr.LGType);
                    this.Pub1.AddTD(ddl);


                    //绑定的逻辑类型.
                    tb         = new TB();
                    tb.ID      = "TB_BindKey_" + dr["name"];
                    tb.Columns = 30;
                    tb.Text    = dr["name"].ToString();
                    tb.Attributes["ondblclick"] = "OpenSelectBindKey(this)";
                    this.Pub1.AddTD(tb);

                    //最大长度.
                    //绑定的逻辑类型.
                    tb         = new TB();
                    tb.ID      = "TB_Len_" + dr["name"];
                    tb.Columns = 5;
                    tb.Text    = dr["length"].ToString();
                    this.Pub1.AddTD(tb);

                    this.Pub1.AddTDBegin("style='text-align:center'");
                    var hiddenIdx = new HiddenField();
                    hiddenIdx.ID    = "HID_Idx_" + dr["name"];
                    hiddenIdx.Value = idx.ToString();
                    this.Pub1.Add(hiddenIdx);

                    this.Pub1.Add("<a href='javascript:void(0)' onclick='up(this, 6)' class='easyui-linkbutton' data-options=\"iconCls:'icon-up'\"></a>&nbsp;");
                    this.Pub1.Add("<a href='javascript:void(0)' onclick='down(this, 6)' class='easyui-linkbutton' data-options=\"iconCls:'icon-down'\"></a>");

                    this.Pub1.AddTDEnd();
                    this.Pub1.AddTREnd();
                }

                this.Pub1.AddTableEnd();
                this.Pub1.AddBR();
                this.Pub1.AddBR();
                this.Pub1.AddSpace(1);

                var btn = new LinkBtn(false, NamesOfBtn.Save, "导入字段,生成表单");
                btn.Click += new EventHandler(btn_Save_Click);
                this.Pub1.Add(btn);
                this.Pub1.AddSpace(1);

                this.Pub1.Add(string.Format("<a href='{0}' class='easyui-linkbutton'>上一步</a>", Request.Url.ToString().Replace("Step=3", "Step=2")));
                this.Pub1.AddBR();
                this.Pub1.AddBR();
            }
            #endregion 第3步.
        }
示例#31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.DoType == "Del")
            {
                FrmEvent delFE = new FrmEvent();
                delFE.MyPK = this.FK_MapData + "_" + this.Request.QueryString["RefXml"];
                delFE.Delete();
            }

            FrmEvents ndevs = new FrmEvents();

            if (this.FK_MapData != null)
            {
                ndevs.Retrieve(FrmEventAttr.FK_MapData, this.FK_MapData);
            }


            EventLists xmls = new EventLists();

            xmls.RetrieveAll();

            BP.WF.XML.EventSources ess = new EventSources();
            ess.RetrieveAll();

            string myEvent = this.Event;

            BP.WF.XML.EventList myEnentXml = null;

            #region //生成事件列表
            foreach (EventSource item in ess)
            {
                if (item.No == "Frm" && this.FK_MapData == null)
                {
                    continue;
                }

                if (item.No == "Node" && string.IsNullOrEmpty(this.NodeID))
                {
                    continue;
                }

                if (item.No == "Flow" && string.IsNullOrEmpty(this.FK_Flow))
                {
                    continue;
                }

                Pub1.Add(string.Format("<div title='{0}' style='padding:10px; overflow:auto' data-options=''>", item.Name));
                Pub1.AddUL("class='navlist'");

                foreach (BP.WF.XML.EventList xml in xmls)
                {
                    if (xml.EventType != item.No)
                    {
                        continue;
                    }

                    FrmEvent nde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, xml.No) as FrmEvent;
                    if (nde == null)
                    {
                        if (myEvent == xml.No)
                        {
                            CurrentEventGroup = item.Name;
                            myEnentXml        = xml;
                            Pub1.AddLi(
                                string.Format("<div style='font-weight:bold'><a href='javascript:void(0)'><span class='nav'>{0}</span></a></div>{1}", xml.Name, Environment.NewLine));
                        }
                        else
                        {
                            Pub1.AddLi(
                                string.Format("<div><a href='Action.aspx?NodeID={0}&Event={1}&FK_Flow={2}&tk={5}&FK_MapData={6}'><span class='nav'>{3}</span></a></div>{4}", NodeID, xml.No, FK_Flow, xml.Name, Environment.NewLine, new Random().NextDouble(), this.FK_MapData));
                        }
                    }
                    else
                    {
                        if (myEvent == xml.No)
                        {
                            CurrentEventGroup = item.Name;
                            myEnentXml        = xml;
                            Pub1.AddLi(
                                string.Format("<div style='font-weight:bold'><a href='javascript:void(0)'><span class='nav'>{0}</span></a></div>{1}", xml.Name, Environment.NewLine));
                        }
                        else
                        {
                            Pub1.AddLi(
                                string.Format("<div><a href='Action.aspx?NodeID={0}&Event={1}&FK_Flow={2}&MyPK={3}&tk={6}&FK_MapData={6}'><span class='nav'>{4}</span></a></div>{5}", NodeID, xml.No, FK_Flow, nde.MyPK, xml.Name, Environment.NewLine, new Random().NextDouble(), this.FK_MapData));
                        }
                    }
                }

                Pub1.AddULEnd();
                Pub1.AddDivEnd();
            }
            #endregion

            if (myEnentXml == null)
            {
                CurrentEvent = "帮助";

                Pub2.Add("<div style='width:100%; text-align:center' data-options='noheader:true'>");
                Pub2.AddH2("事件是ccflow与您的应用程序接口");

                this.Pub2.AddUL();
                this.Pub2.AddLi("流程在运动的过程中会产生很多的事件,比如:节点发送前、发送成功时、发送失败时、退回前、退后后。");
                this.Pub2.AddLi("在这些事件里ccflow允许调用您编写的业务逻辑,完成与界面交互、与其他系统交互、与其他流程参与人员交互。");
                this.Pub2.AddLi("按照事件发生的类型,ccflow把事件分为:节点、表单、流程三类的事件。");
                this.Pub2.AddULEnd();

                Pub2.AddDivEnd();
                return;
            }

            FrmEvent mynde = ndevs.GetEntityByKey(FrmEventAttr.FK_Event, myEvent) as FrmEvent;
            if (mynde == null)
            {
                mynde          = new FrmEvent();
                mynde.FK_Event = myEvent;
            }

            this.Title        = "设置:事件接口=》" + myEnentXml.Name;
            this.CurrentEvent = myEnentXml.Name;
            int col = 50;

            Pub2.Add("<div id='tabMain' class='easyui-tabs' data-options='fit:true'>");

            Pub2.Add("<div title='事件接口' style='padding:5px'>" + Environment.NewLine);
            Pub2.Add("<iframe id='src1' frameborder='0' src='' style='width:100%;height:100%' scrolling='auto'></iframe>");
            Pub2.Add("</div>" + Environment.NewLine);

            if (myEnentXml.IsHaveMsg == true)
            {
                HaveMsg = true;
                Pub2.Add("<div title='向当事人推送消息' style='padding:5px'>" + Environment.NewLine);
                Pub2.Add("<iframe id='src2' frameborder='0' src='' style='width:100%;height:100%' scrolling='auto'></iframe>");
                Pub2.Add("</div>" + Environment.NewLine);

                Pub2.Add("<div title='向其他指定的人推送消息' style='padding:5px'>" + Environment.NewLine);
                Pub2.Add("<iframe id='src3' frameborder='0' src='' style='width:100%;height:100%' scrolling='auto'></iframe>");
                Pub2.Add("</div>" + Environment.NewLine);
            }

            //BP.WF.Dev2Interface.Port_Login("zhoupeng");

            //   BP.WF.Dev2Interface.Port_SigOut();

            Pub2.Add("</div>");
        }