Esempio n. 1
0
        public int CountBuyNum(string userName, int productId)
        {
            int        num       = 0;
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@UserName", DbType.String, userName);
            cmdParams.AddInParameter("@ProductId", DbType.Int32, productId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT SUM(Amount) AS CountNum FROM [PE_OrderItem] WHERE OrderId IN(SELECT OrderId FROM [PE_Orders] WHERE UserName = @UserName AND ProductID = @ProductId)", cmdParams))
            {
                if (reader.Read())
                {
                    num = reader.GetInt32("CountNum");
                }
            }
            return(num);
        }
        public EasyOne.Model.Collection.CollectionPagingRuleInfo GetInfoById(int id, int ruleType)
        {
            Parameters cmdParams  = new Parameters();
            string     strCommand = "SELECT * FROM PE_CollectionPagingRules WHERE ItemId = @ItemId AND RuleType = @RuleType";

            cmdParams.AddInParameter("@ItemId", DbType.Int32, id);
            cmdParams.AddInParameter("@RuleType", DbType.Int32, ruleType);
            using (NullableDataReader reader = DBHelper.ExecuteReader(CommandType.Text, strCommand, cmdParams))
            {
                if (reader.Read())
                {
                    return(CollectionPagingRuleInfo(reader));
                }
                return(new EasyOne.Model.Collection.CollectionPagingRuleInfo(true));
            }
        }
Esempio n. 3
0
        public int ScoreCount(int generalId)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@GeneralId", DbType.Int32, generalId);
            int num = 0;

            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT Score FROM PE_Comment WHERE GeneralId = @GeneralId", cmdParams))
            {
                while (reader.Read())
                {
                    num += reader.GetInt32("Score");
                }
            }
            return(num);
        }
Esempio n. 4
0
        public IList <ProductPriceInfo> GetProductPriceById(int productId, string tableName)
        {
            IList <ProductPriceInfo> list = new List <ProductPriceInfo>();
            Parameters cmdParams          = new Parameters();

            cmdParams.AddInParameter("@TableName", DbType.String, tableName);
            cmdParams.AddInParameter("@ProductId", DbType.Int32, productId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT ID, GroupID, Price, PropertyValue FROM PE_ProductPrice WHERE TableName = @TableName AND ProductId = @ProductId", cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(ProductPriceFromrdr(reader));
                }
            }
            return(list);
        }
Esempio n. 5
0
        public ArrayList GetExpressCompannyList()
        {
            ArrayList list = new ArrayList();

            using (NullableDataReader reader = DBHelper.ExecuteReaderProc("PR_Shop_DeliverItem_GetExpressCompannyList"))
            {
                while (reader.Read())
                {
                    if (!string.IsNullOrEmpty(reader.GetString("ExpressCompany")))
                    {
                        list.Add(reader.GetString("ExpressCompany"));
                    }
                }
            }
            return(list);
        }
        public IList <DeliverChargeInfo> GetDeliverChargeListByAreaType(int typeId, int areaType)
        {
            IList <DeliverChargeInfo> list = new List <DeliverChargeInfo>();
            Parameters cmdParams           = new Parameters();

            cmdParams.AddInParameter("@typeId", DbType.Int32, typeId);
            cmdParams.AddInParameter("@areaType", DbType.Int32, areaType);
            using (NullableDataReader reader = DBHelper.ExecuteReaderProc("PR_Shop_DeliverCharge_GetListByAreaType", cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(CreateInfo(reader));
                }
            }
            return(list);
        }
Esempio n. 7
0
        public IList <string> GetFriendNameList(string userName)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@UserName", DbType.String, userName);
            IList <string> list = new List <string>();

            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT TOP 20 FriendName FROM PE_Friend WHERE UserName = @UserName AND GroupID <> 0 ORDER BY AddTime DESC", cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(reader.GetString("FriendName"));
                }
            }
            return(list);
        }
Esempio n. 8
0
        public IList <CompareHitsOrderNumberInfo> GetCompareHitsOrderNumberList(int startRowIndexId, int maxNumberRows, int orderType)
        {
            string    str;
            Database  database          = DatabaseFactory.CreateDatabase();
            DbCommand storedProcCommand = database.GetStoredProcCommand("PR_Shop_Statistics_GetList");

            switch (orderType)
            {
            case 1:
                str = "SUM(M.Hits)";
                break;

            case 2:
                str = "SUM(P.BuyTimes)";
                break;

            default:
                str = "(SUM(P.BuyTimes)*1.0)/(SUM(M.Hits))";
                break;
            }
            database.AddInParameter(storedProcCommand, "@StartRows", DbType.Int32, startRowIndexId);
            database.AddInParameter(storedProcCommand, "@PageSize", DbType.Int32, maxNumberRows);
            database.AddInParameter(storedProcCommand, "@SortColumn", DbType.String, str);
            database.AddInParameter(storedProcCommand, "@StrColumn", DbType.String, "Max(P.ProductName) AS ProductName, SUM(M.Hits) AS Hits, SUM(P.BuyTimes) AS BuyTimes, CONVERT(float,(SUM(P.BuyTimes)*1.0)/(SUM(M.Hits))) AS CompareRate");
            database.AddInParameter(storedProcCommand, "@Sorts", DbType.String, "DESC");
            database.AddInParameter(storedProcCommand, "@TableName", DbType.String, "PE_CommonProduct P INNER JOIN PE_CommonModel M ON P.TableName = M.TableName AND P.ProductID = M.ItemID");
            database.AddInParameter(storedProcCommand, "@Filter", DbType.String, "M.Hits > 0");
            database.AddInParameter(storedProcCommand, "@ID", DbType.String, "P.ProductID");
            database.AddInParameter(storedProcCommand, "@Group", DbType.String, "Group by P.ProductID");
            database.AddOutParameter(storedProcCommand, "@Total", DbType.Int32, maxNumberRows);
            IList <CompareHitsOrderNumberInfo> list = new List <CompareHitsOrderNumberInfo>();

            using (NullableDataReader reader = new NullableDataReader(database.ExecuteReader(storedProcCommand)))
            {
                while (reader.Read())
                {
                    CompareHitsOrderNumberInfo item = new CompareHitsOrderNumberInfo();
                    item.ProductName = reader.GetString("ProductName");
                    item.Hits        = reader.GetInt32("Hits");
                    item.OrderNumber = reader.GetInt32("BuyTimes");
                    item.CompareRate = reader.GetDouble("CompareRate");
                    list.Add(item);
                }
            }
            this.m_TotalOfCompareHitsOrderNumber = (int)database.GetParameterValue(storedProcCommand, "@Total");
            return(list);
        }
        public bool ImportData(string templateId, string importPath)
        {
            bool          flag;
            Database      db      = DatabaseFactory.CreateDatabase();
            StringBuilder builder = new StringBuilder("");

            builder.Append(" SELECT * FROM PE_ModelTemplates ");
            OleDbConnection connection = new OleDbConnection("Provider = Microsoft.Jet.OleDb.4.0;Data Source = " + importPath);

            try
            {
                connection.Open();
                builder.Append("WHERE TemplateID IN (" + DBHelper.ToValidId(templateId) + ") ORDER BY templateId");
                OleDbCommand       command = new OleDbCommand(builder.ToString(), connection);
                NullableDataReader reader  = new NullableDataReader(command.ExecuteReader(CommandBehavior.CloseConnection));
                while (reader.Read())
                {
                    ModelTemplatesInfo modelTemplate = new ModelTemplatesInfo();
                    modelTemplate.TemplateId          = GetMaxId() + 1;
                    modelTemplate.TemplateName        = reader.GetString("TemplateName");
                    modelTemplate.TemplateDescription = reader.GetString("TemplateDescription");
                    modelTemplate.Field   = reader.GetString("Field");
                    modelTemplate.IsEshop = reader.GetBoolean("IsEshop") ? ModelType.Shop : ModelType.Content;
                    DbCommand command2 = GetProcdbComm(db, "PR_Contents_ModelTemplates_Add", modelTemplate);
                    try
                    {
                        db.ExecuteNonQuery(command2);
                        continue;
                    }
                    catch
                    {
                        reader.Close();
                        return(false);
                    }
                }
                flag = true;
            }
            catch
            {
                flag = false;
            }
            finally
            {
                connection.Close();
            }
            return(flag);
        }
Esempio n. 10
0
        public FaltanteDevolucion TraeFaltanteDevolucionXFechaMovimiento(Int64 id_Beneficiario, Int16 codPrestacion, string fechaMovimiento)
        {
            FaltanteDevolucion       oFaltanteD = null;
            List <TipoDocumentacion> result     = null;
            Database db = DatabaseFactory.CreateDatabase("ConveniosInt_V02");
            /* Definimos el nombre de la base que definimos en el Machine.config que luego se explicará. */
            DbCommand dbCommand = db.GetStoredProcCommand("TraeDevolucionesXFechaMovimiento");

            try
            {
                TipoDocumentacion oParam;
                /* Se cargan los parámetros del store */
                db.AddInParameter(dbCommand, "@id_Beneficiario", DbType.Int64, id_Beneficiario);
                db.AddInParameter(dbCommand, "@codPrestacion", DbType.Int16, codPrestacion);
                db.AddInParameter(dbCommand, "@fechaMovimiento", DbType.String, fechaMovimiento);

                /* Se ejecuta el store */
                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    oFaltanteD = new FaltanteDevolucion();
                    result     = new List <TipoDocumentacion>();
                    while (ds.Read())
                    {
                        /* Se llena el objeto con los datos del datareader */
                        Fill(out oParam, ds);
                        /* Se carga el objeto en la lista que se va a devolver */
                        result.Add(oParam);
                    }
                    ds.Close();
                    //}
                    /* Se recorre el datareader */
                }
            }
            catch (Exception ex)
            {
                throw new Exception("Error en Envios.Datos " + System.Reflection.MethodBase.GetCurrentMethod(), ex);
            }
            //catch(sql)
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
            oFaltanteD.LTipoDocumentacionFaltante = result;
            /* Se retorna la lista convirtiendola en Array */
            return(oFaltanteD);
        }
Esempio n. 11
0
        public static List <Agencia> TraerAgencias(Agencia unaAgencia)
        {
            string    sql       = "VamosDePaseo_Agencia_Traer";
            Database  db        = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand dbCommand = db.GetStoredProcCommand(sql);
            Agencia   oAge      = null;

            try
            {
                List <Agencia> lstAgencia = new List <Agencia>();

                db.AddInParameter(dbCommand, "@habilitada", DbType.Boolean, unaAgencia.Habilitada);
                db.AddInParameter(dbCommand, "@esMayorista", DbType.Boolean, unaAgencia.EsMayorista);
                if (unaAgencia.NroLegajo > 0)
                {
                    db.AddInParameter(dbCommand, "@nroLegajo", DbType.Int32, unaAgencia.NroLegajo);
                }

                using (NullableDataReader ds = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (ds.Read())
                    {
                        oAge             = new Agencia();
                        oAge.IdAgencia   = int.Parse(ds["IdAgencia"].ToString());
                        oAge.Descripcion = ds["Descripcion"].ToString();
                        oAge.Habilitada  = bool.Parse(ds["habilitada"].ToString());
                        oAge.EsMayorista = bool.Parse(ds["Esmayorista"].ToString());
                        oAge.NroCuenta   = ds["NroCuenta"].ToString();
                        oAge.NroLegajo   = int.Parse(ds["NroLegajo"].ToString());
                        oAge.Cuit        = ds["Cuit"].ToString();
                        lstAgencia.Add(oAge);
                        oAge = null;
                    }
                }
                return(lstAgencia);
            }
            catch (Exception ex)
            {
                log.Error(string.Format("{0}->{1}-> - Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), ex.Source, ex.Message));
                throw new Exception("Error en AgenciaDAO.TraerAgencias", ex);
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Esempio n. 12
0
 public IList<SourceInfo> GetSourceTypeList()
 {
     string strSql = "SELECT Type FROM PE_Source GROUP BY Type";
     IList<SourceInfo> list = new List<SourceInfo>();
     using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql))
     {
         while (reader.Read())
         {
             if (!string.IsNullOrEmpty(reader.GetString(0)))
             {
                 SourceInfo item = new SourceInfo(reader.GetString(0));
                 list.Add(item);
             }
         }
     }
     return list;
 }
Esempio n. 13
0
        public IList <CardInfo> GetUnsoldCard(string tableName, int productId, int amount)
        {
            string           strSql    = "SELECT TOP " + amount.ToString() + " * FROM PE_Cards WHERE OrderItemID = 0 AND ProductID = @ProductID AND TableName = @TableName";
            IList <CardInfo> list      = new List <CardInfo>();
            Parameters       cmdParams = new Parameters();

            cmdParams.AddInParameter("@ProductID", DbType.Int32, productId);
            cmdParams.AddInParameter("@TableName", DbType.String, tableName);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(CardFromDataReader(reader));
                }
            }
            return(list);
        }
Esempio n. 14
0
        public CardInfo GetCardByOrderItemId(int productId, string tableName, int orderItemId)
        {
            string     strSql    = "SELECT TOP 1 * FROM PE_Cards WHERE ProductId = @ProductId AND TableName = @TableName AND OrderItemId = @OrderItemId";
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@ProductId", DbType.Int32, productId);
            cmdParams.AddInParameter("@TableName", DbType.String, tableName);
            cmdParams.AddInParameter("@OrderItemId", DbType.Int32, orderItemId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                if (reader.Read())
                {
                    return(CardFromDataReader(reader));
                }
                return(new CardInfo(true));
            }
        }
Esempio n. 15
0
        public IList <NodeInfo> GetNodesListByRootId(int rootId)
        {
            IList <NodeInfo> list      = new List <NodeInfo>();
            Parameters       cmdParams = new Parameters();

            cmdParams.AddInParameter("@RootID", DbType.Int32, rootId);
            string strCommand = "SELECT * FROM PE_Nodes WHERE RootID = @RootID AND ParentID > 0 ORDER BY OrderID";

            using (NullableDataReader reader = DBHelper.ExecuteReader(CommandType.Text, strCommand, cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(NodesFromrdr(reader));
                }
            }
            return(list);
        }
Esempio n. 16
0
        public int ValidateUser(string userName, string password)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@UserName", DbType.String, userName);
            cmdParams.AddInParameter("@Password", DbType.String, password);
            int num = -1;

            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT UserId FROM [PE_Users] WHERE UserName = @UserName AND UserPassword = @Password", cmdParams))
            {
                if (reader.Read())
                {
                    num = reader.GetInt32("UserId");
                }
            }
            return(num);
        }
Esempio n. 17
0
        public string GetStatusCodeToProcessStatusCode(int flowId, string rolesId)
        {
            StringBuilder sb        = new StringBuilder();
            Parameters    cmdParams = new Parameters();

            cmdParams.AddInParameter("@FlowID", DbType.Int32, flowId);
            string strCommand = "SELECT StatusCode FROM PE_ProcessStatusCode WHERE FlowID = @FlowID AND ProcessID IN (SELECT ProcessID FROM PE_Process_Roles WHERE FlowID = @FlowID AND RoleID IN(" + rolesId + "))";

            using (NullableDataReader reader = DBHelper.ExecuteReader(CommandType.Text, strCommand, cmdParams))
            {
                while (reader.Read())
                {
                    StringHelper.AppendString(sb, reader.GetInt32("StatusCode").ToString());
                }
            }
            return(sb.ToString());
        }
Esempio n. 18
0
        public ProductInfo GetProductById(int productId, string tableName)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@TableName", DbType.String, tableName);
            cmdParams.AddInParameter("@ProductId", DbType.Int32, productId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT * From PE_CommonProduct WHERE TableName = @TableName AND ProductId = @ProductId", cmdParams))
            {
                if (reader.Read())
                {
                    ProductInfo productInfo = new ProductInfo();
                    ProductFromrdr <ProductInfo>(reader, productInfo);
                    return(productInfo);
                }
                return(new ProductInfo(true));
            }
        }
Esempio n. 19
0
        public IList <RegionInfo> GetCityListByProvince(string province)
        {
            IList <RegionInfo> list      = new List <RegionInfo>();
            Parameters         cmdParams = new Parameters();

            cmdParams.AddInParameter("@Province", DbType.String, province);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT DISTINCT City FROM PE_Region WHERE Province = @Province", cmdParams))
            {
                while (reader.Read())
                {
                    RegionInfo item = new RegionInfo();
                    item.City = reader.GetString("City");
                    list.Add(item);
                }
            }
            return(list);
        }
Esempio n. 20
0
        public IList <RegionInfo> GetProvinceListByCountry(string country)
        {
            IList <RegionInfo> list      = new List <RegionInfo>();
            Parameters         cmdParams = new Parameters();

            cmdParams.AddInParameter("@Country", DbType.String, country);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT DISTINCT Province FROM PE_Region WHERE Country = @Country", cmdParams))
            {
                while (reader.Read())
                {
                    RegionInfo item = new RegionInfo();
                    item.Province = reader.GetString("Province");
                    list.Add(item);
                }
            }
            return(list);
        }
Esempio n. 21
0
        public UserOrderCommonInfo GetDownloadInfo(string userName, int orderItemId)
        {
            UserOrderCommonInfo info = new UserOrderCommonInfo();
            string     strSql        = "SELECT I.* FROM PE_Orders O INNER JOIN PE_OrderItem I ON O.OrderID = I.OrderID WHERE O.UserName = @UserName AND EnableDownload = 1 AND I.ItemID = @ItemID";
            Parameters cmdParams     = new Parameters();

            cmdParams.AddInParameter("@UserName", DbType.String, userName);
            cmdParams.AddInParameter("@ItemID", DbType.Int32, orderItemId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                if (reader.Read())
                {
                    return(GetUserOrderCommonInfo(reader));
                }
                return(new UserOrderCommonInfo(true));
            }
        }
Esempio n. 22
0
        public DeliverChargeInfo GetChargeParmOfWeight(int areaType, int deliverType)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@AreaType", DbType.Int32, areaType);
            cmdParams.AddInParameter("@DeliverType", DbType.Int32, deliverType);
            using (NullableDataReader reader = DBHelper.ExecuteReaderProc("PR_Shop_DeliverCharge_GetChargeParmOfWeight", cmdParams))
            {
                if (reader.Read())
                {
                    DeliverChargeInfo deliverChargeInfo = new DeliverChargeInfo();
                    DeliverChargeInfoFromrdr(deliverChargeInfo, reader);
                    return(deliverChargeInfo);
                }
                return(new DeliverChargeInfo(true));
            }
        }
Esempio n. 23
0
        public EasyOne.Model.UserManage.UserPointLogInfo GetPointLogByIdAndUserName(int logId, string userName)
        {
            string     strSql    = "SELECT * FROM PE_PointLog WHERE LogID = @LogID AND UserName = @UserName";
            Parameters cmdParams = new Parameters("@LogID", DbType.Int32, logId);

            cmdParams.AddInParameter("@UserName", DbType.String, userName);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                if (reader.Read())
                {
                    EasyOne.Model.UserManage.UserPointLogInfo info = UserPointLogInfo(reader);
                    info.Memo = reader.GetString("Memo");
                    return(info);
                }
                return(new EasyOne.Model.UserManage.UserPointLogInfo(true));
            }
        }
Esempio n. 24
0
        public DataTable GetShopModelListByNodeId(int nodeId, bool enable)
        {
            bool flag = false;

            if (!enable)
            {
                flag = true;
            }
            DataTable table = new DataTable();

            table.Columns.Add("NodeId");
            table.Columns.Add("ModelId");
            table.Columns.Add("DefaultTemplateFile");
            table.Columns.Add("ModelName");
            table.Columns.Add("ItemName");
            table.Columns.Add("IsEshop");
            table.Columns.Add("AddInfoFilePath");
            table.Columns.Add("ManageInfoFilePath");
            table.Columns.Add("PreviewInfoFilePath");
            table.Columns.Add("BatchInfoFilePath");
            table.Columns.Add("MaxPerUser");
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@NodeId", DbType.Int32, nodeId);
            cmdParams.AddInParameter("@Disabled", DbType.Boolean, flag);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT R.NodeId, R.ModelId, R.DefaultTemplateFile, M.ModelName, M.ItemName, M.IsEshop, M.AddInfoFilePath, M.ManageInfoFilePath, M.PreviewInfoFilePath, M.BatchInfoFilePath, M.MaxPerUser FROM PE_Nodes_Model_Template R INNER JOIN PE_Model M ON R.ModelId = M.ModelID WHERE R.NodeId = @NodeId AND M.Disabled = @Disabled AND M.IsEshop = 1", cmdParams))
            {
                while (reader.Read())
                {
                    DataRow row = table.NewRow();
                    row["NodeId"]              = reader.GetInt32("NodeId");
                    row["ModelId"]             = reader.GetInt32("ModelId");
                    row["DefaultTemplateFile"] = reader.GetString("DefaultTemplateFile");
                    row["ModelName"]           = reader.GetString("ModelName");
                    row["ItemName"]            = reader.GetString("ItemName");
                    row["IsEshop"]             = reader.GetBoolean("IsEshop");
                    row["AddInfoFilePath"]     = reader.GetString("AddInfoFilePath");
                    row["ManageInfoFilePath"]  = reader.GetString("ManageInfoFilePath");
                    row["PreviewInfoFilePath"] = reader.GetString("PreviewInfoFilePath");
                    row["BatchInfoFilePath"]   = reader.GetString("BatchInfoFilePath");
                    row["MaxPerUser"]          = reader.GetInt32("MaxPerUser");
                    table.Rows.Add(row);
                }
            }
            return(table);
        }
Esempio n. 25
0
        public IList <RegionInfo> GetAreaListByCity(string city)
        {
            IList <RegionInfo> list      = new List <RegionInfo>();
            Parameters         cmdParams = new Parameters();

            cmdParams.AddInParameter("@City", DbType.String, city);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT DISTINCT Area FROM PE_Region WHERE City = @City", cmdParams))
            {
                while (reader.Read())
                {
                    RegionInfo item = new RegionInfo();
                    item.Area = reader.GetString("Area");
                    list.Add(item);
                }
            }
            return(list);
        }
Esempio n. 26
0
        public static List <NovedadDocumentacion> Traer_Documentacion(long idPrestado, DateTime?F_Recep_Desde, DateTime?F_Recep_Hasta, int?idEstado_documentacion,
                                                                      long?id_Novedad, long?id_Beneficiario)
        {
            string    sql                   = "NovedadesDocumentacion_TXEstado";
            Database  db                    = DatabaseFactory.CreateDatabase("DAT_V01");
            DbCommand dbCommand             = db.GetStoredProcCommand(sql);
            List <NovedadDocumentacion> rta = new List <NovedadDocumentacion>();

            db.AddInParameter(dbCommand, "@idPrestador", DbType.Int64, idPrestado);

            db.AddInParameter(dbCommand, "@fRecepcion_desde", DbType.String, F_Recep_Desde.HasValue ? F_Recep_Desde.Value.ToString("yyyyMMdd") : null);
            db.AddInParameter(dbCommand, "@fRecepcion_Hasta", DbType.String, F_Recep_Hasta.HasValue ? F_Recep_Hasta.Value.ToString("yyyyMMdd") : null);
            db.AddInParameter(dbCommand, "@idEstadoDocumentacion", DbType.Int32, !idEstado_documentacion.HasValue ? null : idEstado_documentacion.Value.ToString());
            db.AddInParameter(dbCommand, "@idNovedad", DbType.Int64, id_Novedad.HasValue ? id_Novedad.Value.ToString(): null);
            db.AddInParameter(dbCommand, "@idBeneficiario", DbType.Int64, id_Beneficiario.HasValue ? id_Beneficiario.Value.ToString(): null);

            try
            {
                using (NullableDataReader dr = new NullableDataReader(db.ExecuteReader(dbCommand)))
                {
                    while (dr.Read())
                    {
                        rta.Add(new NovedadDocumentacion(Convert.ToInt64(dr["idNovedad"]),
                                                         new EstadoDocumentacion(Convert.ToInt32(dr["idEstadoDocumentacion"]),
                                                                                 dr["descripcion"].ToString(), false, false, false, false),
                                                         new Beneficiario(Convert.ToInt64(dr["IdBeneficiario"]), Convert.ToInt64(dr["Cuil"]),
                                                                          dr["ApellidoNombre"].ToString()),
                                                         Convert.ToDouble(dr["montoPrestamo"]), Convert.ToDateTime(dr["fRecepcion"]),
                                                         string.IsNullOrEmpty(dr["nroCaja"].ToString())? new int() : Convert.ToInt32(dr["nroCaja"]),
                                                         string.IsNullOrEmpty(dr["CantCuotas"].ToString()) ? new int() : Convert.ToInt32(dr["CantCuotas"])
                                                         ));
                    }
                }
                return(rta);
            }
            catch (Exception err)
            {
                log.Error(string.Format("{0}->{1}->Error:{2}->{3}", DateTime.Now, System.Reflection.MethodBase.GetCurrentMethod(), err.Source, err.Message));
                throw err;
            }
            finally
            {
                db = null;
                dbCommand.Dispose();
            }
        }
Esempio n. 27
0
        public SignInLogInfo GetSignInLog(int generalId, string userName)
        {
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@GeneralID", DbType.Int32, generalId);
            cmdParams.AddInParameter("@UserName", DbType.String, userName);
            SignInLogInfo info = new SignInLogInfo(true);

            using (NullableDataReader reader = DBHelper.ExecuteReaderSql("SELECT * FROM PE_SigninLog WHERE GeneralID = @GeneralID AND UserName = @UserName", cmdParams))
            {
                if (reader.Read())
                {
                    info = SigninLogInfoFromDataReader(reader);
                }
            }
            return(info);
        }
Esempio n. 28
0
        public IList <RoleInfo> GetRoleListByFlowIdAndProcessId(int flowId, int processId)
        {
            string           strSql    = "SELECT * FROM PE_Roles AS U WHERE (NOT EXISTS(SELECT NULL AS Exp FROM PE_Process_Roles AS P WHERE P.FlowId = @FlowId AND P.ProcessId<>@ProcessId AND U.RoleId = P.RoleId))";
            IList <RoleInfo> list      = new List <RoleInfo>();
            Parameters       cmdParams = new Parameters();

            cmdParams.AddInParameter("@FlowId", DbType.Int32, flowId);
            cmdParams.AddInParameter("@ProcessId", DbType.Int32, processId);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                while (reader.Read())
                {
                    list.Add(GetRoleInfoFromrdr(reader));
                }
            }
            return(list);
        }
Esempio n. 29
0
        public string GetProductName(int productId, string tableName)
        {
            string     str       = "";
            string     strSql    = "SELECT Title FROM PE_CommonModel WHERE TableName = @TableName AND LinkType = 0 AND itemId = @ProductId";
            Parameters cmdParams = new Parameters();

            cmdParams.AddInParameter("@ProductId", DbType.String, productId);
            cmdParams.AddInParameter("@TableName", DbType.String, tableName);
            using (NullableDataReader reader = DBHelper.ExecuteReaderSql(strSql, cmdParams))
            {
                if (reader.Read())
                {
                    str = reader.GetString("Title");
                }
            }
            return(str);
        }
        public IList <EasyOne.Model.Collection.CollectionPagingRuleInfo> GetCollectionPagingRuleList(int itemId)
        {
            Parameters cmdParams  = new Parameters();
            string     strCommand = "SELECT * FROM PE_CollectionPagingRules WHERE ItemId = @ItemId";

            cmdParams.AddInParameter("@ItemId", DbType.Int32, itemId);
            IList <EasyOne.Model.Collection.CollectionPagingRuleInfo> list = new List <EasyOne.Model.Collection.CollectionPagingRuleInfo>();

            using (NullableDataReader reader = DBHelper.ExecuteReader(CommandType.Text, strCommand, cmdParams))
            {
                if (reader.Read())
                {
                    list.Add(CollectionPagingRuleInfo(reader));
                }
            }
            return(list);
        }