public int AddUserGroupDetails() { try { UserGroups ug = new UserGroups(); ug.Groupcode = txtGroupCode.Text; // ug.GroupId = Convert.ToInt32(txtGroupID.Text); ug.GroupName = txtGroupName.Text; ug.CreatedBy = Convert.ToInt32(Session["UserID"]); ug.LastUserID = Convert.ToInt32(Session["UserID"]); user_dll = new UsersDLL(); return(user_dll.AddUserGroup(ug)); } catch (Exception ex) { ErrorMessage("Adding user group error:2 " + ex.Message); return(0); } }