Exemple #1
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                if (_morcardFacade == null)
                {
                    _morcardFacade = new MORunningCardFacade(this.DataProvider);
                }

                MORunningCardRange rcardRange = this._morcardFacade.CreateNewMORunningCardRange();

                rcardRange.MOCode = this.txtMOCode.Text.Trim().ToUpper();
                try
                {
                    rcardRange.Sequence = decimal.Parse(this.txtSeq.Text);
                }
                catch {}
                rcardRange.RunningCardType    = this.drpRCardTypeEdit.SelectedValue;
                rcardRange.MORunningCardStart = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRCardStartEdit.Text, 40));
                rcardRange.MORunningCardEnd   = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtRCardEndEdit.Text, 40));

                rcardRange.MaintainUser = this.GetUserCode();

                return(rcardRange);
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList morcardRangeList = new ArrayList(array.Count);

                foreach (UltraGridRow row in array)
                {
                    object morcardRange = this.GetEditObject(row);
                    if (morcardRange != null)
                    {
                        morcardRangeList.Add((MORunningCardRange)morcardRange);
                    }
                }

                if (_morcardFacade == null)
                {
                    _morcardFacade = new MORunningCardFacade(this.DataProvider);
                }
                this._morcardFacade.DeleteMORunningCardRange((MORunningCardRange[])morcardRangeList.ToArray(typeof(MORunningCardRange)));

                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Delete);
            }
        }
Exemple #3
0
 private int GetRowCount()
 {
     if (_morcardFacade == null)
     {
         _morcardFacade = new MORunningCardFacade(this.DataProvider);
     }
     return(this._morcardFacade.QueryMORunningCardRangeCount(this.txtMOCode.Text.Trim().ToUpper(), this.drpRCardTypeQuery.SelectedValue));
 }
Exemple #4
0
 private object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_morcardFacade == null)
     {
         _morcardFacade = new MORunningCardFacade(this.DataProvider);
     }
     return(this._morcardFacade.QueryMORunningCardRange(this.txtMOCode.Text.Trim().ToUpper(), this.drpRCardTypeQuery.SelectedValue, inclusive, exclusive));
 }
Exemple #5
0
        private object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row)
        {
            if (_morcardFacade == null)
            {
                _morcardFacade = new MORunningCardFacade(this.DataProvider);
            }
            object obj = this._morcardFacade.GetMORunningCardRange(decimal.Parse(row.Cells.FromKey("Sequence").Text.ToString()), row.Cells.FromKey("MOCode").Text.ToString());

            if (obj != null)
            {
                return((MORunningCardRange)obj);
            }

            return(null);
        }
Exemple #6
0
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            if (_morcardFacade == null)
            {
                _morcardFacade = new MORunningCardFacade(this.DataProvider);
            }
            object morcardRange = this.GetEditObject();

            if (morcardRange != null)
            {
                MORunningCardRange objRange = (MORunningCardRange)morcardRange;
                if (objRange.MORunningCardStart.Length != objRange.MORunningCardEnd.Length)
                {
                    throw new Exception("$CS_RunningCard_Range_Should_be_Equal_Length");
                }
                this._morcardFacade.UpdateMORunningCardRange(morcardRange as MORunningCardRange);
                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Save);
            }
        }
Exemple #7
0
        private void SetEditObject(object obj)
        {
            if (_morcardFacade == null)
            {
                _morcardFacade = new MORunningCardFacade(this.DataProvider);
            }
            if (obj == null)
            {
                this.txtSeq.Text = "0";
                this.drpRCardTypeEdit.SelectedIndex = 0;
                this.txtRCardStartEdit.Text         = string.Empty;
                this.txtRCardEndEdit.Text           = string.Empty;
                return;
            }

            MORunningCardRange rcardRange = (MORunningCardRange)obj;

            this.txtSeq.Text = rcardRange.Sequence.ToString();
            this.drpRCardTypeEdit.SelectedIndex = this.drpRCardTypeEdit.Items.IndexOf(this.drpRCardTypeEdit.Items.FindByValue(rcardRange.RunningCardType));
            this.txtRCardStartEdit.Text         = rcardRange.MORunningCardStart;
            this.txtRCardEndEdit.Text           = rcardRange.MORunningCardEnd;
        }