Esempio n. 1
0
        protected void btnDelete_click(object sender, EventArgs e)
        {
            try
            {
                if (HfUSER_CODE.Value != string.Empty)
                {
                    string str = USER_MASLogicLayer.DeleteUSER_MASDetailsByID(HfUSER_CODE.Value);
                    if (str.Contains("successfully"))
                    {
                        lblmsg.Text      = "Record Deleted Successfully";
                        lblmsg.ForeColor = Color.Green;
                    }
                    else if (str.Contains("Cannot"))
                    {
                        lblmsg.Text      = "Cannot Delete This Record It Used by Other Data";
                        lblmsg.ForeColor = Color.Red;
                    }
                    else
                    {
                        lblmsg.Text      = "Error:User Not Deleted";
                        lblmsg.ForeColor = Color.Red;
                    }
                    clear();
                    FillGrid();
                    UserRights();
                }
            }

            catch (Exception)
            {
                throw;
            }
        }