public static List <ATTMyaadType> GetMyaadType(int?myaadTypeID, string active) { try { List <ATTMyaadType> myaadTypeLIST = new List <ATTMyaadType>(); foreach (DataRow drow in DLLMyaadType.GetMyaadType(myaadTypeID, active).Rows) { ATTMyaadType myaadType = new ATTMyaadType(); myaadType.MyaadTypeID = int.Parse(drow["MYAAD_TYPE_ID"].ToString()); myaadType.MyaadTypeName = drow["MYAAD_TYPE_NAME"].ToString(); myaadType.Litigant = drow["LITIGANT"].ToString(); myaadType.Attorney = drow["ATTORNEYS"].ToString(); myaadType.Witness = drow["WITNESS"].ToString(); myaadType.Active = drow["ACTIVE"].ToString(); myaadType.Action = ""; myaadTypeLIST.Add(myaadType); } return(myaadTypeLIST); } catch (Exception ex) { throw ex; } }
protected void btnSubmit_Click(object sender, EventArgs e) { string strUser = "******"; if (myaadTxt_Rqd.Text == "") { this.lblStatusMessage.Text = "Myad cannot be empty"; this.programmaticModalPopup.Show(); } ATTMyaadType objMyaadType = new ATTMyaadType ( this.lstMyaadType.SelectedIndex > -1 ? int.Parse(this.lstMyaadType.SelectedValue) : 0, this.myaadTxt_Rqd.Text.Trim(), this.isActiveCb.Checked ? "Y" : "N" ); objMyaadType.Action = this.lstMyaadType.SelectedIndex > -1 ? "E" : "A"; objMyaadType.MyaadTypeName = pratiuttarCb.Checked == true ? "P" : ""; objMyaadType.Litigant = (rb_Lit_A.Checked == true ? "A" : rb_Lit_R.Checked == true ? "R" : rb_Lit_B.Checked == true ? "B" : ""); objMyaadType.Attorney = (rb_Att_A.Checked == true ? "A" : rb_Att_R.Checked == true ? "R" : rb_Att_B.Checked == true ? "B" : ""); objMyaadType.Witness = (rb_Witt_A.Checked == true ? "A" : rb_Witt_R.Checked == true ? "R" : rb_Witt_B.Checked == true ? "B" : ""); objMyaadType.EntryBy = strUser; try { BLLMyaadType.AddEditDeleteMyaadType(objMyaadType); lblStatusMessage.Text = "Succesfully Saved"; this.programmaticModalPopup.Show(); LoadMyaadType(); } catch (Exception ex) { lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
public static bool AddEditDeleteMyaadType(ATTMyaadType myaadType) { try { return(DLLMyaadType.AddEditDeleteMyaadType(myaadType)); } catch (Exception ex) { throw ex; } }
public static bool AddEditDeleteMyaadType(ATTMyaadType myaadType) { string InsertUpdateDeleteSQL = ""; GetConnection GetConn = new GetConnection(); OracleConnection DBConn = GetConn.GetDbConn(Module.CMS); try { if (myaadType.Action == "A") { InsertUpdateDeleteSQL = "SP_ADD_MYAAD_TYPE"; } else if (myaadType.Action == "E") { InsertUpdateDeleteSQL = "SP_EDIT_MYAAD_TYPE"; } else if (myaadType.Action == "D") { InsertUpdateDeleteSQL = "SP_DEL_MYAAD_TYPE"; } OracleParameter[] ParamArray; if (myaadType.Action == "A" || myaadType.Action == "E") { ParamArray = new OracleParameter[5]; ParamArray[0] = FRAMEWORK.Utilities.GetOraParam(":P_MYAAD_TYPE_ID", myaadType.MyaadTypeID, OracleDbType.Int64, ParameterDirection.InputOutput); ParamArray[1] = FRAMEWORK.Utilities.GetOraParam(":P_MYAAD_TYPE_NAME", myaadType.MyaadTypeName, OracleDbType.Varchar2, ParameterDirection.Input); //ParamArray[2] = FRAMEWORK.Utilities.GetOraParam(":P_MYAAD_ISSUE", myaadType.MyaadIssue, OracleDbType.Varchar2, ParameterDirection.Input); ParamArray[3] = FRAMEWORK.Utilities.GetOraParam(":P_ACTIVE", myaadType.Active, OracleDbType.Varchar2, ParameterDirection.Input); ParamArray[4] = FRAMEWORK.Utilities.GetOraParam(":P_ENTRY_BY", myaadType.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input); SqlHelper.ExecuteNonQuery(DBConn, CommandType.StoredProcedure, InsertUpdateDeleteSQL, ParamArray); myaadType.MyaadTypeID = int.Parse(ParamArray[0].Value.ToString()); myaadType.Action = ""; } return(true); } catch (Exception ex) { throw ex; } finally { GetConn.CloseDbConn(); } }
private void LoadMyaadType() { try { List <ATTMyaadType> myaadTypeLIST = BLLMyaadType.GetMyaadType(null, "Y"); MyaadType = myaadTypeLIST; ATTMyaadType obj = new ATTMyaadType(); obj.MyaadTypeName = "छान्नुहोस्"; obj.MyaadTypeID = 0; myaadTypeLIST.Insert(0, obj); ddlMyaadType.DataSource = myaadTypeLIST; ddlMyaadType.DataBind(); } catch (Exception) { lblStatusMessage.Text = "म्यादको प्रकार लोड गर्न सकेन </br>"; this.programmaticModalPopup.Show(); return; } }