Example #1
0
 public bool AddNewExpense(string strXML)
 {
     SqlCommand sqlCmd = new SqlCommand("ADD_NEW_EXPENSE", sqlCon);
     int intNoOfRows = 0;
     bool blnSuccess = false;
     try
     {
         sqlCmd.CommandType = CommandType.StoredProcedure;
         sqlCmd.Parameters.AddWithValue("@STRXML", strXML);
         sqlCon.Open();
         sqlTxn = sqlCon.BeginTransaction();
         sqlCmd.Transaction = sqlTxn;
         intNoOfRows = Convert.ToInt32(sqlCmd.ExecuteNonQuery());
         if (intNoOfRows == 2)
         {
             sqlTxn.Commit();
             blnSuccess = true;
         }
         else
         {
             sqlTxn.Rollback();
         }
     }
     catch (Exception ex)
     {
         blnSuccess = false;
         sqlTxn.Rollback();
         LogError.LogEvent("ADD_NEW_EXPENSE --> " + strXML, ex.Message, "AddNewExpense");
         return false;
     }
     finally
     {
         sqlCon.Close();
         sqlCmd.Parameters.Clear();
     }
     return blnSuccess;
 }
Example #2
0
        public int ChangeEMImount(int month, int year, decimal dcmlAmount)
        {
            SqlCommand sqlCmd    = new SqlCommand("UPDATE_EMI_AMOUNT", sqlCon);
            int        intResult = 0;

            try
            {
                sqlCmd.CommandType = CommandType.StoredProcedure;
                sqlCmd.Parameters.AddWithValue("@MONTH", month);
                sqlCmd.Parameters.AddWithValue("@YEAR", year);
                sqlCmd.Parameters.AddWithValue("@AMOUNT", dcmlAmount);
                sqlCon.Open();
                sqlTxn             = sqlCon.BeginTransaction();
                sqlCmd.Transaction = sqlTxn;
                intResult          = Convert.ToInt32(sqlCmd.ExecuteScalar());
                if (intResult == 1)
                {
                    sqlTxn.Commit();
                }
                else
                {
                    sqlTxn.Rollback();
                }
            }
            catch (Exception ex)
            {
                sqlTxn.Rollback();
                LogError.LogEvent("UPDATE_EMI_AMOUNT", ex.Message, "ChangeEMImount");
            }
            finally
            {
                sqlCon.Close();
                sqlCmd.Parameters.Clear();
            }
            return(intResult);
        }
Example #3
0
        public DataSet GetPendingLoanApplicationList()
        {
            SqlCommand sqlCmd = new SqlCommand("SELECT MEMBER_NAME,MEMBER_VILLAGE,CONVERT(VARCHAR,APP_DATE,103) AS APPLICATION_DATE,DATENAME(MONTH,CONVERT(DATE,'01/' + CONVERT(VARCHAR,APP_MONTH) + '/1900',103)) + ' - ' + CONVERT(VARCHAR,APP_YEAR) AS REQUIRED_ON FROM LOAN_APPLICATION INNER JOIN MEMBER_MASTER ON MEMBER_ID=APP_MEMBER_ID WHERE APP_TAKEN='0'", sqlCon);

            try
            {
                sqlCmd.CommandType = CommandType.Text;
                SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
                dst = new DataSet();
                sqlDa.Fill(dst);
                LogError.LogEvent(sqlCmd.CommandText, "", "GetPendingLoanApplicationList");
            }
            catch (Exception ex)
            {
                dst = null;
                LogError.LogEvent(sqlCmd.CommandText, ex.Message, "GetPendingLoanApplicationList");
            }
            finally
            {
                sqlCon.Close();
                sqlCmd.Parameters.Clear();
            }
            return(dst);
        }
Example #4
0
        public DataSet GetPendingLoanList()
        {
            SqlCommand sqlCmd = new SqlCommand("GET_PENDING_LOAN_LIST", sqlCon);

            try
            {
                sqlCmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
                dst = new DataSet();
                sqlDa.Fill(dst);
                LogError.LogEvent("GET_PENDING_LOAN_LIST", "", "GetPendingLoanList");
            }
            catch (Exception ex)
            {
                dst = null;
                LogError.LogEvent("GET_PENDING_LOAN_LIST", ex.Message, "GetPendingLoanList");
            }
            finally
            {
                sqlCon.Close();
                sqlCmd.Parameters.Clear();
            }
            return(dst);
        }