public static List <ATTJudgeWorkList> GetJudgeWorkList(int?JwcId) { List <ATTJudgeWorkList> LstWork = new List <ATTJudgeWorkList>(); try { foreach (DataRow row in DLLJudgeWorkList.GetJudgeWorkList(JwcId).Rows) { ATTJudgeWorkList ObjAtt = new ATTJudgeWorkList ( int.Parse(row["JWC_ID"].ToString()), row["JWC_NAME"].ToString(), (row["ACTIVE"].ToString() == "Y") ? true : false, ""//row["ENTRY_BY"].ToString() ); ObjAtt.EntryOn = DateTime.Now; //ObjAtt.EntryOn = DateTime.Parse(row["ENTRY_ON"].ToString()); LstWork.Add(ObjAtt); } return(LstWork); } catch (Exception ex) { throw ex; } }
protected void lstWorks_SelectedIndexChanged(object sender, EventArgs e) { List <ATTJudgeWorkList> workList = (List <ATTJudgeWorkList>)Session["Worklist"]; ATTJudgeWorkList objWork = workList[lstWorks.SelectedIndex]; txtWork.Text = objWork.JwcName; chkActive.Checked = objWork.Active; }
protected void btnSave_Click(object sender, EventArgs e) { List <ATTJudgeWorkList> workList = (List <ATTJudgeWorkList>)Session["Worklist"]; if (txtWork.Text == "") { this.lblStatusMessage.Text = "*र्कपया विवरण भर्नुहोस्"; this.programmaticModalPopup.Show(); return; } bool exists = workList.Exists(delegate(ATTJudgeWorkList obj) { return(obj.JwcName == this.txtWork.Text); } ); if (exists) { this.lblStatusMessage.Text = "**सोहि नामको विवरण पहिले नै उपलब्द छ"; this.programmaticModalPopup.Show(); this.txtWork.Text = ""; return; } string strUser = ((ATTUserLogin)Session["Login_User_Detail"]).UserName; ATTJudgeWorkList objWork = new ATTJudgeWorkList((lstWorks.SelectedIndex >= 0) ? int.Parse(lstWorks.SelectedValue) : 0, txtWork.Text, chkActive.Checked, strUser); if (lstWorks.SelectedIndex >= 0) { objWork.Action = "E"; } else { objWork.Action = "A"; } if (BLLJudgeWorkList.SaveJudgeWorkList(objWork)) { if (objWork.Action == "A") { workList.Add(objWork); this.lblStatusMessage.Text = "Judge Work List Saved"; this.programmaticModalPopup.Show(); } else if (objWork.Action == "E") { workList[lstWorks.SelectedIndex] = objWork; this.lblStatusMessage.Text = "Judge Work List Edited"; this.programmaticModalPopup.Show(); } Session["WorkList"] = workList; lstWorks.DataSource = workList; lstWorks.DataBind(); ClearControls(); } }
public static bool SaveJudgeWorkList(ATTJudgeWorkList ObjAtt) { try { return(DLLJudgeWorkList.SaveWork(ObjAtt)); } catch (Exception ex) { throw ex; } }
public static bool SaveWork(ATTJudgeWorkList ObjAtt) { GetConnection Conn = new GetConnection(); OracleConnection DBConn; string InsertUpdateWorkCheck = ""; OracleParameter[] ParamArray = new OracleParameter[0]; try { DBConn = Conn.GetDbConn(Module.PMS); if (ObjAtt.Action == "A") { InsertUpdateWorkCheck = "SP_ADD_JUDGE_WORK_LIST"; ParamArray = new OracleParameter[4]; ParamArray[0] = Utilities.GetOraParam(":P_JWC_ID", ObjAtt.JwcID, OracleDbType.Int64, ParameterDirection.InputOutput); ParamArray[1] = Utilities.GetOraParam(":P_JWC_NAME", ObjAtt.JwcName, OracleDbType.Varchar2, ParameterDirection.Input); ParamArray[2] = Utilities.GetOraParam(":P_ACTIVE", (ObjAtt.Active == true) ? "Y" : "N", OracleDbType.Varchar2, ParameterDirection.Input); ParamArray[3] = Utilities.GetOraParam(":P_ENTRY_BY", ObjAtt.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input); } else if (ObjAtt.Action == "E") { InsertUpdateWorkCheck = "SP_EDIT_JUDGE_WORK_LIST"; ParamArray = new OracleParameter[3]; ParamArray[0] = Utilities.GetOraParam(":P_JWC_ID", ObjAtt.JwcID, OracleDbType.Int64, ParameterDirection.InputOutput); ParamArray[1] = Utilities.GetOraParam(":P_JWC_NAME", ObjAtt.JwcName, OracleDbType.Varchar2, ParameterDirection.Input); ParamArray[2] = Utilities.GetOraParam(":P_ACTIVE", (ObjAtt.Active == true) ? "Y" : "N", OracleDbType.Varchar2, ParameterDirection.Input); } SqlHelper.ExecuteNonQuery(DBConn, CommandType.StoredProcedure, InsertUpdateWorkCheck, ParamArray); int JWCID = int.Parse(ParamArray[0].Value.ToString()); ObjAtt.JwcID = JWCID; return(true); } catch (Exception ex) { throw ex; } finally { Conn.CloseDbConn(); } }
public static List <ATTJudgeWorkList> GetCurrentJudgesList(int orgID) { try { List <ATTJudgeWorkList> JudgesList = new List <ATTJudgeWorkList>(); foreach (DataRow row in DLLJudgeWorkList.GetCurrentJudgesList(orgID).Rows) { ATTJudgeWorkList JudgesName = new ATTJudgeWorkList(double.Parse(row["EMP_ID"].ToString()), (string)row["EMPNAME"]); JudgesList.Add(JudgesName); } return(JudgesList); } catch (Exception ex) { throw ex; } }
protected void btnSave_Click(object sender, EventArgs e) { if (txtWork.Text == "") { return; } string strUser = "******"; ATTJudgeWorkList objWork = new ATTJudgeWorkList((lstWorks.SelectedIndex >= 0) ? int.Parse(lstWorks.SelectedValue) : 0, txtWork.Text, chkActive.Checked, strUser); if (lstWorks.SelectedIndex >= 0) { objWork.Action = "E"; } else { objWork.Action = "A"; } if (BLLJudgeWorkList.SaveJudgeWorkList(objWork)) { List <ATTJudgeWorkList> workList = (List <ATTJudgeWorkList>)Session["Worklist"]; if (objWork.Action == "A") { workList.Add(objWork); } else if (objWork.Action == "E") { workList[lstWorks.SelectedIndex] = objWork; } Session["WorkList"] = workList; lstWorks.DataSource = workList; lstWorks.DataBind(); ClearControls(); } }