public static List <ATTCaseDocumentType> GetCaseDocumentType(int?CaseDocumentType, string active, int defaultFlag) { List <ATTCaseDocumentType> CaseDocumentTypeList = new List <ATTCaseDocumentType>(); try { foreach (DataRow row in DLLCaseDocumentType.GetCaseDocumentType(CaseDocumentType, active).Rows) { ATTCaseDocumentType Reglst = new ATTCaseDocumentType( int.Parse(row["CASE_TYPE_ID"].ToString()), row["CASE_TYPE_NAME"].ToString(), row["ACTIVE"].ToString()); CaseDocumentTypeList.Add(Reglst); } if (defaultFlag > 0) { CaseDocumentTypeList.Insert(0, new ATTCaseDocumentType(0, "छान्नुहोस", "")); } return(CaseDocumentTypeList); } catch (Exception ex) { throw ex; } }
public static bool SaveCaseDocumentType(ATTCaseDocumentType objCaseDocumentType) { try { return(DLLCaseDocumentType.SaveCaseDocumentType(objCaseDocumentType)); } catch (Exception ex) { throw ex; } }
public static bool SaveCaseDocumentType(ATTCaseDocumentType objCaseDocumentType) { string InsertUpdateSQL = ""; List <OracleParameter> paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam(":P_CASE_DOCUMENT_TYPE_ID", objCaseDocumentType.CaseDocumentTypeID, OracleDbType.Int64, ParameterDirection.InputOutput)); paramArray.Add(Utilities.GetOraParam(":P_CASE_DOCUMENT_TYPE_NAME", objCaseDocumentType.CaseDocumentTypeName, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_ACTIVE", objCaseDocumentType.Active, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":P_ENTRY_BY", objCaseDocumentType.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input)); if (objCaseDocumentType.Action == "A") { InsertUpdateSQL = "SP_ADD_DOCUMENT_TYPE_CASE"; } else if (objCaseDocumentType.Action == "E") { InsertUpdateSQL = "SP_EDIT_DOCUMENT_TYPE_CASE"; } GetConnection GetConn = new GetConnection(); OracleTransaction Tran = GetConn.GetDbConn(Module.CMS).BeginTransaction(); try { SqlHelper.ExecuteNonQuery(Tran, System.Data.CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray()); objCaseDocumentType.CaseDocumentTypeID = int.Parse(paramArray[0].Value.ToString()); Tran.Commit(); return(true); } catch (OracleException oex) { PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError(); throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message)); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { GetConn.CloseDbConn(); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txtCaseDocumentTypeName_RQD.Text == "") { lblStatusMessage.Text = "कागजपत्रको किसिम लेख्नुस"; programmaticModalPopup.Show(); return; } int CaseDocumentType = 0; if (lstCaseDocumentType.SelectedIndex != -1) { CaseDocumentType = int.Parse(lstCaseDocumentType.SelectedValue); } foreach (ListItem lst in lstCaseDocumentType.Items) { if (lst.Selected == true) { continue; } if (lst.Text.Trim().ToLower() == txtCaseDocumentTypeName_RQD.Text.Trim().ToLower()) { this.lblStatusMessage.Text = "Case Document type Already Exists"; this.programmaticModalPopup.Show(); return; } } ATTCaseDocumentType objCaseDocumentType = new ATTCaseDocumentType(CaseDocumentType, this.txtCaseDocumentTypeName_RQD.Text.Trim(), this.chkActive.Checked == true ? "Y" : "N"); objCaseDocumentType.EntryBy = strUser; if (this.lstCaseDocumentType.SelectedIndex > -1) { objCaseDocumentType.Action = "E"; } else { objCaseDocumentType.Action = "A"; } try { List <ATTCaseDocumentType> ListCaseDocumentTypeList = (List <ATTCaseDocumentType>)Session["CaseDocumentType"]; BLLCaseDocumentType.SaveCaseDocumentType(objCaseDocumentType); if (this.lstCaseDocumentType.SelectedIndex > -1) { ListCaseDocumentTypeList[this.lstCaseDocumentType.SelectedIndex].CaseDocumentTypeID = objCaseDocumentType.CaseDocumentTypeID; ListCaseDocumentTypeList[this.lstCaseDocumentType.SelectedIndex].CaseDocumentTypeName = objCaseDocumentType.CaseDocumentTypeName; ListCaseDocumentTypeList[this.lstCaseDocumentType.SelectedIndex].Active = objCaseDocumentType.Active; } else { ListCaseDocumentTypeList.Add(objCaseDocumentType); } ClearControls(); this.lstCaseDocumentType.DataSource = ListCaseDocumentTypeList; this.lstCaseDocumentType.DataBind(); this.lblStatusMessage.Text = "Case Document type Successfully Saved."; this.programmaticModalPopup.Show(); } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }