Beispiel #1
0
        protected DataRow GetGridRow(object obj)
        {
            AlertMailSetting model = (AlertMailSetting)obj;

            //return new UltraGridRow(
            //    new object[]{
            //        "false",
            //        model.Serial,
            //        model.ItemSequence,
            //        txtAlertItemDesc.Text,
            //        model.BIGSSCode,
            //        model.ItemFirstClass,
            //        model.ItemSecondClass,
            //        model.Recipients
            //    });
            DataRow row = this.DtSource.NewRow();

            row["SERIAL"] = model.Serial;
            //row["AlertItemSequence"] = model.ItemSequence;
            row["AlertItemDesc"] = txtAlertItemDesc.Text;
            //row["SSCODE"] = model.BIGSSCode;
            //row["ItemFirstClass"] = model.ItemFirstClass;
            //row["ItemSecondClass"] = model.ItemSecondClass;
            row["AlertMailRecipients"] = model.Recipients;
            return(row);
        }
Beispiel #2
0
        protected void cmdAdd_ServerClick(object sender, System.EventArgs e)
        {
            AlertMailSetting model = (AlertMailSetting)GetEditObject();

            if (model != null)
            {
                model.ItemSequence = model.ItemSequence.ToLower();
                this._AlertFacade.AddAlertMailSetting(model);
                this.RequestData();
                this._ButtonHelper.PageActionStatusHandle(PageActionType.Add);
            }
        }
Beispiel #3
0
        private string[] FormatExportRecord(object obj)
        {
            AlertMailSetting model = (AlertMailSetting)obj;

            return(new string[] {
                //model.ItemSequence,
                txtAlertItemDesc.Text,
                //model.BIGSSCode,
                //model.ItemFirstClass,
                //model.ItemSecondClass,
                model.Recipients
            });
        }
Beispiel #4
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                AlertMailSetting model = this._AlertFacade.CreateNewAlertMailSetting();

                model.ItemSequence = this.txtAlertItemSequence.Text;
                //model.BIGSSCode = this.txtSSEDIT.Text.Trim();
                //model.ItemFirstClass = this.ddlItemFirstClass.SelectedValue;
                //model.ItemSecondClass = this.ddlItemSecondClass.SelectedValue;
                model.MaintainDate = FormatHelper.TODateInt(DateTime.Now.ToShortDateString());
                model.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
                model.Recipients   = distinctUserMail(this.txtAlertMailRecipients.Text.Trim());
                model.MaintainUser = this.GetUserCode();
                //model.Serial = int.Parse(this.hidSerial.Value);
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #5
0
        //protected void chbSelectAll_CheckedChanged(object sender, System.EventArgs e)
        //{
        //    if (this.chbSelectAll.Checked)
        //    {
        //        this.gridHelper.CheckAllRows(CheckStatus.Checked);
        //    }
        //    else
        //    {
        //        this.gridHelper.CheckAllRows(CheckStatus.Unchecked);
        //    }
        //}

        protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            ArrayList rowArray = this.gridHelper.GetCheckedRows();

            if (rowArray != null && rowArray.Count > 0)
            {
                ArrayList modelArray = new ArrayList(rowArray.Count);

                foreach (GridRecord row in rowArray)
                {
                    AlertMailSetting model = (AlertMailSetting)GetEditObject(row);

                    if (model != null)
                    {
                        modelArray.Add(model);
                    }
                }
                this._AlertFacade.DeleteAlertMailSetting((AlertMailSetting[])modelArray.ToArray(typeof(AlertMailSetting)));
                this.RequestData();
                this._ButtonHelper.PageActionStatusHandle(PageActionType.Delete);
            }
        }
Beispiel #6
0
        private void SetEditObject(object obj)
        {
            AlertMailSetting model = (AlertMailSetting)obj;

            if (model == null)
            {
                //this.txtSSEDIT.Text = string.Empty;
                //this.ddlItemFirstClass.SelectedIndex = 0;
                //this.ddlItemSecondClass.SelectedIndex = 0;
                this.txtAlertMailRecipients.Text = string.Empty;
                //this.hidSerial.Value = "0";
            }
            else
            {
                //this.txtSSEDIT.Text = model.BIGSSCode;
                this.txtAlertMailRecipients.Text = model.Recipients;
                //this.hidSerial.Value = model.Serial.ToString();

                //try
                //{
                //    this.ddlItemFirstClass.SelectedValue = model.ItemFirstClass;
                //    InitSecondClassList();
                //}
                //catch
                //{
                //    this.ddlItemFirstClass.SelectedIndex = 0;
                //}

                //try
                //{
                //    this.ddlItemSecondClass.SelectedValue = model.ItemSecondClass;
                //}
                //catch
                //{
                //    this.ddlItemSecondClass.SelectedIndex = 0;
                //}
            }
        }