Пример #1
0
        /// <summary>
        /// Set Grid Data source
        /// </summary>
        /// <param name="addRow"></param>
        /// <param name="deleteRow"></param>e
        private void BindGrid()
        {
            MNEGoalEvalElementsBLL objMNEGoalEvalElementsBLL = new MNEGoalEvalElementsBLL();

            gvGoalEvalElement.DataSource = objMNEGoalEvalElementsBLL.GetMNEGoalEvalElements(Convert.ToInt32(ViewState["EVALUATIONID"]));
            gvGoalEvalElement.DataBind();
        }
Пример #2
0
        /// <summary>
        /// method to fetch details and assign to textbox
        /// </summary>
        private void GetMNEGoalEval()
        {
            MNEGoalEvalElementsBLL objMNEGoalEvalElementsBLL = new MNEGoalEvalElementsBLL();
            int EvalelementId = 0;

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

            MNEGoalEvalElementsBO objMNEGoalEvalElementsBO = new MNEGoalEvalElementsBO();

            objMNEGoalEvalElementsBO = objMNEGoalEvalElementsBLL.GetMNEGoalEvalElementsByID(EvalelementId);

            ddlElement.ClearSelection();
            if (ddlElement.Items.FindByValue(objMNEGoalEvalElementsBO.Goal_elementID.ToString()) != null)
            {
                ddlElement.Items.FindByValue(objMNEGoalEvalElementsBO.Goal_elementID.ToString()).Selected = true;
            }
            ViewState["EVALELEMENTID"] = objMNEGoalEvalElementsBO.EvalelementID;
            txtDescription.Text        = objMNEGoalEvalElementsBO.Evalelementdescriptionn;
        }
Пример #3
0
        /// <summary>
        /// method to soft delete data from database
        /// </summary>
        /// <param name="evalElementID"></param>
        private void DeleteMNEGoalEval(string evalElementID)
        {
            MNEGoalEvalElementsBLL objMNEGoalEvalElementsBLL = new MNEGoalEvalElementsBLL();
            string message = string.Empty;

            try
            {
                message = objMNEGoalEvalElementsBLL.DeleteMNEGoalEvalElements(Convert.ToInt32(evalElementID));

                if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                {
                    message = "Data Deleted successfully";
                }

                if (message != "")
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #4
0
        /// <summary>
        /// To save details to database
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string message = "";
            string uID     = Session["USER_ID"].ToString();
            MNEGoalEvalElementsBLL objMNEGoalEvalElementsBLL = new MNEGoalEvalElementsBLL();

            if (Convert.ToInt32(ViewState["EVALELEMENTID"]) == 0)
            {
                try
                {
                    MNEGoalEvalElementsBO objMNEGoalEvalElementsBO = new MNEGoalEvalElementsBO();
                    objMNEGoalEvalElementsBO.EvaluationID            = Convert.ToInt32(ViewState["EVALUATIONID"]);
                    objMNEGoalEvalElementsBO.Goal_elementID          = Convert.ToInt32(ddlElement.SelectedValue);
                    objMNEGoalEvalElementsBO.Evalelementdescriptionn = txtDescription.Text.Trim();
                    objMNEGoalEvalElementsBO.Createdby = Convert.ToInt32(uID);
                    objMNEGoalEvalElementsBO.Isdeleted = "False";
                    message = objMNEGoalEvalElementsBLL.InsertMNEGoalEvalElements(objMNEGoalEvalElementsBO);

                    if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                    {
                        message = "Data saved successfully";
                    }
                    // txtOptionGroup.Text = "0";
                    if (message != "")
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                finally
                {
                    objMNEGoalEvalElementsBLL = null;
                }

                BindGrid();
            }
            //edit the data in the textbox exiting in the Grid
            else if (Convert.ToInt32(ViewState["EVALELEMENTID"]) > 0)
            {
                try
                {
                    MNEGoalEvalElementsBO objMNEGoalEvalElementsBO = new MNEGoalEvalElementsBO();
                    objMNEGoalEvalElementsBO.EvaluationID            = Convert.ToInt32(ViewState["EVALUATIONID"]);
                    objMNEGoalEvalElementsBO.EvalelementID           = Convert.ToInt32(ViewState["EVALELEMENTID"]);
                    objMNEGoalEvalElementsBO.Goal_elementID          = Convert.ToInt32(ddlElement.SelectedValue);
                    objMNEGoalEvalElementsBO.Evalelementdescriptionn = txtDescription.Text.Trim();
                    objMNEGoalEvalElementsBO.Updatedby = Convert.ToInt32(uID);


                    message = objMNEGoalEvalElementsBLL.UpdateMNEGoalEvalElements(objMNEGoalEvalElementsBO);

                    if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                    {
                        message = "Data updated successfully";
                    }

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

                finally
                {
                    objMNEGoalEvalElementsBLL = null;
                }

                BindGrid();
                SetUpdateMode(false);

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

            ClearData();
        }