Esempio n. 1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            ExpressMessageInfo expMsgInfo = new ExpressMessageInfo();
            ExpressMessage expMsgBLL = new ExpressMessage();

            expMsgInfo.Body = this.txtBody.Text.Trim();

            string names = "";
            string errnames = "";

            if (this.hidMsgId.Value == "")
            {
                for (int i = 0; i < this.chklstModules.Items.Count; i++)
                {
                    if (this.chklstModules.Items[i].Selected == true)
                    {
                        expMsgInfo.ModuleName = this.chklstModules.Items[i].Value;

                        int row = expMsgBLL.Insert(expMsgInfo);
                        if (row == -1)
                        {
                            names += this.chklstModules.Items[i].Text;
                        }
                        else if (row == -2)
                        {
                            errnames += this.chklstModules.Items[i].Text;
                        }
                    }
                }
                if (names != "")
                    Alert(names + "��������ͬ����.","ExpressMessageList.aspx");
                else if (errnames != "")
                {
                    Alert(errnames + "��������������ʧ��,�ɴ������.","ExpressMessageList.aspx");
                }
                else
                {
                    Response.Redirect("ExpressMessageList.aspx");
                }
            }
            else
            {
                expMsgInfo.Id = int.Parse(this.hidMsgId.Value);
                expMsgInfo.ModuleName = this.hidModuleName.Value;

                int rowAff = expMsgBLL.Update(expMsgInfo);
                if (rowAff >= 0)
                {
                    Response.Redirect("ExpressMessageList.aspx");
                }
                else
                {
                    Alert("�޸�ϵͳ����ʧ��,�ɴ��²���.", "ExpressMessageList.aspx");
                }
            }
        }
Esempio n. 2
0
        private void SpeedMessageList()
        {
            string str = "";
            string module = XYECOM.Core.XYRequest.GetQueryString("module").Trim();

            List<Model.ExpressMessageInfo> infos = new XYECOM.Business.ExpressMessage().GetItems(module);

            if (infos.Count > 0)
            {
                foreach (Model.ExpressMessageInfo info in infos)
                {
                    str += "<msglist><id>" + info.Id + "</id><title>" + info.Body + "</title></msglist>";
                }
                ResponseXML(Result.Success, "", str);
            }
            ResponseXML(Result.Failed, "没有数据!", str);
        }
Esempio n. 3
0
        /// <summary>
        /// ����ɾ���¼�
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void lnkDel_Click(object sender, EventArgs e)
        {
            XYECOM.Business.ExpressMessage expBLL = new XYECOM.Business.ExpressMessage();
            string id = "";
            foreach (GridViewRow row in this.gvlist.Rows)
            {
                if (((CheckBox)(row.FindControl("chkExport"))).Checked == true)
                    id += "," + this.gvlist.DataKeys[row.DataItemIndex].Value.ToString();
            }

            if (id.IndexOf(",") == 0)
                id = id.Substring(1);

            int rowAff = expBLL.Delete(id);

            if (rowAff >= 0)
            {
                Response.Redirect("ExpressMessageList.aspx");
            }
            else
            {
                Alert("ɾ��ʧ��,�������²���.", "ExpressMessageList.aspx");
            }
        }
Esempio n. 4
0
        /// <summary>
        /// ��Ҫ�޸ĵ�ϵͳ��������
        /// </summary>
        /// <param name="smid"></param>
        private void BindData(string id)
        {
            if (!string.IsNullOrEmpty(id))
            {
                ExpressMessageInfo info = new ExpressMessage().GetItem(int.Parse(id)); ;

                this.caption.InnerHtml = "�޸�:";

                if (info.Body.Length > 10)
                    this.caption.InnerHtml += XYECOM.Core.Utils.IsLength(10, info.Body);
                else
                    this.caption.InnerHtml += info.Body;

                this.hidMsgId.Value = info.Id.ToString();
                this.chklstModules.Visible = false;
                this.hidModuleName.Value = info.ModuleName.ToString();
                this.lbtype.Text = GetExpMsgModuleName(info.ModuleName);
                this.txtBody.Text = info.Body;
            }
        }