Ejemplo n.º 1
0
 /// <summary>
 /// Function to Update values in BudgetMaster Table
 /// </summary>
 /// <param name="budgetmasterinfo"></param>
 public void BudgetMasterEdit(BudgetMasterInfo budgetmasterinfo)
 {
     try
     {
         SPBudgetMaster.BudgetMasterEdit(budgetmasterinfo);
     }
     catch (Exception ex)
     {
         MessageBox.Show("BGBll9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 public void BudgetMasterEdit(BudgetMasterInfo InfoBudgetMaster)
 {
     try
     {
         SpBudgetMaster.BudgetMasterEdit(InfoBudgetMaster);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SB3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Function to get particular values from BudgetMaster table based on the parameter
        /// </summary>
        /// <param name="budgetMasterId"></param>
        /// <returns></returns>
        public BudgetMasterInfo BudgetMasterView(decimal budgetMasterId)
        {
            BudgetMasterInfo budgetmasterinfo = new BudgetMasterInfo();

            try
            {
                budgetmasterinfo = SPBudgetMaster.BudgetMasterView(budgetMasterId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("BGBll11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(budgetmasterinfo);
        }
Ejemplo n.º 4
0
        public decimal BudgetMasterAdd(BudgetMasterInfo budgetmasterinfo)
        {
            decimal decIdentity = 0;

            try
            {
                decIdentity = SPBudgetMaster.BudgetMasterAdd(budgetmasterinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("BGBll8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decIdentity);
        }
        public BudgetMasterInfo BudgetMasterView(decimal DecMasterId)
        {
            BudgetMasterInfo InfoBudgetMaster = new BudgetMasterInfo();

            try
            {
                InfoBudgetMaster = SpBudgetMaster.BudgetMasterView(DecMasterId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("SB6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(InfoBudgetMaster);
        }
        public decimal BudgetMasterAdd(BudgetMasterInfo InfoBudgetMaster)
        {
            decimal decId = 0;

            try
            {
                decId = SpBudgetMaster.BudgetMasterAdd(InfoBudgetMaster);
            }

            catch (Exception ex)
            {
                MessageBox.Show("SB1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decId);
        }
        /// <summary>
        /// Function to insert values to budgetMaster Table
        /// </summary>
        /// <param name="budgetmasterinfo"></param>
        /// <returns></returns>
        public decimal BudgetMasterAdd(BudgetMasterInfo budgetmasterinfo)
        {
            decimal decIdentity = 0;

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("BudgetMasterAdd", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam       = sccmd.Parameters.Add("@budgetName", SqlDbType.VarChar);
                sprmparam.Value = budgetmasterinfo.BudgetName;
                sprmparam       = sccmd.Parameters.Add("@type", SqlDbType.VarChar);
                sprmparam.Value = budgetmasterinfo.Type;
                sprmparam       = sccmd.Parameters.Add("@totalDr", SqlDbType.Decimal);
                sprmparam.Value = budgetmasterinfo.TotalDr;
                sprmparam       = sccmd.Parameters.Add("@totalCr", SqlDbType.Decimal);
                sprmparam.Value = budgetmasterinfo.TotalCr;
                sprmparam       = sccmd.Parameters.Add("@fromDate", SqlDbType.DateTime);
                sprmparam.Value = budgetmasterinfo.FromDate;
                sprmparam       = sccmd.Parameters.Add("@toDate", SqlDbType.DateTime);
                sprmparam.Value = budgetmasterinfo.ToDate;
                sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
                sprmparam.Value = budgetmasterinfo.Narration;
                sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam.Value = budgetmasterinfo.Extra1;
                sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam.Value = budgetmasterinfo.Extra2;
                decIdentity     = Convert.ToDecimal(sccmd.ExecuteScalar());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sqlcon.Close();
            }
            return(decIdentity);
        }
 /// <summary>
 /// Function to Update values in BudgetMaster Table
 /// </summary>
 /// <param name="budgetmasterinfo"></param>
 public void BudgetMasterEdit(BudgetMasterInfo budgetmasterinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("BudgetMasterEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam       = sccmd.Parameters.Add("@budgetMasterId", SqlDbType.Decimal);
         sprmparam.Value = budgetmasterinfo.BudgetMasterId;
         sprmparam       = sccmd.Parameters.Add("@budgetName", SqlDbType.VarChar);
         sprmparam.Value = budgetmasterinfo.BudgetName;
         sprmparam       = sccmd.Parameters.Add("@type", SqlDbType.VarChar);
         sprmparam.Value = budgetmasterinfo.Type;
         sprmparam       = sccmd.Parameters.Add("@totalDr", SqlDbType.Decimal);
         sprmparam.Value = budgetmasterinfo.TotalDr;
         sprmparam       = sccmd.Parameters.Add("@totalCr", SqlDbType.Decimal);
         sprmparam.Value = budgetmasterinfo.TotalCr;
         sprmparam       = sccmd.Parameters.Add("@fromDate", SqlDbType.DateTime);
         sprmparam.Value = budgetmasterinfo.FromDate;
         sprmparam       = sccmd.Parameters.Add("@toDate", SqlDbType.DateTime);
         sprmparam.Value = budgetmasterinfo.ToDate;
         sprmparam       = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = budgetmasterinfo.Narration;
         sprmparam       = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = budgetmasterinfo.Extra1;
         sprmparam       = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = budgetmasterinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
        /// <summary>
        /// Function to get particular values from BudgetMaster table based on the parameter
        /// </summary>
        /// <param name="budgetMasterId"></param>
        /// <returns></returns>
        public BudgetMasterInfo BudgetMasterView(decimal budgetMasterId)
        {
            BudgetMasterInfo budgetmasterinfo = new BudgetMasterInfo();
            SqlDataReader    sdrreader        = null;

            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("BudgetMasterView", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam       = sccmd.Parameters.Add("@budgetMasterId", SqlDbType.Decimal);
                sprmparam.Value = budgetMasterId;
                sdrreader       = sccmd.ExecuteReader();
                while (sdrreader.Read())
                {
                    budgetmasterinfo.BudgetMasterId = Convert.ToDecimal(sdrreader["budgetMasterId"].ToString());
                    budgetmasterinfo.BudgetName     = sdrreader["budgetName"].ToString();
                    budgetmasterinfo.Type           = sdrreader["type"].ToString();
                    budgetmasterinfo.TotalDr        = Convert.ToDecimal(sdrreader["totalDr"].ToString());
                    budgetmasterinfo.TotalCr        = Convert.ToDecimal(sdrreader["totalCr"].ToString());
                    budgetmasterinfo.FromDate       = DateTime.Parse(sdrreader["fromDate"].ToString());
                    budgetmasterinfo.ToDate         = DateTime.Parse(sdrreader["toDate"].ToString());
                    budgetmasterinfo.Narration      = sdrreader["narration"].ToString();
                    budgetmasterinfo.Extra1         = sdrreader["extra1"].ToString();
                    budgetmasterinfo.Extra2         = sdrreader["extra2"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sdrreader.Close();
                sqlcon.Close();
            }
            return(budgetmasterinfo);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// function to fill controls for update
        /// </summary>
        public void FillControls()
        {
            try
            {

                dgvBudget.Rows.Clear();
                infoBudgetMaster = BllBudget.BudgetMasterView(decBudgetMasterIdentity);
                txtBudgetName.Text = infoBudgetMaster.BudgetName;
                cmbType.Text = infoBudgetMaster.Type;
                txtTotalCr.Text = infoBudgetMaster.TotalCr.ToString();
                txtTotalDr.Text = infoBudgetMaster.TotalDr.ToString();
                txtFromDate.Text = infoBudgetMaster.FromDate.ToString("dd-MMM-yyyy");
                txtToDate.Text = infoBudgetMaster.ToDate.ToString("dd-MMM-yyyy");
                txtNarration.Text = infoBudgetMaster.Narration;
                decBudgetId = infoBudgetMaster.BudgetMasterId;
                List<DataTable> listObj = new List<DataTable>();
                listObj = BllBudget.BudgetDetailsViewByMasterId(decBudgetMasterIdentity);
                for (int i = 0; i < listObj[0].Rows.Count; i++)
                {

                    dgvBudget.Rows.Add();

                    dgvBudget.Rows[i].HeaderCell.Value = string.Empty;
                    dgvBudget.Rows[i].Cells["budgetDetailsId"].Value = Convert.ToDecimal(listObj[0].Rows[i]["budgetDetailsId"].ToString());

                    if (dgvBudget.Rows[i].Cells["dgvcmbParticular"].Value == null)
                    {

                        dgvBudget.Rows[i].Cells["dgvcmbParticular"].Value = Convert.ToDecimal(listObj[0].Rows[i]["ledgerId"].ToString());
                    }

                    if (Convert.ToDecimal(listObj[0].Rows[i]["debit"].ToString()) == 0)
                    {
                        dgvBudget.Rows[i].Cells["dgvcmbDrOrCr"].Value = "Cr";
                        dgvBudget.Rows[i].Cells["dgvtxtAmount"].Value = Convert.ToDecimal(listObj[0].Rows[i]["credit"].ToString());
                    }
                    else
                    {
                        dgvBudget.Rows[i].Cells["dgvcmbDrOrCr"].Value = "Dr";
                        dgvBudget.Rows[i].Cells["dgvtxtAmount"].Value = Convert.ToDecimal(listObj[0].Rows[i]["debit"].ToString());
                    }

                }
            }

            catch (Exception ex)
            {
                MessageBox.Show("BU9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }