Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         DataTable dt = new DataTable();
         Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
         dt = fin.GetAccountGroups(CPublic.GetCompanyID());
         if (dt != null)
         {
             foreach (DataRow item in dt.Rows)
             {
                 ListItem items = new ListItem(item["name"].ToString(), item["id"].ToString());
                 ddlAccountGroups.Items.Add(items);
             }
         }
         dt = fin.GetAccountHeads(Convert.ToInt32(ddlAccountGroups.SelectedValue));
         if (dt != null)
         {
             foreach (DataRow item in dt.Rows)
             {
                 ListItem items = new ListItem(item["Fah_Name"].ToString(), item["Fah_ID"].ToString());
                 ddlTransHead.Items.Add(items);
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             //Initilization at Pageload
             ddlTransHead.LoadAccountHeads(CPublic.GetCompanyID());
             Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
             DateTime newDate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1);//From date(First day of the current month)
             txtFromDate.Text = newDate.ToString("dd-MMM-yyyy");
             txtToDate.Text   = DateTime.UtcNow.ToString("dd-MMM-yyyy");
             ddlCostCenter.LoadCost(CPublic.GetCompanyID());
             ddlTransHead.SelectedValue = "6";
             if (ddlTransHead.SelectedValue != "0")
             {
                 lblLedgerHead.InnerText = ddlTransHead.SelectedItem.Text;
             }
             else
             {
                 lblLedgerHead.InnerText = "Cash";
             }
             lblDate.InnerText = "From " + txtFromDate.Text + " to " + txtToDate.Text;
             literalGrid.Text  = fin.BindGrid(hiddenChildId.Value, ddlChildHead.SelectedValue, ddlTransHead.SelectedValue, txtFromDate.Text, txtToDate.Text, ddlCostCenter.SelectedValue);
         }
         catch (Exception)
         {
         }
     }
 }
Ejemplo n.º 3
0
 protected void btnShow_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
         if (Convert.ToDateTime(txtFromDate.Text) > Convert.ToDateTime(txtToDate.Text))
         {
             string strSaveScript = "<script language='javascript' type='text/javascript'>errorAlert('From date is greater than to date')</script>";
             ClientScript.RegisterStartupScript(typeof(string), "SaveSCript", strSaveScript);
         }
         else
         {
             fin.FromDate       = Convert.ToDateTime(txtFromDate.Text);
             fin.ToDate         = Convert.ToDateTime(txtToDate.Text);
             grdCash.DataSource = fin.ShowDailyStatement();
             grdCash.DataBind();
             grdCash.Visible = true;
         }
     }
     catch (Exception ex)
     {
         string strSaveScript = "<script language='javascript' type='text/javascript'>errorAlert('Something Went wrong')</script>";
         ClientScript.RegisterStartupScript(typeof(string), "SaveSCript", strSaveScript);
     }
 }
Ejemplo n.º 4
0
 protected void page_LoadComplete(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
         string GetDate = "";
         GetDate          = fin.GetFinancialYear();
         txtFromDate.Text = GetDate;
         txtToDate.Text   = DateTime.UtcNow.ToString("dd-MMM-yyyy");
     }
 }
Ejemplo n.º 5
0
        protected void Page_LoadComplete(object sender, EventArgs e)
        {
            customerDropdown.LoadCustomer(Publics.CPublic.GetCompanyID());
            supplierDropdown.LoadSupplier(Publics.CPublic.GetCompanyID());
            DataTable dt = new DataTable();

            Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
            dt = fin.GetAccountHeads(45);//The Parent group of Bank group is 45.
            if (dt != null)
            {
                foreach (DataRow item in dt.Rows)
                {
                    ListItem items = new ListItem(item["Fah_Name"].ToString(), item["Fah_ID"].ToString());
                    ddlPaymentBank.Items.Add(items);
                }
            }
        }
Ejemplo n.º 6
0
 protected void btnBalanceSheet_Click(object sender, EventArgs e)
 {
     try
     {
         Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions();
         int reportID = 1;
         hiddenCompanyId.Value = CPublic.GetCompanyID().ToString();
         if (Convert.ToDateTime(txtFromDate.Text) > Convert.ToDateTime(txtToDate.Text))
         {
             ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('Enter Valid Date');", true);
         }
         else
         {
             grdLiteral.Text = fin.getbalanceSheet(hiddenCompanyId, hiddenReportId, txtFromDate, txtToDate, ddlCostCenter, reportID);
         }
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('Something Went Wrong. " + ex.Message + "');", true);
     }
 }