/// <summary> /// To get Active Group details /// </summary> /// <returns></returns> private DataTable ActivegetGroupDetails() { GroupBAL g = new GroupBAL(); DataTable DtActiveGroup = new DataTable(); try { DtActiveGroup = g.LoadActiveGroup(true, LoginUser, Ret); } catch { } finally { g = null; } return(DtActiveGroup); }
/// <summary> /// To load Group details form database /// </summary> /// <returns></returns> private DataTable getGroupDetails() { GroupBAL GroupBAL = new GroupBAL(); DataTable DtGroupGet = new DataTable(); try { DtGroupGet = GroupBAL.LoadAllGroup(LoginUser, Ret); } catch { } finally { GroupBAL = null; } return(DtGroupGet); }
/// <summary> /// To get details of particular Group ID /// </summary> /// <param name="GroupId"></param> /// <returns></returns> private DataTable GetGroupDetails(int GroupId) { GroupBAL GroupBAL = new GroupBAL(); DataTable DtGrpDet = new DataTable(); try { DtGrpDet = GroupBAL.SelectGroupID(GroupId, LoginUser, Ret); } catch { } finally { GroupBAL = null; } return(DtGrpDet); }
private DataTable getGroupdetails() { GroupBAL g = new GroupBAL(); DataTable dTable = new DataTable(); try { dTable = g.LoadActiveGroup(true, LoginUser, Ret); } catch { } finally { g = null; } return(dTable); }
private DataTable getGroupdetails() { GroupBAL g = new GroupBAL(); DataTable dTable = new DataTable(); try { dTable = g.LoadActiveGroup(true, LoginUser, Ret); } catch { } finally { g = null; } return dTable; }
/// <summary> /// To save and update group details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { string Status = ddlGroupStatus.SelectedItem.Text; bool GroupStatus; if (ddlGroupStatus.SelectedItem.Text != "Select") { if (Status == "Active") { GroupStatus = true; } else { GroupStatus = false; } if (btnSave.Text == "Save") { if (!Page.IsValid) { return; } int IntResult = 0; GroupBAL GroupBAL = new GroupBAL(); string GroupName = txtGroupName.Text; string GroupDesc = txtGroupDesc.Text; if (txtGroupName.Text.Trim() != "") { try { // 'InsertGroup' is Group business Access Layer function called // to insert Group details IntResult = GroupBAL.InsertGroup(GroupName, GroupDesc, GroupStatus, LoginUser, Ret); ClearGroupDetails(); Response.Redirect("GroupList.aspx", false); msgGroup.Msg = "Group submited successfully"; msgGroup.showmsg(); } catch (Exception ee) { // Duplicate Entry is catched when inserting Group if (ee.Message == "Duplicate Entry") { msgGroup.Msg = "Duplicate Entry!"; msgGroup.showmsg(); ClearGroupDetails(); } } finally { GroupBAL = null; } } } else if (btnSave.Text == "Update") { int IntResult = 0; GroupBAL GroupBAL = new GroupBAL(); string GroupName = txtGroupName.Text; string GroupDesc = txtGroupDesc.Text; if (txtGroupName.Text.Trim() != "") { try { // 'UpdateGroup' is Group business Access Layer function called // to update Group details IntResult = GroupBAL.UpdateGroup(GroupId, GroupDesc, GroupStatus, txtGroupName.Text, LoginUser, Ret); ClearGroupDetails(); Response.Redirect("GroupList.aspx", false); msgGroup.Msg = "Group updated successfully"; msgGroup.showmsg(); Session["GroupId"] = null; btnSave.Text = "Save"; } catch (Exception ee) { // Duplicate Entry is catched when updating Group if (ee.Message == "Duplicate Entry") { msgGroup.Msg = "Duplicate Entry!"; msgGroup.showmsg(); } } finally { GroupBAL = null; } } } } }
/// <summary> /// To load Group details form database /// </summary> /// <returns></returns> private DataTable getGroupDetails() { GroupBAL GroupBAL = new GroupBAL(); DataTable DtGroupGet = new DataTable(); try { DtGroupGet = GroupBAL.LoadAllGroup(LoginUser, Ret); } catch { } finally { GroupBAL = null; } return DtGroupGet; }
/// <summary> /// To get Active Group details /// </summary> /// <returns></returns> private DataTable ActivegetGroupDetails() { GroupBAL g = new GroupBAL(); DataTable DtActiveGroup = new DataTable(); try { DtActiveGroup = g.LoadActiveGroup(true, LoginUser, Ret); } catch { } finally { g = null; } return DtActiveGroup; }
/// <summary> /// To save and update group details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { string Status = ddlGroupStatus.SelectedItem.Text; bool GroupStatus; if (ddlGroupStatus.SelectedItem.Text != "Select") { if (Status == "Active") { GroupStatus = true; } else { GroupStatus = false; } if (btnSave.Text == "Save") { if (!Page.IsValid) return; int IntResult = 0; GroupBAL GroupBAL = new GroupBAL(); string GroupName = txtGroupName.Text; string GroupDesc = txtGroupDesc.Text; if (txtGroupName.Text.Trim() != "") { try { // 'InsertGroup' is Group business Access Layer function called // to insert Group details IntResult = GroupBAL.InsertGroup(GroupName, GroupDesc, GroupStatus, LoginUser, Ret); ClearGroupDetails(); Response.Redirect("GroupList.aspx", false); msgGroup.Msg = "Group submited successfully"; msgGroup.showmsg(); } catch (Exception ee) { // Duplicate Entry is catched when inserting Group if (ee.Message == "Duplicate Entry") { msgGroup.Msg = "Duplicate Entry!"; msgGroup.showmsg(); ClearGroupDetails(); } } finally { GroupBAL = null; } } } else if (btnSave.Text == "Update") { int IntResult = 0; GroupBAL GroupBAL = new GroupBAL(); string GroupName = txtGroupName.Text; string GroupDesc = txtGroupDesc.Text; if (txtGroupName.Text.Trim() != "") { try { // 'UpdateGroup' is Group business Access Layer function called // to update Group details IntResult = GroupBAL.UpdateGroup(GroupId, GroupDesc, GroupStatus, txtGroupName.Text, LoginUser, Ret); ClearGroupDetails(); Response.Redirect("GroupList.aspx", false); msgGroup.Msg = "Group updated successfully"; msgGroup.showmsg(); Session["GroupId"] = null; btnSave.Text = "Save"; } catch(Exception ee) { // Duplicate Entry is catched when updating Group if (ee.Message == "Duplicate Entry") { msgGroup.Msg = "Duplicate Entry!"; msgGroup.showmsg(); } } finally { GroupBAL = null; } } } } }
/// <summary> /// To get details of particular Group ID /// </summary> /// <param name="GroupId"></param> /// <returns></returns> private DataTable GetGroupDetails(int GroupId) { GroupBAL GroupBAL = new GroupBAL(); DataTable DtGrpDet = new DataTable(); try { DtGrpDet = GroupBAL.SelectGroupID(GroupId, LoginUser, Ret); } catch { } finally { GroupBAL = null; } return DtGrpDet; }