コード例 #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        try
        {
            string pid = "";

            //if (txtUSerCode.Text == Session["UserCode"].ToString())
            //{
            foreach (TreeNode node in tvsample.CheckedNodes)
            {
                pid += node.Value.ToString() + ",";
            }
            pid = pid.Remove(pid.Length - 1);
            objMaster.UserId     = Convert.ToInt32(ddlPerson.SelectedValue);
            objMaster.UserRights = pid;

            int i = objMaster.UpdateRightsANDActiveUser();

            if (i <= 1)
            {
                ShowNotification("User Rights", "Updated Successfully..", NotificationType.success);
            }
            else
            {
                ShowNotification("User Rights", "Not Updated..!", NotificationType.error);
            }
            //}
            //else
            //{
            //    ShowNotification("User Rights", "Invalid User Code..!", NotificationType.error);
            //    txtUSerCode.Focus();
            //}
        }
        catch (Exception Ex)
        {
            ShowNotification("User Rights", "Update Error..!", NotificationType.error);
        }
    }