Пример #1
0
        /// <summary>
        /// Set Grid Data source
        /// </summary>
        /// <param name="addRow"></param>
        /// <param name="deleteRow"></param>e

        private void BindGrid()
        {
            CurrentSchoolStatusBLL CurrentSchoolStatusBLLObj = new CurrentSchoolStatusBLL();

            gvCurSchlStatus.DataSource = CurrentSchoolStatusBLLObj.GetAllSchoolDetails();
            gvCurSchlStatus.DataBind();
        }
Пример #2
0
        /// <summary>
        /// Update Database Make data as Obsoluted
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void IsObsolete_CheckedChanged(Object sender, EventArgs e)
        {
            string message = string.Empty;

            try
            {
                CheckBox    chk = (CheckBox)sender;
                GridViewRow gr  = (GridViewRow)chk.Parent.Parent;

                string CurrentSchoolStatusID = ((Literal)gr.FindControl("litSchoolStatusID")).Text;
                CurrentSchoolStatusBLL CurrentSchoolStatusBLLObj = new CurrentSchoolStatusBLL();
                message = CurrentSchoolStatusBLLObj.ObsoleteSchoolStatus(Convert.ToInt32(CurrentSchoolStatusID), Convert.ToString(chk.Checked));
                if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                {
                    message = "Data updated successfully";
                }

                if (message != "")
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                }

                BindGrid();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        /// <summary>
        /// To delete currentschool status based on ID
        /// </summary>
        private void DeleteCurSchlStatus(int CurrentSchoolStatusID)
        {
            string message = string.Empty;
            CurrentSchoolStatusBLL CurrentSchoolStatusBLLObj = new CurrentSchoolStatusBLL();

            message = CurrentSchoolStatusBLLObj.DeleteCurSchlStatus(CurrentSchoolStatusID);
            if (string.IsNullOrEmpty(message) || message == "" || message == "null")
            {
                message = "Data Deleted successfully";
            }
            if (message != "")
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
            }
        }
Пример #4
0
        /// <summary>
        /// To fetch currentschool status and asssign to textbox
        /// </summary>
        private void GetCurSchlStatusDetails()
        {
            CurrentSchoolStatusBLL CurrentSchoolStatusBLLObj = new CurrentSchoolStatusBLL();

            int CurrentSchoolStatusID = 0;

            if (ViewState["CurrentSchoolStatusID"] != null)
            {
                CurrentSchoolStatusID = Convert.ToInt32(ViewState["CurrentSchoolStatusID"].ToString());
            }

            CurrentSchoolStatusBO CurrentSchoolStatusBOObj = CurrentSchoolStatusBLLObj.GetCurSchlStatusById(CurrentSchoolStatusID);

            txtCurrSchlStatus.Text   = CurrentSchoolStatusBOObj.CurrentSchoolStatus;
            txtDescription.Text      = CurrentSchoolStatusBOObj.Description;
            txtCurrSchlStatusID.Text = CurrentSchoolStatusBOObj.CurrentSchoolStatusID.ToString();
        }
Пример #5
0
        /// <summary>
        /// To save details to the database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveDetails(CurrentSchoolStatusBO CurrentSchoolStatusBOObj)
        {
            //int count = 0;
            string AlertMessage = string.Empty;
            string message      = string.Empty;

            try
            {
                if (txtCurrSchlStatusID.Text.ToString().Trim() == string.Empty)
                {
                    try
                    {
                        CurrentSchoolStatusBLL CurrentSchoolStatusBLLObj = new CurrentSchoolStatusBLL();
                        CurrentSchoolStatusBOObj = new CurrentSchoolStatusBO();

                        CurrentSchoolStatusBOObj.CurrentSchoolStatus = txtCurrSchlStatus.Text.ToString().Trim();
                        string sDes = "";
                        if (txtDescription.Text.ToString().Trim().Length > 100)
                        {
                            sDes = txtDescription.Text.ToString().Trim().Substring(0, 100);
                        }
                        else
                        {
                            sDes = txtDescription.Text.ToString().Trim();
                        }
                        CurrentSchoolStatusBOObj.Description           = sDes;
                        CurrentSchoolStatusBOObj.CurrentSchoolStatusID = Convert.ToInt32(ViewState["CurrentSchoolStatusID"]);
                        CurrentSchoolStatusBOObj.Createdby             = Convert.ToInt32(Session["USER_ID"]);

                        message = CurrentSchoolStatusBLLObj.InsertSchoolStatusDetails(CurrentSchoolStatusBOObj);

                        AlertMessage = "alert('" + message + "');";

                        if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                        {
                            message = "Data saved successfully";
                            BindGrid();
                            ClearDetails();
                        }
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
                else //if (Convert.ToInt32(ViewState["CurrentSchoolStatusID"]) != 0)
                {
                    CurrentSchoolStatusBLL CurrentSchoolStatusBLLObj = new CurrentSchoolStatusBLL();
                    CurrentSchoolStatusBOObj = new CurrentSchoolStatusBO();

                    int EditCurSchStatusID = Convert.ToInt32(ViewState["CurrentSchoolStatusID"]);

                    CurrentSchoolStatusBOObj.CurrentSchoolStatus = txtCurrSchlStatus.Text.ToString().Trim();
                    string sDes = "";
                    if (txtDescription.Text.ToString().Trim().Length > 100)
                    {
                        sDes = txtDescription.Text.ToString().Trim().Substring(0, 100);
                    }
                    else
                    {
                        sDes = txtDescription.Text.ToString().Trim();
                    }
                    CurrentSchoolStatusBOObj.Description           = sDes;
                    CurrentSchoolStatusBOObj.CurrentSchoolStatusID = Convert.ToInt32(ViewState["CurrentSchoolStatusID"]);
                    CurrentSchoolStatusBOObj.Createdby             = Convert.ToInt32(Session["USER_ID"]);

                    message = CurrentSchoolStatusBLLObj.EditCurSchStatus(CurrentSchoolStatusBOObj, EditCurSchStatusID);

                    if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                    {
                        message = "Data updated successfully";
                        BindGrid();
                        ClearDetails();
                        SetUpdateMode(false);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            finally
            {
                CurrentSchoolStatusBOObj = null;
            }
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
        }