Exemplo n.º 1
0
        void btn_Click(object sender, EventArgs e)
        {
            BP.WF.SMS msg = new BP.WF.SMS();
            msg.Title      = this.Pub1.GetTextBoxByID("TB_Title").Text;
            msg.DocOfEmail = this.Pub1.GetTextBoxByID("TB_Doc").Text;
            msg.Sender     = WebUser.No;
            msg.RDT        = DataType.CurrentDataTime;

            string acces = this.Pub1.GetTextBoxByID("TB_Emps").Text.Trim();

            if (acces.Length == 0)
            {
                throw new Exception("请输入或者选择接受人.");
            }

            if (msg.Title.Length == 0)
            {
                throw new Exception("请输入标题.");
            }

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

            string[] strs = acces.Split(',');
            foreach (string str in strs)
            {
                if (str == null || str == "")
                {
                    continue;
                }

                msg.SendToEmpNo = str;
                msg.MyPK        = DBAccess.GenerOID().ToString();
                msg.Insert();
            }

            BP.DA.Paras ps = new BP.DA.Paras();
            ps.Add("Sender", WebUser.No);
            ps.Add("Receivers", msg.SendToEmpNo);
            ps.Add("Title", msg.Title);
            ps.Add("Context", msg.DocOfEmail);
            try
            {
                DBAccess.RunSP("CCstaff", ps);
            }
            catch (Exception ex)
            {
                this.ToWFMsgPage("发送消息出现错误:" + ex.Message);
                return;
            }
            this.ToWFMsgPage("您的信息已经成功的发送到:" + acces);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BP.WF.SMS msg = new BP.WF.SMS();
            switch (this.DoType)
            {
            case "Re":
                //msg.MyPK = this.RefOID;
                //if (msg.Accepter != WebUser.No)
                //{
                //    //return;
                //}
                //msg.Title = "RE:" + msg.Title;
                //msg.Doc = " ----------------- " + msg.Doc;
                //msg.Accepter = msg.Sender;
                break;

            default:
                if (this.WorkID != 0 && this.FK_Node != 0)
                {
                    Node nd = new Node(this.FK_Node);
                    Work wk = nd.HisWork;
                    wk.OID = this.WorkID;
                    wk.Retrieve();

                    string msgInfo = "\t\n ************** 工作信息 **************";
                    Attrs  attrs   = wk.EnMap.Attrs;
                    foreach (Attr attr in attrs)
                    {
                        if (attr.UIVisible == false)
                        {
                            continue;
                        }

                        if (attr.IsFKorEnum)
                        {
                            continue;
                        }

                        msgInfo += "\t\n" + attr.Desc + ": " + wk.GetValStrByKey(attr.Key);
                    }
                    msg.DocOfEmail = msgInfo;
                }
                break;
            }
            this.Pub1.AddTable("width='95%'");
            if (WebUser.IsWap)
            {
                this.Pub1.AddCaptionLeft("<a href='./../Home.aspx' ><img src='./../Img/Home.gif' border=0>Home</a> - <a href='./../../WAP/Msg.aspx' >列表</a>");
            }
            //else
            //    this.Pub1.AddCaption("&nbsp;&nbsp;&nbsp;信息发送");

            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("width=10%", "<b>接受人</b>");
            TextBox tb = new TextBox();

            tb.ID                  = "TB_Emps";
            tb.Columns             = 80;
            tb.Text                = msg.SendToEmpNo;
            tb.Attributes["Width"] = "100%";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            this.Pub1.AddTDTitle("width=10%", "<b>标题</b>");
            tb                     = new TextBox();
            tb.ID                  = "TB_Title";
            tb.Columns             = 80;
            tb.Text                = msg.Title;
            tb.Attributes["Width"] = "100%";
            this.Pub1.AddTD(tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTR();
            tb                     = new TextBox();
            tb.ID                  = "TB_Doc";
            tb.Rows                = 15;
            tb.Columns             = 70;
            tb.Text                = msg.DocOfEmail;
            tb.TextMode            = TextBoxMode.MultiLine;
            tb.Attributes["Width"] = "100%";
            this.Pub1.AddTD("colspan=2", tb);
            this.Pub1.AddTREnd();

            this.Pub1.AddTRSum();
            Button btn = new Button();

            btn.CssClass = "Btn";
            btn.ID       = "Btn_Send";
            btn.Text     = "  发 送  ";
            btn.Click   += new EventHandler(btn_Click);
            this.Pub1.AddTD("colspan=2", btn);
            this.Pub1.AddTREnd();
            this.Pub1.AddTableEnd();
        }
Exemplo n.º 3
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();
        }