Exemplo n.º 1
0
        public void CreateAndRaise3()
        {
            Pub3 p3 = new Pub3();

            p3.OnChange += (sender, e) => Console.WriteLine("Event raised: {0}", e.Value);

            p3.Raise();
        }
Exemplo n.º 2
0
 /// <summary>
 /// 生成组织结构信息
 /// </summary>
 private void GenerateCheckedInfo()
 {
     Pub3.AddUL();
     Pub3.AddLi("组织结构模式:<span style='font-weight:bold;'>" + (gvarSModel == null ? "未选" : _smodels[int.Parse(gvarSModel.Val) - 1]) + "</span>");
     Pub3.AddLi("组织结构维护方式:<span style='font-weight:bold;'>" + (gvarSMKind == null ? "未选" : _smkinds[int.Parse(gvarSMKind.Val) - 1]) + "</span>");
     Pub3.AddLi("组织结构来源:<span style='font-weight:bold;'>" + (gvarSSource == null ? "未选" : _ssources[int.Parse(gvarSSource.Val) - 1]) + "</span>");
     Pub3.AddULEnd();
 }
Exemplo n.º 3
0
        private void UsingEventHandlerWithEventArgs()
        {
            Console.WriteLine("Implementing Event Handler with Event Args, locking and event Property");
            Console.WriteLine("Type applied to Event handler need not extent EventArgs class");
            Pub3 pub = new Pub3();

            pub.OnChange += (sender, e) => Console.WriteLine("Event 1 raised:{0} by {1}", e.Value, sender);
            pub.OnChange += (sender, e) => Console.WriteLine("Event 2 raised:{0} by {1}", e.Value, sender);
            pub.Raise();
            Console.WriteLine("In above example a custom event accessor is used");
            Console.WriteLine("Custom event accessor is like property but it has add and remove blocks instead of get and set;");
        }
Exemplo n.º 4
0
        void lbtn_Click(object sender, EventArgs e)
        {
            var depts     = (Pub3.FindControl("Hid_Dept") as HiddenField).Value;
            var emps      = (Pub3.FindControl("Hid_FQR") as HiddenField).Value;
            var deptsText = Pub3.GetTBByID("TB_Dept").Text;
            var empsText  = Pub3.GetTBByID("TB_FQR").Text;
            var dateFrom  = Pub3.GetTBByID("TB_DateFrom").Text;
            var dateTo    = Pub3.GetTBByID("TB_DateTo").Text;
            var keywords  = Pub3.GetTBByID("TB_KeyWords").Text;

            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);

            Response.Redirect(url, true);
        }
Exemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //add by dgq 不要在这里做转,影响其他地方使用
            //this.Response.Redirect("/WF/Comm/Search.aspx?EnsName=BP.WF.Data.Monitors", true);
            //return;

            if (this.DoType == "DelIt")
            {
                try
                {
                    WorkFlow wf = new WorkFlow(this.FK_Flow, this.WorkID);
                    wf.DoDeleteWorkFlowByReal(true);
                }
                catch (Exception ex)
                {
                    this.Response.Write(ex.Message);
                    this.Alert(ex.Message);
                }
                return;
            }

            Pub3.Add("<div style='width:100%; padding: 2px; height: auto;background-color:#E0ECFF; line-height:30px'>");

            Pub3.Add("部门:");
            var tb = new TB();

            tb.ID   = "TB_Dept";
            tb.Text = DeptsText;
            tb.Style.Add("width", "100px");
            Pub3.Add(tb);

            var hid = new HiddenField();

            hid.ID    = "Hid_Dept";
            hid.Value = Depts;
            Pub3.Add(hid);

            Pub3.Add("<a class='easyui-linkbutton' href=\"javascript:openSelectDept('" + hid.ClientID + "','" + tb.ClientID + "')\" data-options=\"iconCls:'icon-department',plain:true\" title='选择部门'> </a>&nbsp;&nbsp;");

            Pub3.Add("发起人:");
            tb      = new TB();
            tb.ID   = "TB_FQR";
            tb.Text = EmpsText;
            tb.Style.Add("width", "100px");
            Pub3.Add(tb);

            hid       = new HiddenField();
            hid.ID    = "Hid_FQR";
            hid.Value = Emps;
            Pub3.Add(hid);

            Pub3.Add("<a class='easyui-linkbutton' href=\"javascript:openSelectEmp('" + hid.ClientID + "','" + tb.ClientID + "')\" data-options=\"iconCls:'icon-user',plain:true\" title='选择发起人'> </a>&nbsp;&nbsp;");

            Pub3.Add("发起日期:");
            tb      = new TB();
            tb.ID   = "TB_DateFrom";
            tb.Text = DateFrom;
            tb.Style.Add("width", "80px");
            tb.Attributes["onfocus"] = "WdatePicker();";
            Pub3.Add(tb);

            Pub3.AddSpace(1);
            Pub3.Add("到");
            Pub3.AddSpace(1);

            tb      = new TB();
            tb.ID   = "TB_DateTo";
            tb.Text = DateTo;
            tb.Style.Add("width", "80px");
            tb.Attributes["onfocus"] = "WdatePicker();";
            Pub3.Add(tb);
            Pub3.AddSpace(2);

            Pub3.Add("关键字:");
            tb      = new TB();
            tb.ID   = "TB_KeyWords";
            tb.Text = Keywords;
            tb.Style.Add("width", "100px");
            Pub3.Add(tb);

            var lbtn = new LinkBtn(false, NamesOfBtn.Search, "查询");

            lbtn.Click += new EventHandler(lbtn_Click);

            Pub3.AddSpace(1);
            Pub3.Add(lbtn);

            Pub3.AddDivEnd();

            if (IsSearch)
            {
                BindSearch();
            }
        }
Exemplo n.º 6
0
 private void UsingEventHandlerWithEventArgs()
 {
     Console.WriteLine("Implementing Event Handler with Event Args, locking and event Property");
     Console.WriteLine("Type applied to Event handler need not extent EventArgs class");
     Pub3 pub = new Pub3();
     pub.OnChange += (sender, e) => Console.WriteLine("Event 1 raised:{0} by {1}", e.Value, sender);
     pub.OnChange += (sender, e) => Console.WriteLine("Event 2 raised:{0} by {1}", e.Value, sender);
     pub.Raise();
     Console.WriteLine("In above example a custom event accessor is used");
     Console.WriteLine("Custom event accessor is like property but it has add and remove blocks instead of get and set;");
 }