Ejemplo n.º 1
0
        public void BindFeesGroup()
        {
            try
            {
                FeesGroupBl       objFeesGroupBL = new FeesGroupBl();
                ApplicationResult objResult      = new ApplicationResult();

                objResult = objFeesGroupBL.FeesGroup_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
                if (objResult != null)
                {
                    gvFeesGroup.DataSource = objResult.resultDT;
                    gvFeesGroup.DataBind();
                    if (gvFeesGroup.Rows.Count > 0)
                    {
                        PanelGrid_VisibilityMode(1);
                    }
                    else
                    {
                        PanelGrid_VisibilityMode(2);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
Ejemplo n.º 2
0
        protected void gvFeesGroup_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                ApplicationResult objResult      = new ApplicationResult();
                FeesGroupBl       objFeesGroupBL = new FeesGroupBl();

                if (e.CommandName.ToString() == "Edit1")
                {
                    ViewState["Mode"]        = "Edit";
                    ViewState["FeesGroupID"] = e.CommandArgument.ToString();

                    objResult = objFeesGroupBL.FeesGroup_Select(Convert.ToInt32(e.CommandArgument.ToString()));
                    if (objResult != null)
                    {
                        if (objResult.resultDT.Rows.Count > 0)
                        {
                            txtFeesGroupName.Text = objResult.resultDT.Rows[0][FeesGroupBo.FEESGROUP_FEEGROUPNAME].ToString();
                            txtDescription.Text   = objResult.resultDT.Rows[0][FeesGroupBo.FEESGROUP_DESCRIPTION].ToString();
                            PanelGrid_VisibilityMode(2);
                        }
                    }
                }
                else if (e.CommandName.ToString() == "Delete1")
                {
                    objResult = objFeesGroupBL.FeesGroup_Delete(Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Session[ApplicationSession.USERID]), DateTime.UtcNow.AddHours(5.5).ToString());
                    if (objResult.status == ApplicationResult.CommonStatusType.SUCCESS)
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Record Deleted Successfully');</script>");
                        PanelGrid_VisibilityMode(1);
                        BindFeesGroup();
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 3
0
 private void BindFeeGroup()
 {
     try
     {
         FeesGroupBl       objFeesBL   = new FeesGroupBl();
         ApplicationResult objResults  = new ApplicationResult();
         Controls          objControls = new Controls();
         objResults = objFeesBL.FeesGroup_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));
         if (objResults != null)
         {
             objControls.BindDropDown_ListBox(objResults.resultDT, ddlFeeGroup, "FeeGroupName", "FeesGroupID");
             if (objResults.resultDT.Rows.Count > 0)
             {
             }
             ddlFeeGroup.Items.Insert(0, new ListItem("-Select-", ""));
         }
     }
     catch (Exception ex)
     {
         logger.Error("Error", ex);
         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
     }
 }
Ejemplo n.º 4
0
        protected void btnSaveFeesGroup_Click(object sender, EventArgs e)
        {
            try
            {
                FeesGroupBo       objFeesGroupBO = new FeesGroupBo();
                FeesGroupBl       objFeesGroupBL = new FeesGroupBl();
                ApplicationResult objResults     = new ApplicationResult();
                Controls          objControls    = new Controls();

                objFeesGroupBO.TrustMID     = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                objFeesGroupBO.SchoolMID    = Convert.ToInt32(Session[ApplicationSession.SCHOOLID]);
                objFeesGroupBO.FeeGroupName = txtFeesGroupName.Text.Trim();
                objFeesGroupBO.Description  = txtDescription.Text.Trim();

                if (ViewState["Mode"].ToString() == "Save")
                {
                    objFeesGroupBO.CreatedUserID = Convert.ToInt32(Session[ApplicationSession.USERID]);
                    objFeesGroupBO.CreatedDate   = DateTime.UtcNow.AddHours(5.5).ToString();

                    objResults = objFeesGroupBL.FeesGroup_Insert(objFeesGroupBO);

                    if (objResults.status == ApplicationResult.CommonStatusType.SUCCESS)
                    {
                        ClearAll();
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='javascript'>alert('Fees Group Created Successfully.');</script>");
                        BindFeesGroup();
                        PanelGrid_VisibilityMode(1);
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='javascript'>alert('Fees Group Name already Exists.');</script>");
                    }
                }
                else
                {
                    objFeesGroupBO.FeesGroupID        = Convert.ToInt32(ViewState["FeesGroupID"].ToString());
                    objFeesGroupBO.LastModifiedUserID = Convert.ToInt32(Session[ApplicationSession.USERID]);
                    objFeesGroupBO.LastModifiedDate   = DateTime.UtcNow.AddHours(5.5).ToString();

                    objResults = objFeesGroupBL.FeesGroup_Update(objFeesGroupBO);
                    if (objResults.status == ApplicationResult.CommonStatusType.SUCCESS)
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='JavaScript'>alert('Fees Group updated successfully.');</script>");

                        BindFeesGroup();
                        ClearAll();
                        ViewState["Mode"] = "Save";
                        //  btnSave.Text = "Save";
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='JavaScript'>alert('Fees Group Name already Exists.');</script>");
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }