Пример #1
0
        //Grid Fee row deleting
        #region [Grid Fee Row Deleting]

        protected void GrdFees_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                string[] confirmValue = Request.Form["confirm_value"].Split(',');
                if (confirmValue[confirmValue.Length - 1] == "Yes")
                {
                    EWA_Fees ObjEWA = new EWA_Fees();
                    BL_Fees  ObjBL  = new BL_Fees();
                    ObjEWA.Action = "DeleteParticular";
                    ObjEWA.FeesId = ViewState["FeesId"].ToString();
                    Label lblParticular = (Label)GrdFees.Rows[e.RowIndex].FindControl("lblPerticular");
                    ObjEWA.Particular = lblParticular.Text;
                    string FeesDetailsId = GrdFees.DataKeys[e.RowIndex].Values["FeesDetailsId"].ToString();
                    ObjEWA.FeesDetalsId = FeesDetailsId;

                    ObjBL.DeleteParticular_BL(ObjEWA);
                    BindGridView(ObjEWA.FeesId);
                    lblresult.ForeColor = Color.Green;
                    lblresult.Text      = ObjEWA.Particular + " Details Deleted successfully";
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Пример #2
0
        //Grid Fee Row Command
        #region [Grid Fee Row Command]

        protected void GrdFees_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                EWA_Fees ObjEWA = new EWA_Fees();
                BL_Fees  ObjBL  = new BL_Fees();
                if (e.CommandName.Equals("AddNew"))
                {
                    TextBox txtParticular = (TextBox)GrdFees.FooterRow.FindControl("txtFooterPerticular");
                    TextBox txtAmount     = (TextBox)GrdFees.FooterRow.FindControl("txtFooterAmount");

                    ObjEWA.FeesId     = ViewState["FeesId"].ToString();
                    ObjEWA.Particular = txtParticular.Text;
                    ObjEWA.Amount     = txtAmount.Text;
                    ObjEWA.Action     = "Save";
                    ObjBL.AddNewRow_BL(ObjEWA);
                    BindGridView(ObjEWA.FeesId);
                    lblresult.ForeColor = Color.Green;
                    lblresult.Text      = ObjEWA.Particular + " Details inserted successfully";

                    //msgBox.ShowMessage("Particular added successfully !!!", "Information", UserControls.MessageBox.MessageStyle.Critical);
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Пример #3
0
        //Bind Grid View
        #region [Bind Grid View]

        private void BindGridView(string feesId)
        {
            try
            {
                EWA_Fees ObjEWA = new EWA_Fees();
                BL_Fees  ObjBL  = new BL_Fees();

                if (!feesId.Equals("Empty"))
                {
                    ObjEWA.FeesId = feesId;
                    DataSet ds = ObjBL.BindGridView_BL(ObjEWA);

                    if (ds != null)
                    {
                        GrdFees.DataSource = ds;
                        GrdFees.DataBind();
                    }
                    else
                    {
                        BindEmptyDataTable();
                    }
                }
                else
                {
                    BindEmptyDataTable();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Пример #4
0
        //Caste Category Index Changed
        #region [Caste Category Index Changed]

        protected void ddlCastCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                EWA_Fees ObjEWA = new EWA_Fees();
                BL_Fees  ObjBL  = new BL_Fees();
                ObjEWA.OrgId           = Session["OrgId"].ToString();
                ObjEWA.CourseId        = ddlCourse.SelectedValue;
                ObjEWA.ClassId         = ddlClass.SelectedValue;
                ObjEWA.CasteCategoryId = ddlCastCategory.SelectedValue;

                ObjEWA.AcademicYear = ddlAcademicYear.SelectedValue;

                if (!ObjEWA.CasteCategoryId.Equals("Select"))
                {
                    DataSet ds = ObjBL.GetFeesId_BL(ObjEWA);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        feesId = ds.Tables[0].Rows[0]["FeesId"].ToString();
                        ViewState["FeesId"] = feesId;
                        ObjEWA.OrgId        = Session["OrgId"].ToString();
                        BindGridView(feesId);
                    }
                    else
                    {
                        ObjEWA.OrgId    = Session["OrgId"].ToString();
                        ObjEWA.CourseId = ddlCourse.SelectedValue;
                        ObjEWA.BranchId = ddlBranch.SelectedValue;
                        ObjEWA.ClassId  = ddlClass.SelectedValue;

                        ObjEWA.AcademicYear = ddlAcademicYear.SelectedValue;

                        ObjEWA.CasteCategoryId = ddlCastCategory.SelectedValue;
                        ObjEWA.Action          = "Save";
                        ObjBL.AddNewFees_BL(ObjEWA);
                        ds     = ObjBL.GetFeesId_BL(ObjEWA);
                        feesId = ds.Tables[0].Rows[0]["FeesId"].ToString();
                        ViewState["FeesId"] = feesId;
                        BindGridView("Empty");
                    }
                }
                else
                {
                    BindEmptyDataTable();
                }
                lblresult.Text = "";
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Пример #5
0
        //Bind Academic Year
        #region [Bind Academic Year]

        protected void BindAcademicYear()
        {
            try
            {
                EWA_AcademicYear ObjEWA = new EWA_AcademicYear();
                BL_Fees          ObjBL  = new BL_Fees();

                ObjEWA.OrgId = Convert.ToInt32(Session["OrgId"]);
                DataSet ds = ObjBL.BindAcademicYear_BL(ObjEWA);
                ddlAcademicYear.DataSource     = ds;
                ddlAcademicYear.DataTextField  = "AcademicYear";
                ddlAcademicYear.DataValueField = "AcademicYearId";
                ddlAcademicYear.DataBind();
                ddlAcademicYear.Items.Insert(0, new ListItem("Select", "0"));
                BindEmptyDataTable();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Пример #6
0
        //Grid Fee Row Updating
        #region [Grid Fee Row Updating]

        protected void GrdFees_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                EWA_Fees ObjEWA = new EWA_Fees();
                BL_Fees  ObjBL  = new BL_Fees();
                ObjEWA.Action = "UpdateParticular";
                ObjEWA.FeesId = ViewState["FeesId"].ToString();
                TextBox txtParticular = (TextBox)GrdFees.Rows[e.RowIndex].FindControl("txtPerticular");
                TextBox txtAmount     = (TextBox)GrdFees.Rows[e.RowIndex].FindControl("txtAmount");
                string  FeesDetailsId = GrdFees.DataKeys[e.RowIndex].Values["FeesDetailsId"].ToString();

                ObjEWA.FeesDetalsId  = FeesDetailsId;
                ObjEWA.Particular    = txtParticular.Text;
                ObjEWA.Amount        = txtAmount.Text;
                ObjEWA.OldParticular = ViewState["OldParticular"].ToString();
                ObjEWA.OldAmount     = ViewState["OldAmount"].ToString();
                int result = ObjBL.UpdateParticular_BL(ObjEWA);

                GrdFees.EditIndex = -1;
                BindGridView(ObjEWA.FeesId);


                if (result > 0)
                {
                    lblresult.ForeColor = Color.Green;
                    lblresult.Text      = ObjEWA.Particular + " Details Updated successfully";
                }
                else
                {
                    lblresult.ForeColor = Color.Red;
                    lblresult.Text      = ObjEWA.OldParticular + " Details is in use. Not updated.";
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }