public static DataTable GetCaseAccountMaster(ATTCaseAccountMaster attCAM)
        {
            GetConnection    GetConn   = new GetConnection();
            OracleConnection DBConn    = GetConn.GetDbConn(Module.CMS);
            string           SelectSQL = "SP_GET_CASE_ACCOUNT_MASTER";

            try
            {
                List <OracleParameter> paramArray = new List <OracleParameter>();
                paramArray.Add(Utilities.GetOraParam(":P_CASE_ID", attCAM.CaseID, OracleDbType.Double, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_TRAN_DATE", attCAM.TransactionDate, OracleDbType.Varchar2, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_TRAN_SEQ", attCAM.TransactionSequence, OracleDbType.Int64, ParameterDirection.InputOutput));
                paramArray.Add(Utilities.GetOraParam(":P_LITIGANT_ID", attCAM.LitigantID, OracleDbType.Double, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_ATTORNEY_ID", attCAM.AttorneyID, OracleDbType.Double, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_RC", null, OracleDbType.RefCursor, ParameterDirection.Output));

                DataSet   ds  = SqlHelper.ExecuteDataset(DBConn, CommandType.StoredProcedure, SelectSQL, paramArray.ToArray());
                DataTable tbl = new DataTable();
                tbl = (DataTable)ds.Tables[0];
                return(tbl);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static List <ATTCaseAccountMaster> GetCaseAccountMaster(ATTCaseAccountMaster attCAM)
        {
            List <ATTCaseAccountMaster> CAMList = new List <ATTCaseAccountMaster>();

            try
            {
                foreach (DataRow row in DLLCaseAccountMaster.GetCaseAccountMaster(attCAM).Rows)
                {
                    ATTCaseAccountMaster att = new ATTCaseAccountMaster
                                               (
                        int.Parse(row["CASE_ID"].ToString()),
                        row["TRAN_DATE"].ToString(),
                        int.Parse(row["TRAN_SEQ"].ToString()),
                        int.Parse(row["LITIGANT_ID"].ToString()),
                        int.Parse(row["ATTORNEY_ID"].ToString()),
                        row["REMARKS"].ToString()
                                               );
                    CAMList.Add(att);
                }
                return(CAMList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (txtTranDate_RQD.Text == "")
        {
            lblStatus.Text        = "Saving Error";
            lblStatusMessage.Text = "Enter Trasaction Date first";
            programmaticModalPopup.Show();
            return;
        }

        double caseID = 0;
        //int tranSeq = 0;
        ATTCaseAccountMaster attCM = new ATTCaseAccountMaster();

        foreach (GridViewRow gRow in grdCaseAccount.Rows)
        {
            CheckBox cbSelect = (CheckBox)gRow.Cells[0].FindControl("chkPaid");
            if (cbSelect.Checked == true)
            {
                caseID = double.Parse(gRow.Cells[1].Text);
                //tranSeq = int.Parse(gRow.Cells[2].Text);

                ATTCaseAccountDetails attCD = new ATTCaseAccountDetails(double.Parse(gRow.Cells[1].Text), txtTranDate_RQD.Text, 0, int.Parse(gRow.Cells[2].Text), double.Parse(gRow.Cells[4].Text));
                attCD.EntryBy = strUser;
                attCM.LstAccountDetails.Add(attCD);

                ATTCaseAccountForward attCAF = new ATTCaseAccountForward(double.Parse(gRow.Cells[1].Text), int.Parse(gRow.Cells[2].Text), double.Parse(gRow.Cells[4].Text), "Y");
                attCAF.EntryBy = strUser;
                attCM.LstAccountForward.Add(attCAF);
            }
        }

        if (grdLitigants.SelectedIndex > -1)
        {
            GridViewRow row = grdLitigants.SelectedRow;
            attCM.CaseID              = double.Parse(row.Cells[0].Text);
            attCM.TransactionDate     = txtTranDate_RQD.Text.Trim();
            attCM.TransactionSequence = 0;
            attCM.LitigantID          = double.Parse(row.Cells[1].Text);
            attCM.AttorneyID          = double.Parse(row.Cells[2].Text);
            attCM.Remarks             = txtRemarks.Text.Trim();
            attCM.EntryBy             = strUser;
        }
        else
        {
            attCM.CaseID              = caseID;
            attCM.TransactionDate     = txtTranDate_RQD.Text.Trim();
            attCM.TransactionSequence = 0;
            attCM.LitigantID          = null;
            attCM.AttorneyID          = null;
            attCM.Remarks             = txtRemarks.Text.Trim();
            attCM.EntryBy             = strUser;
        }
        if (BLLCaseAccountMaster.SaveCaseAccountMaster(attCM))
        {
            LoadUnPiadAmount();
            ClearControls();
        }
    }
 public static bool SaveCaseAccountMaster(ATTCaseAccountMaster attCAM)
 {
     try
     {
         return(DLLCaseAccountMaster.SaveCaseAccountMaster(attCAM));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static bool SaveCaseAccountMaster(ATTCaseAccountMaster attCAM)
        {
            GetConnection     GetConn = new GetConnection();
            OracleTransaction Tran    = GetConn.GetDbConn(Module.CMS).BeginTransaction();

            string InsertUpdateSQL = "SP_ADD_CASE_ACCOUNT_MASTER";

            try
            {
                List <OracleParameter> paramArray = new List <OracleParameter>();
                paramArray.Add(Utilities.GetOraParam(":P_CASE_ID", attCAM.CaseID, OracleDbType.Double, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_TRAN_DATE", attCAM.TransactionDate, OracleDbType.Varchar2, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_TRAN_SEQ", attCAM.TransactionSequence, OracleDbType.Int64, ParameterDirection.InputOutput));
                if (attCAM.LitigantID == 0)
                {
                    paramArray.Add(Utilities.GetOraParam(":P_LITIGANT_ID", null, OracleDbType.Double, ParameterDirection.Input));
                }
                else
                {
                    paramArray.Add(Utilities.GetOraParam(":P_LITIGANT_ID", attCAM.LitigantID, OracleDbType.Double, ParameterDirection.Input));
                }
                if (attCAM.AttorneyID == 0)
                {
                    paramArray.Add(Utilities.GetOraParam(":P_ATTORNEY_ID", null, OracleDbType.Double, ParameterDirection.Input));
                }
                else
                {
                    paramArray.Add(Utilities.GetOraParam(":P_ATTORNEY_ID", attCAM.AttorneyID, OracleDbType.Double, ParameterDirection.Input));
                }
                paramArray.Add(Utilities.GetOraParam(":P_REMARKS", attCAM.Remarks, OracleDbType.Varchar2, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_ENTRY_BY", attCAM.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input));
                paramArray.Add(Utilities.GetOraParam(":P_OLD_TRAN_DATE", null, OracleDbType.Varchar2, ParameterDirection.Input));

                SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray());

                DLLCaseAccountDetails.SaveCaseAccountDetail(attCAM.LstAccountDetails, Tran);
                DLLCaseAccountForward.SaveCaseAccountForward(attCAM.LstAccountForward, Tran, attCAM.CaseID);
                Tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }