/// <summary> /// To edit intructional designer details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnkEdit_Click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; GridViewRow row = (GridViewRow)lnk.Parent.Parent; int Idx = row.RowIndex; int IntResult = 0; bool Status; int InsID; InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); LinkButton lblIsActive = (GrdInsDes.Rows[Idx].FindControl("lnkEdit") as LinkButton); Label lblStatus = (GrdInsDes.Rows[Idx].FindControl("lnkStatus") as Label); { if (lblStatus.Text == "Active" || lblStatus.Text == "True") { Status = false; lblStatus.Text = "InActive"; lblIsActive.Text = "Activate"; } else { Status = true; lblStatus.Text = "Active"; lblIsActive.Text = "Deactivate"; } InsID = Convert.ToInt32(lnk.CommandArgument.ToString()); lblSelectID.Text = InsID.ToString(); Session["InsID"] = lblSelectID.Text; IntResult = InstructionalDesignerBAL.UpdateInstructionalDesigner(InsID, Status, LoginUser, Ret); } }
/// <summary> /// To save instructional designer details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); int UserID = Convert.ToInt32(ddlInsDesUser.SelectedValue.ToString()); string Status = ddlInsDesStatus.SelectedValue.ToString(); bool IsActive = true; if (Status == "Active") { IsActive = true; } else if (Status == "InActive") { IsActive = false; } if (btnSave.Text == "Save") { try { // 'InsertInstructionalDesigner' is Instructional Designer business Access Layer function called // to insert Instructional Designer details int Result = InstructionalDesignerBAL.InsertInstructionalDesigner(UserID, IsActive, LoginUser, Ret); DtInsDes = IDDetails(); ViewState["DtInsDes"] = DtInsDes; BindInsDes(DtInsDes); MsgInsDes.Msg = "Record added successfully"; MsgInsDes.showmsg(); } catch (Exception ee) { // Duplicate Entry is catched when inserting Instructional Designer if (ee.Message == "Duplicate Entry") { MsgInsDes.Msg = "Duplicate Entry!"; MsgInsDes.showmsg(); ClearInsDes(); } } finally { InstructionalDesignerBAL = null; } } }
/// <summary> /// To bind Instructional Designer of active status /// </summary> /// <param name="IsActive"></param> /// <returns></returns> protected DataTable InsDesActiveDetails(bool IsActive) { InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); DataTable DtInsDesDet = new DataTable(); try { DtInsDesDet = InstructionalDesignerBAL.LoadActiveInstructionalDesigner(LoginUser, Ret, IsActive); } catch { throw; } finally { InstructionalDesignerBAL = null; } return(DtInsDesDet); }
/// <summary> /// To get specific instructional designer details /// </summary> /// <param name="InsID"></param> /// <returns></returns> protected DataTable GetUserDetails(int InsID) { InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); DataTable DtGetUser = new DataTable(); try { DtGetUser = InstructionalDesignerBAL.SelectInstructionalDesignerID(InsID, LoginUser, Ret); } catch { throw; } finally { InstructionalDesignerBAL = null; } return(DtGetUser); }
/// <summary> /// To get Instructional Designer details /// </summary> /// <returns></returns> protected DataTable IDDetails() { InstructionalDesignerBAL idBAL = new InstructionalDesignerBAL(); DataTable dTable = new DataTable(); try { dTable = idBAL.LoadAllInstructionalDesigner(LoginUser, Ret); } catch { throw; } finally { idBAL = null; } return(dTable); }
protected DataTable IDActiveDetails(bool IsActive) { InstructionalDesignerBAL IDBAl = new InstructionalDesignerBAL(); DataTable dTable = new DataTable(); try { dTable = IDBAl.LoadActiveInstructionalDesigner(LoginUser, Ret, IsActive); } catch { throw; } finally { IDBAl = null; } return(dTable); }
protected DataTable IDActiveDetails(bool IsActive) { InstructionalDesignerBAL IDBAl = new InstructionalDesignerBAL(); DataTable dTable = new DataTable(); try { dTable = IDBAl.LoadActiveInstructionalDesigner(LoginUser, Ret, IsActive); } catch (Exception ee) { throw; } finally { IDBAl = null; } return dTable; }
/// <summary> /// To edit intructional designer details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lnkEdit_Click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; GridViewRow row = (GridViewRow)lnk.Parent.Parent; int Idx = row.RowIndex; int IntResult = 0; bool Status; int InsID; InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); LinkButton lblIsActive = (GrdInsDes.Rows[Idx].FindControl("lnkEdit") as LinkButton); Label lblStatus = (GrdInsDes.Rows[Idx].FindControl("lnkStatus") as Label); { if (lblStatus.Text == "Active" || lblStatus.Text == "True") { Status = false; lblStatus.Text = "InActive"; lblIsActive.Text = "Activate"; } else { Status = true; lblStatus.Text = "Active"; lblIsActive.Text = "Deactivate"; } InsID = Convert.ToInt32(lnk.CommandArgument.ToString()); lblSelectID.Text = InsID.ToString(); Session["InsID"] = lblSelectID.Text; IntResult = InstructionalDesignerBAL.UpdateInstructionalDesigner(InsID, Status, LoginUser, Ret); } }
/// <summary> /// To bind Instructional Designer of active status /// </summary> /// <param name="IsActive"></param> /// <returns></returns> protected DataTable InsDesActiveDetails(bool IsActive) { InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); DataTable DtInsDesDet = new DataTable(); try { DtInsDesDet = InstructionalDesignerBAL.LoadActiveInstructionalDesigner(LoginUser, Ret, IsActive); } catch { throw; } finally { InstructionalDesignerBAL = null; } return DtInsDesDet; }
/// <summary> /// To get Instructional Designer details /// </summary> /// <returns></returns> protected DataTable IDDetails() { InstructionalDesignerBAL idBAL = new InstructionalDesignerBAL(); DataTable dTable = new DataTable(); try { dTable = idBAL.LoadAllInstructionalDesigner(LoginUser, Ret); } catch { throw; } finally { idBAL = null; } return dTable; }
/// <summary> /// To get specific instructional designer details /// </summary> /// <param name="InsID"></param> /// <returns></returns> protected DataTable GetUserDetails(int InsID) { InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); DataTable DtGetUser = new DataTable(); try { DtGetUser = InstructionalDesignerBAL.SelectInstructionalDesignerID(InsID, LoginUser, Ret); } catch { throw; } finally { InstructionalDesignerBAL = null; } return DtGetUser; }
/// <summary> /// To save instructional designer details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { InstructionalDesignerBAL InstructionalDesignerBAL = new InstructionalDesignerBAL(); int UserID = Convert.ToInt32(ddlInsDesUser.SelectedValue.ToString()); string Status = ddlInsDesStatus.SelectedValue.ToString(); bool IsActive = true; if (Status == "Active") { IsActive = true; } else if (Status == "InActive") { IsActive = false; } if (btnSave.Text == "Save") { try { // 'InsertInstructionalDesigner' is Instructional Designer business Access Layer function called // to insert Instructional Designer details int Result = InstructionalDesignerBAL.InsertInstructionalDesigner(UserID, IsActive, LoginUser, Ret); DtInsDes = IDDetails(); ViewState["DtInsDes"] = DtInsDes; BindInsDes(DtInsDes); MsgInsDes.Msg = "Record added successfully"; MsgInsDes.showmsg(); } catch (Exception ee) { // Duplicate Entry is catched when inserting Instructional Designer if (ee.Message == "Duplicate Entry") { MsgInsDes.Msg = "Duplicate Entry!"; MsgInsDes.showmsg(); ClearInsDes(); } } finally { InstructionalDesignerBAL = null; } } }