コード例 #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     divError.Visible = false;
     using (AccountBudget objAccountBudget = new AccountBudget())
     {
         objAccountBudget.AccountBudgetCategoryCode = "01";
         objAccountBudget.FiscalYearCode            = Convert.ToInt16(ddlFiscalYear.SelectedValue);
         objAccountBudget.ResponsibilityCode        = Request.QueryString["rccode"].ToString();
         objAccountBudget.ChargeTypeCode            = "01";
         objAccountBudget.AccountItemCode           = Convert.ToInt16(ddlAccountItem.SelectedValue);
         objAccountBudget.BudgetValue  = Convert.ToDouble(txtInitialBudget.Text);
         objAccountBudget.Remarks      = txtRemarks.Text;
         objAccountBudget.CreatedBy    = Request.Cookies["Speedo"]["UserName"].ToString();
         objAccountBudget.CreatedOn    = DateTime.Now;
         objAccountBudget.ModifiedBy   = Request.Cookies["Speedo"]["UserName"].ToString();
         objAccountBudget.ModifiedOn   = DateTime.Now;
         objAccountBudget.RecordStatus = "1";
         if (AccountBudget.IsInitialBudgetExist(Convert.ToInt16(ddlFiscalYear.SelectedValue), Request.QueryString["rccode"].ToString(), Convert.ToInt16(ddlAccountItem.SelectedValue)) == false)
         {
             if (objAccountBudget.Insert() > 0)
             {
                 this.LoadGrid();
             }
         }
         else
         {
             divError.Visible = true;
             lblErrMsg.Text   = "Budget for the selected account item already initialized.";
         }
     }
 }
コード例 #2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        divError.Visible = false;
        using (AccountBudget objAccountBudget = new AccountBudget())
        {
            objAccountBudget.AccountBudgetCategoryCode = ddlBudgetCategory.SelectedValue.ToString();
            objAccountBudget.FiscalYearCode            = Convert.ToInt16(ddlFiscalYear.SelectedValue);
            objAccountBudget.ResponsibilityCode        = Request.QueryString["rccode"].ToString();
            objAccountBudget.ChargeTypeCode            = "01";
            objAccountBudget.AccountItemCode           = Convert.ToInt16(Request.QueryString["accnt_items_code"]);
            objAccountBudget.BudgetValue  = Convert.ToDouble(txtAmount.Text);
            objAccountBudget.Remarks      = txtRemarks.Text;
            objAccountBudget.CreatedBy    = Request.Cookies["Speedo"]["UserName"].ToString();
            objAccountBudget.CreatedOn    = DateTime.Now;
            objAccountBudget.ModifiedBy   = Request.Cookies["Speedo"]["UserName"].ToString();
            objAccountBudget.ModifiedOn   = DateTime.Now;
            objAccountBudget.RecordStatus = "1";

            if (objAccountBudget.Insert() > 0)
            {
                this.LoadGrid();
            }
        }
    }