protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.ViewState["customerCallId"] == null)
            {
                ShowError("Número de chamado inexistente!");
                return;
            }

            var expenditureAuthorization = new Vivina.Erp.DataClasses.ExpenditureAuthorization();

            if (!String.IsNullOrEmpty(Request["ExpenditureAuthorizationId"]))
                expenditureAuthorization = AccountManager.GetExpenditureAuthorization(Convert.ToInt32(Request["ExpenditureAuthorizationId"]));

            expenditureAuthorization.CustomerCallId = Convert.ToInt32(Page.ViewState["customerCallId"]);

            expenditureAuthorization.Amount = ucCurrFieldAmount.CurrencyValue.Value;
            expenditureAuthorization.CompanyId = Company.CompanyId;
            expenditureAuthorization.Description = txtDescription.Text;

            AccountManager.SaveExpenditureAuthorization(expenditureAuthorization);
            Response.Redirect("ExpenditureAuthorizations.aspx");
        }
Пример #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.ViewState["customerCallId"] == null)
            {
                ShowError("Número de chamado inexistente!");
                return;
            }

            var expenditureAuthorization = new Vivina.Erp.DataClasses.ExpenditureAuthorization();

            if (!String.IsNullOrEmpty(Request["ExpenditureAuthorizationId"]))
            {
                expenditureAuthorization = AccountManager.GetExpenditureAuthorization(Convert.ToInt32(Request["ExpenditureAuthorizationId"]));
            }

            expenditureAuthorization.CustomerCallId = Convert.ToInt32(Page.ViewState["customerCallId"]);

            expenditureAuthorization.Amount      = ucCurrFieldAmount.CurrencyValue.Value;
            expenditureAuthorization.CompanyId   = Company.CompanyId;
            expenditureAuthorization.Description = txtDescription.Text;

            AccountManager.SaveExpenditureAuthorization(expenditureAuthorization);
            Response.Redirect("ExpenditureAuthorizations.aspx");
        }