Пример #1
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
            {
                PositionBLL PositionBLLobj = new PositionBLL();

                CheckBox    chk        = (CheckBox)sender;
                GridViewRow gr         = (GridViewRow)chk.Parent.Parent;
                string      positionID = ((Literal)gr.FindControl("litPositionID")).Text;

                message = PositionBLLobj.ObsoletePosition(Convert.ToInt32(positionID), Convert.ToString(chk.Checked));

                if (string.IsNullOrEmpty(message) || message == "" || message == "null")
                {
                    message = "Data updated successfully";
                }
                Clear();
                SetUpdateMode(false);
                BindGrid(false, true);
                if (message != "")
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Added", "alert('" + message + "');", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }