protected void LoadUserGroups() { UserGroupBLL userGroup = new UserGroupBLL(); try { DataTable dt = userGroup.GetActiveUserGroupList(); drpdownGroup.DataSource = dt; drpdownGroup.DataValueField = "UserGroupId"; drpdownGroup.DataTextField = "UserGroupName"; drpdownGroup.DataBind(); drpdownGroup.Items.Insert(0, "----------Select----------"); drpdownGroup.SelectedIndex = 0; } catch (Exception ex) { msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; msgbox.Attributes.Add("Class", "alert alert-warning"); } finally { userGroup = null; } }
public void cbx_Databind() { UserGroupBLL groupbll = new UserGroupBLL(); groupbll.setCboUserGroup(this.cbx_UserGroup); groupbll.setCboUserGroup(this.cbxUserGroup); }
protected void allDeletedListButton_Click(object sender, EventArgs e) { UserGroupBLL userGroup = new UserGroupBLL(); try { string fromDate = LumexLibraryManager.ParseAppDate(fromDateTextBox.Text.Trim()); string toDate = LumexLibraryManager.ParseAppDate(toDateTextBox.Text.Trim()); DataTable dt = userGroup.GetDeletedUserGroupListByDateRangeAll(fromDate, toDate, "All"); deletedListGridView.DataSource = dt; deletedListGridView.DataBind(); if (deletedListGridView.Rows.Count > 0) { deletedListGridView.UseAccessibleHeader = true; deletedListGridView.HeaderRow.TableSection = TableRowSection.TableHeader; } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = ""; } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }
protected void GetUserGroupById(string userGroupId) { UserGroupBLL userGroup = new UserGroupBLL(); try { DataTable dt = userGroup.GetUserGroupById(userGroupId); if (dt.Rows.Count > 0) { userGroupNameForUpdateHiddenField.Value = userGroupNameTextBox.Text = dt.Rows[0]["UserGroupName"].ToString(); descriptionTextBox.Text = dt.Rows[0]["Description"].ToString(); } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = ""; } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }
protected void LoadUserGroups() { UserGroupBLL userGroup = new UserGroupBLL(); try { DataTable dt = userGroup.GetActiveUserGroupList(); userGroupDropDownList.DataSource = dt; userGroupDropDownList.DataValueField = "UserGroupId"; userGroupDropDownList.DataTextField = "UserGroupName"; userGroupDropDownList.DataBind(); userGroupDropDownList.Items.Insert(0, "--Select Group--"); userGroupDropDownList.SelectedIndex = 1; if (dt.Rows.Count < 1) { msgbox.Visible = true; msgTitleLabel.Text = "User Group Data Not Found!!!"; msgDetailLabel.Text = ""; msgbox.Attributes.Add("class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } finally { userGroup = null; } }
public void UpdateUserGroupTest() { UserGroupBLL target = new UserGroupBLL(); // TODO: Initialize to an appropriate value UserGroup userGroup = null; // TODO: Initialize to an appropriate value target.UpdateUserGroup(userGroup); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void GetUserGroupsTest1() { UserGroupBLL target = new UserGroupBLL(); // TODO: Initialize to an appropriate value List <UserGroup> expected = null; // TODO: Initialize to an appropriate value List <UserGroup> actual; actual = target.GetUserGroups(); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void IsUserInRoleTest() { string userName = string.Empty; // TODO: Initialize to an appropriate value string roleName = string.Empty; // TODO: Initialize to an appropriate value bool expected = false; // TODO: Initialize to an appropriate value bool actual; actual = UserGroupBLL.IsUserInRole(userName, roleName); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void GetUserGroupsbyUserTest() { UserGroupBLL target = new UserGroupBLL(); // TODO: Initialize to an appropriate value string userName = string.Empty; // TODO: Initialize to an appropriate value string[] expected = null; // TODO: Initialize to an appropriate value string[] actual; actual = target.GetUserGroupsbyUser(userName); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
protected void saveButton_Click(object sender, EventArgs e) { UserGroupBLL userGroup = new UserGroupBLL(); try { if (userGroupNameTextBox.Text == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "User Group Name field is required."; } else if (descriptionTextBox.Text == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Description field is required."; } else { userGroup.UserGroupName = userGroupNameTextBox.Text.Trim(); userGroup.Description = descriptionTextBox.Text.Trim(); if (!userGroup.CheckDuplicateUserGroup(userGroup.UserGroupName.Trim())) { DataTable dt = userGroup.SaveUserGroup(); if (dt.Rows.Count > 0) { // MyAlertBox("alert(\"User Group Created Successfully with User Group ID: " + dt.Rows[0][0].ToString() + " \"); window.location=\"/HRUI/UserGroup/List.aspx\""); string message = " <span class='actionTopic'>" + " User Group Created Successfully with User Group ID: " + dt.Rows[0][0].ToString() + "</span>."; MyAlertBox("var callbackOk = function () { window.location = \"/setting/UserGroup/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Failed to Create User Group!!!"; msgDetailLabel.Text = ""; } } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Duplicate!!!"; msgDetailLabel.Text = "This User Group already exist, try another one."; } } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }
public void UpdateUserGroup(UserGroupBLL userGroup, LumexDBPlayer db) { try { db.AddParameters("@UserGroupId", userGroup.UserGroupId.Trim()); db.AddParameters("@UserGroupName", userGroup.UserGroupName.Trim()); db.AddParameters("@Description", userGroup.Description.Trim()); db.AddParameters("@ModifiedBy", LumexSessionManager.Get("ActiveUserId")); db.AddParameters("@ModifiedFrom", LumexLibraryManager.GetTerminal()); db.AddParameters("@GroupOrder", "1"); db.ExecuteNonQuery("UPDATE_USER_GROUP_BY_ID", true); } catch (Exception) { throw; } finally { userGroup = null; } }
protected void deactivateLinkButton_Click(object sender, EventArgs e) { try { LinkButton lnkBtn = (LinkButton)sender; GridViewRow row = (GridViewRow)lnkBtn.NamingContainer; UserGroupBLL userGroup = new UserGroupBLL(); userGroup.UpdateUserGroupActivation(userGroupListGridView.Rows[row.RowIndex].Cells[0].Text.ToString(), "False"); // MyAlertBox("alert(\"User Group Deactivated Successfully.\"); window.location=\"/HRUI/UserGroup/List.aspx\""); GetUserGroupList(); string message = " <span class='actionTopic'>" + " User Group Deactivated Successfully.</span>."; MyAlertBox("var callbackOk = function () { window.location = \"/setting/UserGroup/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } }
public DataTable SaveUserGroup(UserGroupBLL userGroup, LumexDBPlayer db) { try { db.AddParameters("@UserGroupName", userGroup.UserGroupName.Trim()); db.AddParameters("@Description", userGroup.Description.Trim()); db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId")); db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal()); db.AddParameters("@BranchId", LumexSessionManager.Get("UserBranchId")); db.AddParameters("@GroupOrder", "1"); DataTable dt = db.ExecuteDataTable("INSERT_USER_GROUP", true); return(dt); } catch (Exception) { throw; } finally { userGroup = null; } }
/// <summary> /// 更新推广会员的积分 /// </summary> /// <param name="reguid">id</param> /// <param name="point">消费积分</param> /// <param name="xftime">消费时间</param> private void ModifyTGPoint(int reguid, decimal point, DateTime xftime) { int userid = new JoinPromotionBLL().GetUserIdByReguid(reguid); if (userid > 0) { UserInfo item = ubll.GetUserByID(userid); int zk = new UserGroupBLL().GetItemById(item.UserGroup).Zk; //会员折扣 decimal upoint = zk * point / 100; //折扣%*积分 //ubll.UpdatePoint(upoint, userid); #region ===添加消费记录=== UserProfit upitem = new UserProfit(); upitem.reguid = reguid; upitem.userid = userid; upitem.xfpoint = point; upitem.sypoint = upoint; upitem.xftime = xftime; new UserProfitBLL().AddItem(upitem); #endregion } }
protected void GetUserGroupList() { UserGroupBLL userGroup = new UserGroupBLL(); try { DataTable dt = userGroup.GetUserGroupList(); userGroupListGridView.DataSource = dt; userGroupListGridView.DataBind(); if (dt.Rows.Count < 1) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = ""; } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }
private void LoadUserGroups() { try { UserGroupBLL usergroupbll = new UserGroupBLL(); DataTable dt = usergroupbll.GetActiveUserGroupList(); drpdownGroup.DataTextField = "UserGroupName"; drpdownGroup.DataValueField = "UserGroupId"; drpdownGroup.DataSource = dt; drpdownGroup.DataBind(); drpdownGroup.Items.Insert(0, "Select Group"); drpdownGroup.SelectedIndex = 0; drpdownGroup.Items[0].Value = ""; } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } }
protected void updateButton_Click(object sender, EventArgs e) { UserGroupBLL userGroup = new UserGroupBLL(); try { if (userGroupIdForUpdateHiddenField.Value.Trim() == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = "User Group not found to update."; } else if (userGroupNameTextBox.Text == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "User Group Name field is required."; } else if (descriptionTextBox.Text == "") { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Description field is required."; } else { userGroup.UserGroupId = userGroupIdForUpdateHiddenField.Value.Trim(); userGroup.UserGroupName = userGroupNameTextBox.Text.Trim(); userGroup.Description = descriptionTextBox.Text.Trim(); if (!userGroup.CheckDuplicateUserGroup(userGroupNameTextBox.Text.Trim())) { userGroup.UpdateUserGroup(); userGroupNameForUpdateHiddenField.Value = ""; userGroupIdForUpdateHiddenField.Value = ""; string message = " <span class='actionTopic'>" + " User Group Updated Successfully</span>."; MyAlertBox("var callbackOk = function () { window.location = \"/setting/UserGroup/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } else { if (userGroupNameForUpdateHiddenField.Value == userGroupNameTextBox.Text.Trim()) { userGroup.UserGroupName = "WithOut"; userGroup.UpdateUserGroup(); userGroupNameForUpdateHiddenField.Value = ""; userGroupIdForUpdateHiddenField.Value = ""; //MyAlertBox("alert(\"User Group Updated Successfully.\"); window.location=\"/HRUI/UserGroup/List.aspx\""); string message = " <span class='actionTopic'>" + " User Group Updated Successfully.</span>."; MyAlertBox("var callbackOk = function () { window.location = \"/setting/UserGroup/List.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } else { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Data Duplicate!!!"; msgDetailLabel.Text = "This User Group already exist, try another one."; } } } } catch (Exception ex) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message; } finally { userGroup = null; } }
public override bool IsUserInRole(string username, string roleName) { return(UserGroupBLL.IsUserInRole(username, roleName)); }
public void UserGroupBLLConstructorTest1() { UserGroupBLL target = new UserGroupBLL(); Assert.Inconclusive("TODO: Implement code to verify target"); }