Пример #1
0
 public List<Model.Device> GetDeviceList(string whereStr, string sortStr)
 {
     var cmd = new DataCommand("getDevice", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#",whereStr);
     cmd.ReplaceParameterValue("#Sort#", sortStr);
     return cmd.ExecuteEntityList<Model.Device>();
 }
Пример #2
0
 public List<Model.TS_DataCenter_Area_Month> GetTsDataCenterAreaMonth(string whereStr, string Year)
 {
     var cmd = new DataCommand("GetTsDataCenterAreaMonth", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#", whereStr);
     cmd.ReplaceParameterValue("#Year#", Year);
     return cmd.ExecuteEntityList<Model.TS_DataCenter_Area_Month>();
 }
Пример #3
0
        public List<Model.MonthSumData> GetMonthDataObjectList(string tableName,string date)
        {
            var cmd = new DataCommand("getMonthData", new SqlCustomDbCommand());
            cmd.ReplaceParameterValue("#TableName#", tableName);

            return cmd.ExecuteEntityList<Model.MonthSumData>();
        }
Пример #4
0
 public List<Model.TB_Menu> GetMenuList(string where, string order)
 {
     var cmd = new DataCommand("GetMenuList", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#", where);
     cmd.ReplaceParameterValue("#orderby#", order);
     return cmd.ExecuteEntityList<Model.TB_Menu>();
 }
Пример #5
0
 public List<Model.TB_ALLOCTION_CONFIG_History> GetConfigLogList(string whereStr, string orderBy)
 {
     var cmd = new DataCommand("getConfigLogList", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#", whereStr);
     cmd.ReplaceParameterValue("#orderBy#", orderBy);
     return cmd.ExecuteEntityList<Model.TB_ALLOCTION_CONFIG_History>();
 }
Пример #6
0
        public List<CostQueryModel> GetCostQuery(QueryCost query)
        {
            try
            {
                var cmd = new DataCommand("getCostQuery", new SqlCustomDbCommand());
                string table = "";
                switch (query.Particle)
                {
                    case Particle.Month:
                        table = string.Format("TS_FEE_DAY_{0}", query.StartTime.Year);
                        break;
                    case Particle.Year:
                        table = string.Format("TS_FEE_MONTH_{0}", query.StartTime.Year);
                        break;
                    default:
                        table = string.Format("TS_FEE_DAY_{0}", query.StartTime.Year);
                        break;
                }
                cmd.ReplaceParameterValue("#TableName#", table);
                cmd.SetParameterValue("@OBJECTID", query.ObjectId.ToString());
                cmd.SetParameterValue("@ITEMCODE", query.ItemCode);
                cmd.SetParameterValue("@StartTime", query.StartTime);
                cmd.SetParameterValue("@EndTime", query.EndTime);

                return cmd.ExecuteEntityList<CostQueryModel>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Пример #7
0
        public List<AlarmDiagnoseModel> GetAlarmDiagnose(QueryAlarm query)
        {
            try
            {
                var cmd = new DataCommand("getAlarmDiagnose", new SqlCustomDbCommand());
                IList<string> objectIds = new AlarmAccess().GetAlarmListAreaId(query.ObjectId, query.ObjType);
                StringBuilder sb = new StringBuilder();
                foreach (string s in objectIds)
                {
                    sb.Append(s);
                    sb.Append(",");
                }
                sb.Remove(sb.Length - 1, 1);
                cmd.ReplaceParameterValue("#ObjectId#", sb.ToString());
                cmd.SetParameterValue("@StartTime", query.StartTime);
                cmd.SetParameterValue("@EndTime", query.EndTime);

                return cmd.ExecuteEntityList<AlarmDiagnoseModel>();
            }
            catch(Exception ee)
            {
                throw ee;
                //return null;
            }
        }
Пример #8
0
        public static List <ChannelProductAppointEntity> GetAllAppointList(int page, int pageSize)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetAllAppointList");

            command.SetParameterValue("@Page", page);
            command.SetParameterValue("@PageSize", pageSize);

            return(command.ExecuteEntityList <ChannelProductAppointEntity>());
        }
Пример #9
0
        public static List <POSSBLogEntity> GetPOSSBLog(int poSysNo, string actionType)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetPOSSBLog");

            command.SetParameterValue("@POSysNo", poSysNo);
            command.SetParameterValue("@ActionType", actionType);

            return(command.ExecuteEntityList <POSSBLogEntity>());
        }
Пример #10
0
        public List <PrivilegeEntity> GetPrivilegeList()
        {
            DataCommand dc =
                DataCommandManager.GetDataCommand("External_Get_PrivilegeList");

            List <PrivilegeEntity> result = dc.ExecuteEntityList <PrivilegeEntity>();

            return(result);
        }
Пример #11
0
        /// <summary>
        /// 加载UserRole信息
        /// </summary>
        public static List <User_Role> LoadUserRole(int UserSysNo)
        {
            DataCommand cmd = new DataCommand("LoadUserRole");

            cmd.SetParameter("@UserSysNo", DbType.Int32, UserSysNo);
            List <User_Role> list = cmd.ExecuteEntityList <User_Role>();

            return(list);
        }
Пример #12
0
        public static List <PurchaseOrderSSBLogInfo> LoadPOSSBLog(int poSysNo, PurchaseOrderSSBMsgType msgType)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetPOSSBLog");

            command.SetParameterValue("@POSysNo", poSysNo);
            command.SetParameterValue("@ActionType", msgType.ToString());

            return(command.ExecuteEntityList <PurchaseOrderSSBLogInfo>());
        }
Пример #13
0
        /// <summary>
        /// 获取商品映射列表
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        private IList <ProductMapping> GetProductMappingList(int productSysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("GetProductMappingList");

            dc.SetParameterValue("@ProductSysNo", productSysNo);
            var sourceEntity = dc.ExecuteEntityList <ProductMapping>();

            return(sourceEntity);
        }
Пример #14
0
        /// <summary>
        /// 获取商品时效性促销语
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        private IList <ProductTimelyPromotionTitle> GetProductTimelyPromotionTitle(int productSysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("GetProductTimelyPromotionTitle");

            dc.SetParameterValue("@ProductSysNo", productSysNo);
            var sourceEntity = dc.ExecuteEntityList <ProductTimelyPromotionTitle>();

            return(sourceEntity);
        }
Пример #15
0
        /// <summary>
        /// 获取商品销售区域列表
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        private IList <ProductSalesAreaInfo> GetProductSalesAreaInfoBySysNo(int productSysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("GetProductSalesAreaInfoBySysNo");

            dc.SetParameterValue("@ProductSysNo", productSysNo);
            var sourceEntity = dc.ExecuteEntityList <ProductSalesAreaInfo>();

            return(sourceEntity);
        }
Пример #16
0
        public List <SaleGiftInfo> GetGiftItemListByProductSysNo(int productSysNo, SaleGiftStatus status)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("SaleGift_GetGiftItemListByProductSysNo");

            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            cmd.SetParameterValue("@Status", status);

            return(cmd.ExecuteEntityList <SaleGiftInfo>());
        }
Пример #17
0
        /// <summary>
        /// 获取当前商品会员价格更改请求
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        public List <ProductRankPriceInfo> GetProductRequestRankPriceBySysNo(int productSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetProductRequestRankPriceBySysNo");

            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            var sourceEntity = cmd.ExecuteEntityList <ProductRankPriceInfo>();

            return(sourceEntity);
        }
Пример #18
0
        /// <summary>
        /// 根据商品ID查询商品列表,用于查询返修品,ProductID类似 xxxxR(目前仅RMA调用)
        /// </summary>
        /// <returns></returns>
        public List <ProductInfo> GetSimpleProductListByID(string productID)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("GetSimpleProductListByID");

            dc.SetParameterValue("@ProductID", productID);
            var sourceEntity = dc.ExecuteEntityList <ProductInfo>();

            return(sourceEntity);
        }
Пример #19
0
        public static List <PurchaseOrderReceivedInfo> LoadPurchaseOrderReceivedInfo(int poSysNo)
        {
            List <PurchaseOrderReceivedInfo> result = new List <PurchaseOrderReceivedInfo>();
            DataCommand command = DataCommandManager.GetDataCommand("GetPOReceivedInfoByPOSysNo");

            command.SetParameterValue("@POSysNo", poSysNo);
            result = command.ExecuteEntityList <PurchaseOrderReceivedInfo>();
            return(result);
        }
Пример #20
0
        public static List<SecKillEntity> GetCountDownItem4SecKill()
        {
            List<SecKillEntity> result;
            DataCommand command = DataCommandManager.GetDataCommand("GetCountDownItem4SecKill");

            result = command.ExecuteEntityList<SecKillEntity>();

            return result;
        }
Пример #21
0
        /// <summary>
        /// 获取 超过10天 待审核(0)、待支付(2)、待主管审核(3)、待出库(1) 的订单信息;
        /// </summary>
        /// <returns>成功返回MoreThanTenDaysOrderInfoEntity 列表</returns>
        public static List <MoreThanTenDaysOrderInfoEntity> GetMoreThanTenDaysUnauditedOrNotOutStockOrderInfoList(string CompanyCode)
        {
            List <MoreThanTenDaysOrderInfoEntity> result = new List <MoreThanTenDaysOrderInfoEntity>();
            DataCommand command = DataCommandManager.GetDataCommand("GetUnauditedOrNotOutStockOrderList");

            command.SetParameterValue("@CompanyCode", CompanyCode);
            result = command.ExecuteEntityList <MoreThanTenDaysOrderInfoEntity>();
            return(result);
        }
Пример #22
0
        public static List<InventoryStockEntity> GetInventoryStock(int ProductSysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetInventoryStockByProductSysNo");

            command.SetParameterValue("@ProductSysNo", ProductSysNo);

            List<InventoryStockEntity> result = command.ExecuteEntityList<InventoryStockEntity>();
            return result;
        }
Пример #23
0
        /// <summary>
        /// 根据存储过程名称查询元数据
        /// </summary>
        /// <param name="argProceName"></param>
        /// <returns></returns>
        public List <ProceMetadata> GetMetadataList(string argProceName)
        {
            DataCommand command = DataCommandManager.GetDataCommand("Common.GetProceParam");

            command.SetParameterValue("@SPECIFIC_NAME", argProceName);
            List <ProceMetadata> list = command.ExecuteEntityList <ProceMetadata>();

            return(list);
        }
Пример #24
0
        //查询三级别类别
        public List <ProductBrandWarrantyInfo> GetC3SysNo(ProductBrandWarrantyInfo productBrandWarranty)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetBrandWarrantyC3SysNo");

            cmd.SetParameterValue("@C1SysNo", productBrandWarranty.C1SysNo);
            cmd.SetParameterValue("@C2SysNo", productBrandWarranty.C2SysNo);
            cmd.SetParameterValue("@C3SysNo", productBrandWarranty.C3SysNo);
            return(cmd.ExecuteEntityList <ProductBrandWarrantyInfo>());
        }
Пример #25
0
        public static List <UICustomerReviewInfo> GetGoodReview(int limitCount)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Review_GetGoodReview");

            SetCommandDefaultParameters(cmd);
            cmd.SetParameterValue("@TopCount", limitCount);

            return(cmd.ExecuteEntityList <UICustomerReviewInfo>());
        }
Пример #26
0
        public List <CarInfo> GetCarInfoBySupplierID(long supplierID)
        {
            List <CarInfo> result  = new List <CarInfo>();
            DataCommand    command = new DataCommand(ConnectionString, GetDbCommand(CarStatement.GetCarInfoBySupplierID, "Text"));

            command.AddInputParameter("@SupplierID", DbType.Int64, supplierID);
            result = command.ExecuteEntityList <CarInfo>();
            return(result);
        }
Пример #27
0
        public List <PrivilegeEntity> GetPrivilegeListByRoleSysNo(int roleSysNo)
        {
            DataCommand dc =
                DataCommandManager.GetDataCommand("External_Get_PrivilegeListByRoleSysNo");

            dc.SetParameterValue("@RoleSysNo", roleSysNo);

            return(dc.ExecuteEntityList <PrivilegeEntity>());
        }
Пример #28
0
        public static List <CommissionSettlementItemEntity> CommissionSettlementItemBySysNo(int userSysNo, DateTime beginDate, DateTime endDate)
        {
            DataCommand command = DataCommandManager.GetDataCommand("Settled.CommissionSettlementItemBySysNo");

            command.SetParameterValue("@UserSysNo", userSysNo);
            command.SetParameterValue("@BeginDate", beginDate);
            command.SetParameterValue("@EndDate", endDate);
            return(command.ExecuteEntityList <CommissionSettlementItemEntity>());
        }
Пример #29
0
        public static List <POItem> GetPOItemBySys(int poSys, string companyCode)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetPOItemBySys");

            cmd.SetParameterValue("@SysNo", poSys);
            cmd.SetParameterValue("@Companycode", companyCode);

            return(cmd.ExecuteEntityList <POItem>());
        }
Пример #30
0
        public static List <OnlineList> GetAllC1SysNolist()
        {
            List <OnlineList> onlineList = null;
            DataCommand       command    = DataCommandManager.GetDataCommand("GetAllC1SysNolist");

            command.SetParameterValue("@CompanyCode", CompanyCode);
            onlineList = command.ExecuteEntityList <OnlineList>();
            return(onlineList);
        }
Пример #31
0
        public static List <ChannelProductPercentEntity> GetAllPercentListByChannelSysNo(int page, int pageSize, int ChannelSysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetAllPercentListByChannelSysNo");

            command.SetParameterValue("@Page", page);
            command.SetParameterValue("@PageSize", pageSize);
            command.SetParameterValue("@ChannelSysNo", ChannelSysNo);
            return(command.ExecuteEntityList <ChannelProductPercentEntity>());
        }
Пример #32
0
        public List <ProductDepartmentCategory> GetExistingProductCategories(List <int> c2SysNoLsit, int productDomainSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("ProductDomain_GetExistingProductCategories");

            cmd.SetParameterValue("@C2SysNoLsit", c2SysNoLsit.Join(","));
            cmd.SetParameterValue("@ProductDomainSysNo", productDomainSysNo);

            return(cmd.ExecuteEntityList <ProductDepartmentCategory>());
        }
Пример #33
0
        public static List <OnlineList> GetAllBrand()
        {
            List <OnlineList> result  = null;
            DataCommand       command = DataCommandManager.GetDataCommand("GetAllBrand");

            command.SetParameterValue("@CompanyCode", CompanyCode);
            result = command.ExecuteEntityList <OnlineList>();
            return(result);
        }
Пример #34
0
        public List <CommissionRule> GetCommissionRulesByMerchantSysNo(int merchantSysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetCommissionRulesByMerchantSysNo");

            command.SetParameterValue("@MerchantSysNo", merchantSysNo);
            command.SetParameterValue("@CompanyCode", GlobalSettings.CompanyCode);

            return(command.ExecuteEntityList <CommissionRule>());
        }
Пример #35
0
        /// <summary>
        /// 获取经销商品结算单子项(附带着税金价款信息)
        /// </summary>
        /// <param name="SettleInfo"></param>
        /// <returns></returns>
        public List <SettleItemInfo> GetSettleItemInfoWithTaxAndCost(SettleInfo settleInfo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetSettleItemInfoWithTaxAndCost");

            command.SetParameterValue("@SettleSysNo", settleInfo.SysNo);
            var result = command.ExecuteEntityList <SettleItemInfo>();

            return(result);
        }
Пример #36
0
        /// <summary>
        /// 相同产品ID、相同批次号
        /// </summary>
        /// <param name="goodsid"></param>
        /// <param name="storageID"></param>
        /// <param name="batchNumber"></param>
        /// <param name="DY0">是否查询大于0</param>
        /// <returns></returns>
        public List <InventoryInfo> GetInventoryByRule(int goodsid, int storageID, string batchNumber, int CustomerID, bool DY0, string keywords)
        {
            List <InventoryInfo> result = new List <InventoryInfo>();
            string sqlText = InventoryStatement.GetAllInventoryByRule;

            if (!string.IsNullOrEmpty(keywords))
            {
                sqlText += " and GoodsID in(select GoodsID from wms_GoodsInfo where GoodsName like '%" + keywords + "%')";
            }
            if (goodsid > 0)
            {
                sqlText += " AND GoodsID=@GoodSID";
            }
            if (storageID > 0)
            {
                sqlText += " AND StorageID=@StorageID";
            }
            if (!string.IsNullOrEmpty(batchNumber))
            {
                sqlText += " AND BatchNumber=@BatchNumber";
            }

            if (CustomerID > 0)
            {
                sqlText += " AND CustomerID=@CustomerID";
            }

            // 只查询大于0的库存数据
            if (DY0)
            {
                sqlText += " AND Quantity>0";
            }

            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(sqlText, "Text"));

            if (goodsid > 0)
            {
                command.AddInputParameter("@GoodSID", DbType.String, goodsid);
            }
            if (storageID > 0)
            {
                command.AddInputParameter("@StorageID", DbType.String, storageID);
            }
            if (!string.IsNullOrEmpty(batchNumber))
            {
                command.AddInputParameter("@BatchNumber", DbType.String, batchNumber);
            }

            if (CustomerID > 0)
            {
                command.AddInputParameter("@CustomerID", DbType.String, CustomerID);
            }

            result = command.ExecuteEntityList <InventoryInfo>();
            return(result);
        }
Пример #37
0
        /// <summary>
        /// 获取热门关键信息
        /// </summary>
        public static List <HotSearchKeyword> GetHotSearchKeyword(int pageType, int pageID)
        {
            DataCommand dataCommand = DataCommandManager.GetDataCommand("Content_GetHotSearchKeyword");

            dataCommand.SetParameterValue("@PageType", pageType);
            dataCommand.SetParameterValue("@PageID", pageID);
            List <HotSearchKeyword> entitys = dataCommand.ExecuteEntityList <HotSearchKeyword>();

            return(entitys);
        }
Пример #38
0
 public List<StepSettingModel> GetStepSetting(string itemcode)
 {
     try
     {
         var cmd = new DataCommand("getStepSetting", new SqlCustomDbCommand());
         cmd.SetParameterValue("@ITEMCODE", itemcode);
         return cmd.ExecuteEntityList<StepSettingModel>();
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Пример #39
0
        //        public DataTable GetMenuTree(string username)
        //        {
        //            try
        //            {
        //                string SQL = string.Format(@"select A.ID MenuID,A.MenuName,A.LinkName,A.IconClass,A.ParentID from dbo.TB_MENU A
        //JOIN TB_USERGROUPMENURIGHT B ON A.ID=B.MENUID
        //JOIN TB_USER C ON B.USERGROUPID=C.GROUPS
        //WHERE C.CNAME='{0}'
        //order by A.ID", username);
        //                return SqlHelper.Query(SQL).Tables[0];
        //            }
        //            catch (Exception ex)
        //            {
        //                throw new Exception(ex.Message);
        //            }
        //        }
        public List<MenuModel> GetMenus(string username)
        {
            try
            {

                var cmd = new DataCommand("getMenus", new SqlCustomDbCommand());
                cmd.SetParameterValue("@CNAME", username);
                return cmd.ExecuteEntityList<MenuModel>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Пример #40
0
 public List<Model.Itemcode> GetItemcodeList(string whereStr, string sortStr)
 {
     try
     {
         var cmd = new DataCommand("getItemCode", new SqlCustomDbCommand());
         cmd.ReplaceParameterValue("#whereStr#", whereStr);
         cmd.ReplaceParameterValue("#Sort#", sortStr);
         return cmd.ExecuteEntityList<Model.Itemcode>();
     }
     catch(Exception ee)
     {
         return null;
     }
 }
Пример #41
0
        public List<TB_AreaInfo> GetAreaList(List<int> areaId )
        {
            try
            {
                string strArea = listToString(areaId);
                var cmd = new DataCommand("GetAreaList", new SqlCustomDbCommand());
                cmd.SetParameterValue("@AREAID", strArea);

                return cmd.ExecuteEntityList<TB_AreaInfo>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Пример #42
0
 public List<Model.TS_FEE_DAY> GetFeeDayList(int year, string whereStr)
 {
     try
     {
         var cmd = new DataCommand("getFeeDay", new SqlCustomDbCommand());
         cmd.ReplaceParameterValue("#TableName#", "TS_FEE_DAY_" + year);
         cmd.ReplaceParameterValue("#whereStr#", whereStr);
         List<Model.TS_FEE_DAY> list = cmd.ExecuteEntityList<Model.TS_FEE_DAY>();
         return list;
     }
     catch (Exception ex)
     {
         string message = ex.Message;
     }
     return null;
 }
Пример #43
0
 public List<TB_Alloction_Config> GetAlloctionConfig(Queryfeeapportion feeApport)
 {
     try
     {
         var cmd = new DataCommand("GetAlloctionConfig", new SqlCustomDbCommand());
         cmd.SetParameterValue("@OBJECTID", feeApport.ObjectId);
         cmd.SetParameterValue("@ITEMCODE", feeApport.ItemCode);
         cmd.SetParameterValue("@YEAR", feeApport.StartTime.Year);
         cmd.SetParameterValue("@MONTH", feeApport.StartTime.Month);
         return cmd.ExecuteEntityList<TB_Alloction_Config>();
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Пример #44
0
        /// <summary>
        /// 获取查询的列表
        /// </summary>
        /// <param name="whereStr">查询的条件</param>
        /// <param name="order">排序的方式</param>
        /// <param name="parameters">查询的参数</param>
        /// <returns></returns>
        public List<Model.BaseLayerObject> GetBaseFuncLayerObjectList(string whereStr, string sortStr, string username = "")
        {
            string viewname = "";
            if (!string.IsNullOrEmpty(username))
            {
                viewname = "Becm_FunctionObjectByUser";
                whereStr += string.Format(" and username='******'", username);
            }
            else
            {
                viewname = "getBaseFuncLayerObject";
            }
            var cmd = new DataCommand(viewname, new SqlCustomDbCommand());
            cmd.ReplaceParameterValue("#whereStr#", whereStr);
            cmd.ReplaceParameterValue("#Sort#", sortStr);

            return cmd.ExecuteEntityList<Model.BaseLayerObject>();
        }
Пример #45
0
 public HistoryImport GetResultImportList(HistoryQuery import, int action)
 {
     var result = new HistoryImport { HistoryItem = new List<ResultImport>(), PageInfo = new PageInfo() };
     var cmd = new DataCommand("SearchImportData", new SqlCustomDbCommand());
     var whereStr = new StringBuilder();
     if (import.DeviceId == null || import.DeviceId==0)
     {
         if (!string.IsNullOrEmpty(import.ObjectId.ToString()))
         {
             whereStr.Append(string.Format(" and import.ObjectID={0}", import.ObjectId));
         }
     }
     else
     {
         whereStr.Append(string.Format(" and import.ObjectID={0}", import.DeviceId));
     }
     if (!string.IsNullOrEmpty(import.Starttime.ToString()))
     {
         whereStr.Append(string.Format(" and import.Starttime>='{0}'", import.Starttime));
     }
     if (!string.IsNullOrEmpty(import.Endtime.ToString()))
     {
         whereStr.Append(string.Format(" and import.Starttime<='{0}'", import.Endtime));
     }
     if (!string.IsNullOrEmpty(import.ItemCode))
     {
         whereStr.Append(string.Format(" and import.ItemCode='{0}'", import.ItemCode));
     }
     if (!string.IsNullOrEmpty(import.DateUnit.ToString(CultureInfo.InvariantCulture)))
     {
         whereStr.Append(string.Format(" and import.MonthType={0}", import.DateUnit));
     }
     cmd.SetParameterValue("@action", action);
     cmd.ReplaceParameterValue("#whereStr#", whereStr.ToString());
     cmd.ReplaceParameterValue("#pagesize#",import.PaddingInfo.PageSize.ToString(CultureInfo.InvariantCulture));
     cmd.ReplaceParameterValue("#pagenums#", ((import.PaddingInfo.Page - 1) * import.PaddingInfo.PageSize).ToString(CultureInfo.InvariantCulture));
     result.HistoryItem = cmd.ExecuteEntityList<ResultImport>();
     foreach (var item in result.HistoryItem)
     {
         item.ObjectName = GetObjectName(item.IsArea, item.ObjectId);
     }
     result.PageInfo.Total = (int)cmd.GetParameterValue("@Count");
     return result;
 }
Пример #46
0
        public List<CostQueryModel> GetCostQuery(Queryfeeapportion query, DateTime dtBegin, DateTime dtEnd)
        {
            try
            {
                var cmd = new DataCommand("getCostQuery2", new SqlCustomDbCommand());
                string table = "TS_FEE_DAY_" + query.StartTime.Year;
                cmd.ReplaceParameterValue("#TableName#", table);
                cmd.SetParameterValue("@OBJECTID", query.ObjectId.ToString());
                cmd.SetParameterValue("@ITEMCODE", query.ItemCode);
                cmd.SetParameterValue("@StartTime", dtBegin);
                cmd.SetParameterValue("@EndTime", dtEnd);

                return cmd.ExecuteEntityList<CostQueryModel>();
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Пример #47
0
        public QuotaAnalyseModel GetQuotaAnalyse(string whereStr)
        {
            try
            {
                var cmd = new DataCommand("getQuotaValue", new SqlCustomDbCommand());
                cmd.ReplaceParameterValue("#whereStr#", whereStr);
                //return  cmd.ExecuteEntity<QuotaAnalyseModel>();
                var list = cmd.ExecuteEntityList<QuotaAnalyseModel>();
                if (list.Count > 0)
                {
                    return list[0];
                }
            }
            catch(Exception ee)
            {

            }
            return null;
        }
Пример #48
0
 public List<Model.SysLog> GetSysLogList(string whereStr)
 {
     var cmd = new DataCommand("GetSysLog", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#", whereStr);
     return cmd.ExecuteEntityList<Model.SysLog>();
 }
Пример #49
0
 public List<UserGroupModel> GetUserGroups()
 {
     var cmd = new DataCommand("getUserGroupList", new SqlCustomDbCommand());
     return cmd.ExecuteEntityList<Model.UserGroupModel>();
 }
Пример #50
0
        //        public void AddUserGroup(QueryUserGroup model)
        //        {
        //            try
        //            {
        //                string sql = " select max(id) + 1 from tb_usergroup ";
        //                int MaxID = Convert.ToInt32(SqlHelper.ExecuteScalar(sql));
        //                List<String> sqlList = new List<string>();
        //                List<SqlParameter[]> parasList = new List<SqlParameter[]>();
        //                sql = @"insert into tb_usergroup
        //                            (id,cname,description)
        //                            values
        //                            (@id,@cname,@description)";
        //                SqlParameter[] paras = new SqlParameter[] {
        //                     new SqlParameter("@id",MaxID) ,
        //                    new SqlParameter("@cname", model.UserGroupName),
        //                    new SqlParameter("@description", model.Description)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPMENURIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] {
        //                     new SqlParameter("@id",MaxID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPLIQUIDRIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] {
        //                     new SqlParameter("@id",MaxID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPAREARIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] {
        //                     new SqlParameter("@id",MaxID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                foreach (var menu in model.UserGroupMenuRights)
        //                {
        //                    sql = @"insert into TB_USERGROUPMENURIGHT
        //                        (usergroupid,menuid)
        //                        values
        //                        (@usergroupid,@menuid)";
        //                    paras = new SqlParameter[] {
        //                    new SqlParameter("@usergroupid", MaxID),
        //                    new SqlParameter("@menuid",  menu)};
        //                    sqlList.Add(sql);
        //                    parasList.Add(paras);
        //                }
        //                foreach (var liquid in model.UserGroupLiquidRights)
        //                {
        //                    sql = @"insert into TB_USERGROUPLIQUIDRIGHT
        //                        (usergroupid,areaid)
        //                        values
        //                        (@usergroupid,@areaid)";
        //                    paras = new SqlParameter[] {
        //                    new SqlParameter("@usergroupid", MaxID),
        //                    new SqlParameter("@areaid",  liquid)};
        //                    sqlList.Add(sql);
        //                    parasList.Add(paras);
        //                }
        //                foreach (var area in model.UserGroupAreaRights)
        //                {
        //                    sql = @"insert into TB_USERGROUPAREARIGHT
        //                        (usergroupid,areaid)
        //                        values
        //                        (@usergroupid,@areaid)";
        //                    paras = new SqlParameter[] {
        //                    new SqlParameter("@usergroupid", MaxID),
        //                    new SqlParameter("@areaid",  area)};
        //                    sqlList.Add(sql);
        //                    parasList.Add(paras);
        //                }
        //                SqlHelper.ExecuteSql(sqlList, parasList);
        //            }
        //            catch (Exception ee)
        //            {
        //                throw ee;
        //            }
        //        }
        //        public void UpdateUserGroup(QueryUserGroup model)
        //        {
        //            try
        //            {
        //                List<String> sqlList = new List<string>();
        //                List<SqlParameter[]> parasList = new List<SqlParameter[]>();
        //                string sql = @"update tb_usergroup
        //                                set
        //                                cname=@cname,
        //                                description=@description
        //                                where id=@id";
        //                SqlParameter[] paras = new SqlParameter[] {
        //                    new SqlParameter("@cname", model.UserGroupName),
        //                    new SqlParameter("@description", model.Description),
        //                     new SqlParameter("@id", model.UserGroupID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPMENURIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] {
        //                     new SqlParameter("@id",model.UserGroupID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPLIQUIDRIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] {
        //                     new SqlParameter("@id",model.UserGroupID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPAREARIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] {
        //                     new SqlParameter("@id",model.UserGroupID)
        //                };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                foreach (var menu in model.UserGroupMenuRights)
        //                {
        //                    sql = @"insert into TB_USERGROUPMENURIGHT
        //                        (usergroupid,menuid)
        //                        values
        //                        (@usergroupid,@menuid)";
        //                    paras = new SqlParameter[] {
        //                    new SqlParameter("@usergroupid", model.UserGroupID),
        //                    new SqlParameter("@menuid",  menu)};
        //                    sqlList.Add(sql);
        //                    parasList.Add(paras);
        //                }
        //                foreach (var liquid in model.UserGroupLiquidRights)
        //                {
        //                    sql = @"insert into TB_USERGROUPLIQUIDRIGHT
        //                        (usergroupid,areaid)
        //                        values
        //                        (@usergroupid,@areaid)";
        //                    paras = new SqlParameter[] {
        //                    new SqlParameter("@usergroupid", model.UserGroupID),
        //                    new SqlParameter("@areaid",  liquid)};
        //                    sqlList.Add(sql);
        //                    parasList.Add(paras);
        //                }
        //                foreach (var area in model.UserGroupAreaRights)
        //                {
        //                    sql = @"insert into TB_USERGROUPAREARIGHT
        //                        (usergroupid,areaid)
        //                        values
        //                        (@usergroupid,@areaid)";
        //                    paras = new SqlParameter[] {
        //                    new SqlParameter("@usergroupid", model.UserGroupID),
        //                    new SqlParameter("@areaid",  area)};
        //                    sqlList.Add(sql);
        //                    parasList.Add(paras);
        //                }
        //                SqlHelper.ExecuteSql(sqlList, parasList);
        //            }
        //            catch (Exception ee)
        //            {
        //                throw ee;
        //            }
        //        }
        //        public void DeleteUserGroup(int id)
        //        {
        //            try
        //            {
        //                List<String> sqlList = new List<string>();
        //                List<SqlParameter[]> parasList = new List<SqlParameter[]>();
        //                string sql = @"delete from TB_USERGROUPMENURIGHT where usergroupid=@id";
        //                SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@id",id)};
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPLIQUIDRIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] { new SqlParameter("@id", id) };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from TB_USERGROUPAREARIGHT where usergroupid=@id";
        //                paras = new SqlParameter[] { new SqlParameter("@id", id) };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                sql = @"delete from tb_usergroup where id=@id";
        //                paras = new SqlParameter[] { new SqlParameter("@id", id) };
        //                sqlList.Add(sql);
        //                parasList.Add(paras);
        //                SqlHelper.ExecuteSql(sqlList, parasList);
        //            }
        //            catch (Exception ee)
        //            {
        //                throw ee;
        //            }
        //        }
        public QueryUserGroup GetSingleUserGroup(int usergroupid)
        {
            try
            {

                var cmd = new DataCommand("getSingleUserGroup", new SqlCustomDbCommand());
                cmd.SetParameterValue("@id", usergroupid);
                QueryUserGroup result = cmd.ExecuteEntity<QueryUserGroup>();
                if (result!=null)
                {
                    result.UserGroupMenuRights = new List<int>();
                    result.UserGroupLiquidRights = new List<int>();
                    result.UserGroupAreaRights = new List<int>();

                    cmd = new DataCommand("getMenuRightByUserGroupID", new SqlCustomDbCommand());
                    cmd.SetParameterValue("@id", usergroupid);
                    List<GroupRight> rightlist = cmd.ExecuteEntityList<GroupRight>();
                    foreach (var right in rightlist)
                    {
                        result.UserGroupMenuRights.Add(right.RightID);
                    }

                    cmd = new DataCommand("getLiquidRightByUserGroupID", new SqlCustomDbCommand());
                    cmd.SetParameterValue("@id", usergroupid);
                    rightlist = cmd.ExecuteEntityList<GroupRight>();
                    foreach (var right in rightlist)
                    {
                        result.UserGroupLiquidRights.Add(right.RightID);
                    }
                    cmd = new DataCommand("getAreaRightByUserGroupID", new SqlCustomDbCommand());
                    cmd.SetParameterValue("@id", usergroupid);
                    rightlist = cmd.ExecuteEntityList<GroupRight>();
                    foreach (var right in rightlist)
                    {
                        result.UserGroupAreaRights.Add(right.RightID);
                    }
                }

                return result;

            }
            catch (Exception ee)
            {
                return null;
            }
        }
Пример #51
0
 public List<Model.TB_MULTI_STEP> GetMultiStepListByTypeID(string typeId)
 {
     var cmd = new DataCommand("getMultiStepListByTypeID", new SqlCustomDbCommand());
     cmd.SetParameterValue("@TYPEID", typeId);
     return cmd.ExecuteEntityList<Model.TB_MULTI_STEP>();
 }
Пример #52
0
 /// <summary>
 /// 获取告警触发事件表数据
 /// </summary>
 /// <param name="alarmTypeId">告警类型表ID</param>
 /// <returns>List<Model.TB_AlarmEvent></returns>
 public List<Model.TB_AlarmEvent> GetAlarmEventByAlarmTypeId(int alarmTypeId)
 {
     var cmd = new DataCommand("getAlarmEventByAlarmTypeId", new SqlCustomDbCommand());
     cmd.SetParameterValue("@alarmTypeId", alarmTypeId);
     return cmd.ExecuteEntityList<Model.TB_AlarmEvent>();
 }
Пример #53
0
        public List<UserList> GetUsers()
        {
            var cmd = new DataCommand("getUserList", new SqlCustomDbCommand());

            return cmd.ExecuteEntityList<UserList>();
        }
Пример #54
0
        public List<QueryUserMenu> GetSingleUserMenu(string username)
        {
            try
            {
                var cmd = new DataCommand("getSingleUserMenuList", new SqlCustomDbCommand());
                cmd.SetParameterValue("@name", username);
                return cmd.ExecuteEntityList<QueryUserMenu>();

            }
            catch (Exception ee)
            {
                return null;
            }
        }
Пример #55
0
        /// <summary>
        /// 获取查询的列表
        /// </summary>
        /// <param name="whereStr">查询的条件</param>
        /// <param name="order">排序的方式</param>
        /// <param name="parameters">查询的参数</param>
        /// <returns></returns>
        public List<Model.BaseLayerObject> GetBaseLayerObjectList(string whereStr, string sortStr, string username = "")
        {
            // var cmd = new DataCommand("getBaseLayerObject", new SqlCustomDbCommand());
            //string username = "";
            //try
            //{
            //    //username = HttpContext.Current.Cache["username"].ToString();
            //    username = GetCookie("userid");
            //     username = HttpContext.Current.Session["userid"].ToString() ;

            //    username = NTS.WEB.Common.CacheHelper.GetCache("username").ToString();

            //}
            //catch(Exception ee)
            //{
            //}
            string viewname = "";
            if (!string.IsNullOrEmpty(username))
            {
                viewname = "Becm_LayerObjectByUser";
                whereStr += string.Format(" and username='******'", username);
            }
            else
            {
                viewname = "getBaseLayerObject";
            }
            var cmd = new DataCommand(viewname, new SqlCustomDbCommand());
            cmd.ReplaceParameterValue("#whereStr#", whereStr);
            cmd.ReplaceParameterValue("#Sort#", sortStr);

            //username = HttpContext.Current.Cache["username"].ToString();
            //username = GetCookie("username");
            //if (HttpContext.Current.Session["username"] != null)
            //{
            //    username = HttpContext.Current.Session["username"].ToString();
            //}

            //if (!string.IsNullOrEmpty(username))
            //{
            //    cmd.SetParameterValue("@username", username);
            //}
            //else
            //{
            //    cmd.SetParameterValue("@username", DBNull.Value);
            //}
            return cmd.ExecuteEntityList<Model.BaseLayerObject>();
        }
Пример #56
0
 public List<Model.TB_TIME_PERIOD_SET> GetTimePeroidListByTypeID(string typeId)
 {
     var cmd = new DataCommand("getTimePeroidListByTypeID", new SqlCustomDbCommand());
     cmd.SetParameterValue("@TYPEID", typeId);
     return cmd.ExecuteEntityList<Model.TB_TIME_PERIOD_SET>();
 }
Пример #57
0
 /// <summary>
 /// 根据能源类型和计费方式类型,获取分时 价格 信息
 /// </summary>
 /// <param name="energyCode"></param>
 /// <param name="typeId"></param>
 /// <returns></returns>
 public List<Model.TB_Price_TimeBillExend> GetTimePriceByEnergyCodeType(string energyCode, string typeId)
 {
     var cmd = new DataCommand("getTimePriceByEnergyCodeType", new SqlCustomDbCommand());
     cmd.SetParameterValue("@EnergyCode", energyCode);
     cmd.SetParameterValue("@TypeID", typeId);
     return cmd.ExecuteEntityList<Model.TB_Price_TimeBillExend>();
 }
Пример #58
0
 public List<Model.TE_Alarm_Scale> GetAlarmScaleList()
 {
     var cmd = new DataCommand("getAlarmScaleList", new SqlCustomDbCommand());
     return cmd.ExecuteEntityList<Model.TE_Alarm_Scale>();
 }
Пример #59
0
 /// <summary>
 /// 获取告警类型表所有数据
 /// </summary>
 /// <returns>List<Model.TB_AlarmType></returns>
 public List<Model.TB_AlarmType> GetAlarmTypeList(string whereStr)
 {
     var cmd = new DataCommand("getAlarmTypeList", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#", whereStr);
     return cmd.ExecuteEntityList<Model.TB_AlarmType>();
 }
Пример #60
0
 /// <summary>
 ///  设备关联的液态区域ID列表
 /// </summary>
 /// <param name="itemcode"></param>
 /// <returns></returns>
 public List<DeviceAreaID> GetDeviceAreaID2List(string itemcode)
 {
     string viewname = "";
     viewname = "GetDeviceAreaID2List";
     var cmd = new DataCommand(viewname, new SqlCustomDbCommand());
     if (itemcode == "00000")
     {
         cmd.SetParameterValue("@itemcode", DBNull.Value);
     }
     else
     {
         cmd.SetParameterValue("@itemcode", itemcode);
     }
     return cmd.ExecuteEntityList<DeviceAreaID>();
 }