Beispiel #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.rfvEffectDate.IsValid && this.rfvLocation.IsValid && this.rfvRegion.IsValid && this.rfvCostCenterCode.IsValid &&
            this.rfvSubjectCode.IsValid && this.rfvEffectDate.IsValid && this.rfvAccountCode.IsValid)
        {
            if (this.MiscOrder.MiscOrderDetails != null && this.MiscOrder.MiscOrderDetails.Count == 0)
            {
                ShowErrorMessage("MasterData.MiscOrder.Error.NoDetails");
                return;
            }
            try
            {
                MiscOrder.SubjectList = TheSubjectListMgr.LoadSubjectList(this.tbSubjectCode.Text.Trim(), this.tbCostCenterCode.Text.Trim(), this.tbAccountCode.Text.Trim());

                MiscOrder.Remark           = this.tbMiscOrderDescription.Text;
                MiscOrder.Type             = this.ModuleType;
                MiscOrder.Location         = this.TheLocationMgr.LoadLocation(this.tbMiscOrderLocation.Text);
                MiscOrder.EffectiveDate    = DateTime.Parse(this.tbMiscOrderEffectDate.Text);
                MiscOrder.ReferenceOrderNo = this.tbRefNo.Text.Trim();
                MiscOrder.ProjectCode      = this.tbProjectCode.Text.Trim();

                MiscOrder = TheMiscOrderMgr.SaveMiscOrder(MiscOrder, this.CurrentUser);

                InitPageParameter();
            }
            catch (BusinessErrorException ex)
            {
                ShowErrorMessage(ex);
            }
        }
    }
Beispiel #2
0
 public void ViewMiscOrder(string actionParameter)
 {
     if (actionParameter != null)
     {
         MiscOrder = TheMiscOrderMgr.ReLoadMiscOrder(actionParameter);
     }
     this.updateView(false);
     noEditable(true);
 }
Beispiel #3
0
    private bool MiscOrderSave(bool savetodb, bool saveHead)
    {
        if (saveHead)
        {
            string tbEffectDate = this.tbMiscOrderEffectDate.Text != string.Empty ? this.tbMiscOrderEffectDate.Text.Trim() : string.Empty;
            if (tbEffectDate == string.Empty)
            {
                ShowErrorMessage("MasterData.MiscOrder.WarningMessage.EffectDateEmpty");
                return(false);
            }

            MiscOrder.Reason           = this.ddlReason.SelectedIndex != -1 ? this.ddlReason.SelectedValue : string.Empty;
            MiscOrder.Remark           = this.tbMiscOrderDescription.Text;
            MiscOrder.Type             = this.ModuleType;
            MiscOrder.Location         = this.TheLocationMgr.LoadLocation(this.tbMiscOrderLocation.Text);
            MiscOrder.EffectiveDate    = DateTime.Parse(this.tbMiscOrderEffectDate.Text);
            MiscOrder.ReferenceOrderNo = this.tbRefNo.Text.Trim();
        }
        if (buildMiscOrderDetails(saveHead))
        {
            if (savetodb)
            {
                if (savePreCheck())
                {
                    MiscOrder = TheMiscOrderMgr.SaveMiscOrder(MiscOrder, this.CurrentUser);
                    return(true);
                }
                else
                {
                    ShowErrorMessage("MasterData.MiscOrder.Error.NoDetails");
                    return(false);
                }
            }
            else
            {
                return(true);
            }
        }
        else
        {
            return(false);
        }
    }
Beispiel #4
0
    public void InitPageParameter(string miscOrderNo)
    {
        MiscOrder miscOrder = TheMiscOrderMgr.ReLoadMiscOrder(miscOrderNo);

        if (miscOrder.MiscOrderDetails != null && miscOrder.MiscOrderDetails.Count > 0)
        {
            if (miscOrder.MiscOrderDetails[0].HuId != null && miscOrder.MiscOrderDetails[0].HuId != string.Empty)
            {
                this.ucNewHu.MiscOrder = miscOrder;
                this.ucNewHu.InitPageParameter();
                TabCreateByHuClick_Render(null, null);
            }
            else
            {
                this.ucNewQty.MiscOrder = miscOrder;
                this.ucNewQty.InitPageParameter();
                TabCreateByQtyClick_Render(null, null);
            }
        }
    }