Ejemplo n.º 1
0
        public string InsertAccountNumber(ClientAccMapper objEn)
        {
            string    msg       = string.Empty;
            DbCommand DbCommand = default(DbCommand);

            try
            {
                Database ds = default(Database);

                ds = DatabaseFactory.CreateDatabase(cnstr);

                DbCommand = ds.GetStoredProcCommand("USP_tblClinetAccMapper_Insert");

                ds.AddInParameter(DbCommand, "ClientID", DbType.Guid, objEn.ClientID);
                ds.AddInParameter(DbCommand, "AccNumber", DbType.String, objEn.AccountNumber);
                msg = ds.ExecuteNonQuery(DbCommand).ToString();
                DbCommand.Parameters.Clear();
                msg = "success";
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DbCommand.Dispose();
            }
            return(msg);
        }
Ejemplo n.º 2
0
        public List <ClientAccMapper> GetAcountNumberByClinetId(Guid?ClientId)
        {
            List <ClientAccMapper> enobjlst = new List <ClientAccMapper>();

            DbCommand DbCommand = default(DbCommand);

            try
            {
                Database ds = DatabaseFactory.CreateDatabase(cnstr);
                DbCommand = ds.GetStoredProcCommand("USP_tblClientAccMapper_GetByID");
                ds.AddInParameter(DbCommand, "ClientId", DbType.Guid, ClientId);
                using (IDataReader dataReader = ds.ExecuteReader(DbCommand))
                {
                    while (dataReader.Read())
                    {
                        ClientAccMapper objen = new ClientAccMapper();
                        DAL.EntityUtils.PopulateEntity(objen, dataReader);
                        enobjlst.Add(objen);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DbCommand.Dispose();
            }
            return(enobjlst);
        }