public int ChangePassword(int CustomerId, string oldpassword, string newpassword)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customerID", CustomerId);
                _objServ.fnAddInputParam("@oldpassword", oldpassword);
                _objServ.fnAddInputParam("@newpassword", newpassword);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("ChangePassword");
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) != 1)
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public int UpdatePassword(string emailid, string password)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@emailid", emailid);
                _objServ.fnAddInputParam("@password", password);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("UpdatePassword");
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) != 1)
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public DataSet GetUserCredential(string userId, string Password)
        {
            try
            {
                clsCommonDL _objServ = new clsCommonDL();
                _objServ.fnAddInputParam("@userID", userId);
                _objServ.fnAddInputParam("@password", Password);

                // _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);

                DataSet dsnew = _objServ.fnExecuteDataSet("GetCredential");

                if (dsnew != null)
                {
                    return(dsnew);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
            }
        }
 public DataSet LockCard(string userId, string Password, int ATMPIN)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@userID", userId),
             new SqlParameter("@password", Password),
             new SqlParameter("@oldATMpin", ATMPIN)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("LockCard", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
 public DataSet PopulateName(long AccounNo)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@AccNO", AccounNo)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("PopulateName", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
        public int UpdateLocking(int CustomerID, string BankId, int valid, int Locked)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@valid ", valid);
                _objServ.fnAddInputParam("@locked ", Locked);
                _objServ.fnAddInputParam("@customerID", CustomerID);
                _objServ.fnAddInputParam("@BankID ", BankId);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("UpdateLocking");
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) == 1)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public DataSet GetStateList(string CountryId)
        {
            DataSet dsnew = null;

            try
            {
                clsCommonDL    _objServ = new clsCommonDL();
                SqlParameter[] param    = new SqlParameter[]
                {
                    new SqlParameter("@countryid", CountryId),
                };
                dsnew = _objServ.fnExecuteDataSet("GetStates", param);

                if (dsnew != null)
                {
                    return(dsnew);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                dsnew = null;
            }
        }
        public int InsertTransactionDaily(int customerID, string BankID, string RefNo, decimal creditamt, string narration,
                                          string status)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customerID", customerID);
                _objServ.fnAddInputParam("@BankID", BankID);
                _objServ.fnAddInputParam("@refno", RefNo);
                _objServ.fnAddInputParam("@crdtdbtamt", creditamt);
                _objServ.fnAddInputParam("@narration", narration);
                _objServ.fnAddInputParam("@status", status);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("InsertTransactionDaily");
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) == 1)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
 public DataSet GetAccountNumberForBank(string BankID, int customerID)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@BankID", BankID),
             new SqlParameter("@customerID", customerID)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("GetAccountNumberFromBank", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
        public DataSet GetCityList(string CityId)
        {
            try
            {
                clsCommonDL    _objServ = new clsCommonDL();
                SqlParameter[] param    = new SqlParameter[]
                {
                    new SqlParameter("@statesID", CityId),
                };
                DataSet dsnew = _objServ.fnExecuteDataSet("GetCity", param);

                if (dsnew != null)
                {
                    return(dsnew);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
            }
        }
 public DataSet CheckCreditCardNumber(string CreditId)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@creditID", CreditId)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("CheckCreditNoAvailability", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
 public DataSet GetRegistrationDate(int CustomerId, string BankId)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@customerId", CustomerId),
             new SqlParameter("@BankID", BankId)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("GetRegistrationDate", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
 public DataSet BankBasedAccountNumber(string AccountNo)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@AccNO", AccountNo)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("GetCurrentBank", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
 public DataSet GetOnlyRequiedBank(int CustomerId)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@customerId", CustomerId),
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("GetOnlyRequiedBank", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
        public DataSet GetBankList()
        {
            DataSet dsnew = null;

            try
            {
                clsCommonDL _objServ = new clsCommonDL();
                dsnew = _objServ.fnExecuteDataSet("GetBank");
                if (dsnew != null)
                {
                    return(dsnew);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                dsnew = null;
            }
        }
 public DataSet CheckCustomerName(string CustomerName)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@customername", CustomerName)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("CheckCustomerName", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
        public int IncrementCount(int CustomerID, string BankId)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customerID", CustomerID);
                _objServ.fnAddInputParam("@BankID", BankId);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("IncrementCount");
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) == 1)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public int DepositTransaction(string frombankcode, string tobankcode, string fromaccountno, string toaccountno, string benificiaryname, decimal amount, int CustomerId)
        {
            int ReturnCode = 0;

            try
            {
                clsCommonDL _objServ = new clsCommonDL();
                _objServ.fnAddInputParam("frombankcode", frombankcode);
                _objServ.fnAddInputParam("tobankcode", tobankcode);
                _objServ.fnAddInputParam("fromaccountno", fromaccountno);
                _objServ.fnAddInputParam("toaccountno", toaccountno);
                _objServ.fnAddInputParam("benificiaryname", benificiaryname);
                _objServ.fnAddInputParam("amount", amount);
                _objServ.fnAddInputParam("@customerID", CustomerId);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("DepositAmount");
                ReturnCode = Convert.ToInt32(_objServ.Output_Parameters[0].Value);
                return(ReturnCode);
            }
            catch (Exception ex)
            {
                return(ReturnCode);
            }
            finally
            {
            }
        }
 public DataSet GetUserCredential(string userId, string Password, int ATMPIN)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@userID", userId),
             new SqlParameter("@password", Password),
             new SqlParameter("@oldATMpin", ATMPIN)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("EnterATMTransaction", param);
         dsnew.Tables[0].TableName = "ValidateUser";
         dsnew.Tables[1].TableName = "IsLockedAndValid";
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
 public DataSet GetBankWithBranch(string BankID, int customerID, int AtmPin)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@BankID", BankID),
             new SqlParameter("@customerID", customerID),
             new SqlParameter("@ATMPin", AtmPin)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("GetBankWithBranch", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
        public DataSet GetBankCredit(string BankId)
        {
            DataSet dsnew = null;

            try
            {
                clsCommonDL    _objServ = new clsCommonDL();
                SqlParameter[] param    = new SqlParameter[]
                {
                    new SqlParameter("@BankID", BankId),
                };
                dsnew = _objServ.fnExecuteDataSet("ViewBankCredit", param);

                if (dsnew != null)
                {
                    return(dsnew);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                dsnew = null;
            }
        }
 public DataSet ValidateCreditAvailability(int CustomerId, string BankId)
 {
     try
     {
         clsCommonDL    _objServ = new clsCommonDL();
         SqlParameter[] param    = new SqlParameter[]
         {
             new SqlParameter("@customerID", CustomerId),
             new SqlParameter("@BankID", BankId)
         };
         DataSet dsnew = _objServ.fnExecuteDataSet("ValidateCreditAvailability", param);
         if (dsnew != null)
         {
             return(dsnew);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         return(null);
     }
     finally
     {
     }
 }
        public int InsertDepositTransactions(int customerID, string BankID, string RefNo, decimal creditamt, string narration,
                                             string status, string ToAccountNumber)
        {
            clsCommonDL _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customerID", customerID);
                _objServ.fnAddInputParam("@BankID", BankID);
                _objServ.fnAddInputParam("@refno", RefNo);
                _objServ.fnAddInputParam("@creditamount", creditamt);
                _objServ.fnAddInputParam("@narration", narration);
                _objServ.fnAddInputParam("@status", status);
                _objServ.fnAddInputParam("@bankaccNo", ToAccountNumber);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("IntraBankDepositTransaction");
                return(Convert.ToInt32(_objServ.Output_Parameters[0].Value));
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public int InsertCustomerAndBank(string customername, string add1, string add2, string add3,
                                         string city, string states, string country, string emailid, string sex, string contact,
                                         string othercontact, string BankID, string userID, string password, int oldATMpin,
                                         string transactionpassword, long AccNO, decimal totalBalance, out int ReturnID, string ReportPath, string PanCardNumber)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customername", customername);
                _objServ.fnAddInputParam("@add1", add1);
                _objServ.fnAddInputParam("@add2", add2);
                _objServ.fnAddInputParam("@add3", add3);
                _objServ.fnAddInputParam("@city", city);
                _objServ.fnAddInputParam("@states", states);
                _objServ.fnAddInputParam("@country", country);
                _objServ.fnAddInputParam("@email", emailid);
                _objServ.fnAddInputParam("@sex", sex);
                _objServ.fnAddInputParam("@contact", contact);
                _objServ.fnAddInputParam("@othercontact", othercontact);
                _objServ.fnAddInputParam("@BankID", BankID);
                _objServ.fnAddInputParam("@userID", userID);
                _objServ.fnAddInputParam("@password", password);
                _objServ.fnAddInputParam("@oldATMpin", oldATMpin);
                _objServ.fnAddInputParam("@transactionpassword", transactionpassword);
                _objServ.fnAddInputParam("@AccNO", AccNO);
                _objServ.fnAddInputParam("@totalavailablebalance", totalBalance);
                _objServ.fnAddInputParam("@RegistrationPath", ReportPath);
                _objServ.fnAddInputParam("@PANCardNo", PanCardNumber);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnAddOutputParam("@ReturnID", SqlDbType.Int);
                _objServ.fnExecuteDataSet("Insertcustomer");
                ReturnID = Convert.ToInt32(_objServ.Output_Parameters[1].Value);
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) != 1)
                {
                    return(0);
                }
                else
                {
                    return(1);
                }
            }
            catch (Exception ex)
            {
                ReturnID = Convert.ToInt32(_objServ.Output_Parameters[1].Value);
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public int InsertCreditCardDetails(string customerID, string BankID, string creditID, string cdetails,
                                           DateTime expdate, int validity, int cvv, DateTime RegDate, Boolean valid, Boolean locked, string DMFlag, string CreditCardPath, out int ReturnCustomerId, out string EmailId)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customerID", customerID);
                _objServ.fnAddInputParam("@BankID", BankID);
                _objServ.fnAddInputParam("@creditID", creditID);
                _objServ.fnAddInputParam("@cdetails", cdetails);
                _objServ.fnAddInputParam("@expdate", expdate);
                _objServ.fnAddInputParam("@validity", validity);
                _objServ.fnAddInputParam("@cvv", cvv);
                _objServ.fnAddInputParam("@regdate", RegDate);
                _objServ.fnAddInputParam("@valid", valid);
                _objServ.fnAddInputParam("@locked", locked);
                _objServ.fnAddInputParam("@DMLFlag", DMFlag);
                _objServ.fnAddInputParam("@CreditCardPath", CreditCardPath);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnAddOutputParam("@ReturnID", SqlDbType.Int);
                _objServ.fnAddOutputParam("@EmailId", SqlDbType.NVarChar, 100);
                _objServ.fnExecuteDataSet("IUDCreditCardDetails");
                ReturnCustomerId = Convert.ToInt32(_objServ.Output_Parameters[1].Value);
                EmailId          = _objServ.Output_Parameters[2].Value.ToString();
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) == 1)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                ReturnCustomerId = Convert.ToInt32(_objServ.Output_Parameters[1].Value);
                EmailId          = _objServ.Output_Parameters[1].Value.ToString();
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public DataSet fnGetCountryAndBank()
        {
            DataSet ds = null;

            try
            {
                clsCommonDL _objServ = new clsCommonDL();
                ds = _objServ.fnExecuteDataSet("GetCountry");
                return(ds);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                ds = null;
            }
        }
        public DataSet SearchReportByBank(int CustomerId, string BankId)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@customerID", CustomerId);
                _objServ.fnAddInputParam("@BankID", BankId);
                DataSet dsCustomerRpt = _objServ.fnExecuteDataSet("SearchReportByCustomer");
                return(dsCustomerRpt);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                _objServ = null;
            }
        }
        public DataSet SearchCardDetails(string CustomerName, string CreditCardNumber, string AccountNumber, string BankID)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@CustomerName", CustomerName);
                _objServ.fnAddInputParam("@CreditCardNumber", CreditCardNumber);
                _objServ.fnAddInputParam("@AcountNumber", AccountNumber);
                _objServ.fnAddInputParam("@BankID", BankID);
                DataSet dsCustomerRpt = _objServ.fnExecuteDataSet("SearchInvalidateCard");
                return(dsCustomerRpt);
            }
            catch (Exception ex)
            {
                return(null);
            }
            finally
            {
                _objServ = null;
            }
        }
        public int ImportCustomerDetails(string BankID, string userID, string password, int oldATMpin,
                                         string transactionpassword, long NewAccNO, decimal totalavailablebalance, string RegistrationPath, out int ReturnId, long OldAcctNo)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@BankID", BankID);
                _objServ.fnAddInputParam("@userID", userID);
                _objServ.fnAddInputParam("@password", password);
                _objServ.fnAddInputParam("@oldATMpin", oldATMpin);
                _objServ.fnAddInputParam("@transactionpassword", transactionpassword);
                _objServ.fnAddInputParam("@NewAccNO", NewAccNO);
                _objServ.fnAddInputParam("@OldAccNO", OldAcctNo);
                _objServ.fnAddInputParam("@totalavailablebalance", totalavailablebalance);
                _objServ.fnAddInputParam("@RegistrationPath", RegistrationPath);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnAddOutputParam("@ReturnID", SqlDbType.Int);
                _objServ.fnExecuteDataSet("ImportCustomerDetails");
                ReturnId = Convert.ToInt32(_objServ.Output_Parameters[1].Value);
                if (Convert.ToInt32(_objServ.Output_Parameters[0].Value) == 1)
                {
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception ex)
            {
                ReturnId = Convert.ToInt32(_objServ.Output_Parameters[1].Value);
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }
        public int MonthlyMaintainanceCharges(string userId, string Password, int ATMPIN)
        {
            clsCommonDL _objServ = _objServ = new clsCommonDL();

            try
            {
                _objServ.fnAddInputParam("@userID", userId);
                _objServ.fnAddInputParam("@password", Password);
                _objServ.fnAddInputParam("@oldATMpin", ATMPIN);
                _objServ.fnAddOutputParam("@spStatus", SqlDbType.Int);
                _objServ.fnExecuteDataSet("MonthlyMaintainanceCharges");
                return(Convert.ToInt32(_objServ.Output_Parameters[0].Value));
            }
            catch (Exception ex)
            {
                return(0);
            }
            finally
            {
                _objServ = null;
            }
        }