Exemple #1
0
        public static CustomerLoginData GetUserById(int userid)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Customer_GetUserById");

            cmd.SetParameterValue("@UserID", userid);
            return(cmd.ExecuteEntity <CustomerLoginData>());
        }
Exemple #2
0
        /// <summary>
        /// 根据商品SysNo获取商品批号和历史备注
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        public static ProductBatchManagementInfo GetProductBatchManagementInfo(int productSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetProductBatchManagementInfo");

            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            var result = cmd.ExecuteEntity <ProductBatchManagementInfo>();

            if (result != null)
            {
                result.Logs = GetProductBatchManagementLogByBatchManagementSysNo(result.SysNo.Value);
                foreach (var item in result.Logs)
                {
                    result.Notes += item.InDate.ToString() + "," + item.InUser + "," + item.Note;
                }
            }
            else
            {
                result = new ProductBatchManagementInfo();
                result.ProductSysNo     = productSysNo;
                result.IsBatch          = false;
                result.IsCollectBatchNo = false;
                result.CollectType      = 0;
            }
            return(result);
        }
Exemple #3
0
        public ConsignAdjustInfo Delete(int sysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("DeleteConsignAdjust");

            command.SetParameterValue("@SysNo", sysNo);
            return(command.ExecuteEntity <ConsignAdjustInfo>());
        }
Exemple #4
0
        /// <summary>
        /// 根据渠道仓库编号获取渠道仓库信息
        /// </summary>
        /// <param name="stockSysNo"></param>
        /// <returns></returns>
        public virtual StockInfo GetStockInfoByStockID(string stockID)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("Inventory_GetStockInfoByID");

            dc.SetParameterValue("@StockID", stockID);
            return(dc.ExecuteEntity <StockInfo>());
        }
Exemple #5
0
        public virtual BizEntity.Customer.AccountPeriodInfo GetAccountPeriodInfoByCustomerSysNo(int customerSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetCustomerAccountPeriodInfo");

            cmd.SetParameterValue("@CustomerSysNo", customerSysNo);
            return(cmd.ExecuteEntity <AccountPeriodInfo>());
        }
Exemple #6
0
        public OrderInfo GetOrderInfoByID(string orderId)
        {
            DataCommand command = new DataCommand(ConnectionString, GetDbCommand(OrderStatement.GetOrderByID, "Text"));

            command.AddInputParameter("@OrderID", DbType.String, orderId);
            return(command.ExecuteEntity <OrderInfo>());
        }
Exemple #7
0
        public virtual StockInfo GetStockInfoBySysNo(int stockSysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("Inventory_GetStockInfoBySysNo");

            dc.SetParameterValue("@SysNo", stockSysNo);
            return(dc.ExecuteEntity <StockInfo>());
        }
Exemple #8
0
        /// <summary>
        /// 获取指定类别编码的商家前台类别
        /// </summary>
        /// <param name="categoryCode">类别编码</param>
        /// <returns></returns>
        public static FrontProductCategoryInfo GetFrontProductCategoryByCode(string categoryCode)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetFrontProductCategoryByCode");

            cmd.SetParameterValue("@CategoryCode", categoryCode);
            return(cmd.ExecuteEntity <FrontProductCategoryInfo>());
        }
Exemple #9
0
        /// <summary>
        /// 加载配送方式信息
        /// </summary>
        /// <param name="sysNo"></param>
        /// <returns></returns>
        public static ShipTypeInfo LoadShipType(int sysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("LoadShipType");

            dc.SetParameterValue(@"SysNo", sysNo);
            return(dc.ExecuteEntity <ShipTypeInfo>());
        }
Exemple #10
0
        public Model.TB_PAR_VALUE_SET GetParValueByTypeID(string typeId)
        {
            var cmd = new DataCommand("getParValueByTypeID", new SqlCustomDbCommand());

            cmd.SetParameterValue("@TYPEID", typeId);
            return(cmd.ExecuteEntity <Model.TB_PAR_VALUE_SET>());
        }
Exemple #11
0
        /// <summary>
        /// 根据能源类型获取平价信息
        /// </summary>
        /// <param name="energyType"></param>
        /// <returns></returns>
        public Model.TB_Price_CommBill GetCommPriceByEnergyCode(string energyCode)
        {
            var cmd = new DataCommand("getCommPriceByEnergyCode", new SqlCustomDbCommand());

            cmd.SetParameterValue("@EnergyCode", energyCode);
            return(cmd.ExecuteEntity <Model.TB_Price_CommBill>());
        }
Exemple #12
0
        /// <summary>
        /// 获取商品基础信息
        /// </summary>
        /// <param name="productGroupSysNo">商品组编号</param>
        /// <returns></returns>
        public static ProductMaintainBasicInfo GetProductBasicInfoByProductGroupSysNo(int productGroupSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetProductBasicInfoByProductGroupSysNo");

            cmd.SetParameterValue("@ProductGroupSysNo", productGroupSysNo);
            return(cmd.ExecuteEntity <ProductMaintainBasicInfo>());
        }
Exemple #13
0
        /// <summary>
        /// 根据商品编号得到其所属产品线
        /// </summary>
        /// <param name="sysNo"></param>
        /// <returns></returns>
        public virtual ConvertRequestInfo GetProductLineInfo(int productSysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("Inventory_GetConvertProductLineInfoByProductSysNo");

            dc.SetParameterValue("@ProductSysNo", productSysNo);
            return(dc.ExecuteEntity <ConvertRequestInfo>());
        }
Exemple #14
0
        /// <summary>
        /// 获取告警触发事件
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public Model.TB_AlarmEvent GetAlarmEventById(int Id)
        {
            var cmd = new DataCommand("getAlarmEventById", new SqlCustomDbCommand());
            cmd.SetParameterValue("@Id", Id);

            return cmd.ExecuteEntity<Model.TB_AlarmEvent>();
        }
Exemple #15
0
        /// <summary>
        /// 获取单个商品维护信息
        /// </summary>
        /// <param name="productSysNo">商品编号</param>
        /// <returns></returns>
        public static ProductMaintainInfo GetSingleProductMaintainInfo(int productSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetSingleProductMaintainInfo");

            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            return(cmd.ExecuteEntity <ProductMaintainInfo>());
        }
Exemple #16
0
        /// <summary>
        /// 根据SysNo获取商品[ProductID]和[ProductTitle]
        /// </summary>
        /// <param name="productSysNo"></param>
        /// <returns></returns>
        public static ProductQueryInfo GetProductTitleByProductSysNo(int productSysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetProductTitleInfo");

            cmd.SetParameterValue("@ProductSysNo", productSysNo);
            return(cmd.ExecuteEntity <ProductQueryInfo>());
        }
Exemple #17
0
        public static CustomerIDEntry AddCustomer(RequestOperation <CustomerLawyerData> request)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Customer_AddCustomer");

            cmd.SetParameterValue("@Name", request.Body.Name);
            cmd.SetParameterValue("@NickName", request.Body.NickName);
            cmd.SetParameterValue("@Face", request.Body.Face);
            cmd.SetParameterValue("@Sex", request.Body.Sex);
            cmd.SetParameterValue("@BirthDay", request.Body.BirthDay);
            cmd.SetParameterValue("@Mobile", request.Body.Mobile);
            cmd.SetParameterValue("@WexinNo", request.Body.WexinNo);
            cmd.SetParameterValue("@WexinQrcode", request.Body.WexinQrcode);
            cmd.SetParameterValue("@QQNo", request.Body.QQNo);
            cmd.SetParameterValue("@Email", request.Body.Email);
            cmd.SetParameterValue("@HomeTownCode", request.Body.HomeTownCode);
            cmd.SetParameterValue("@HomeTown", request.Body.HomeTown);
            cmd.SetParameterValue("@PCDCode", request.Body.PCDCode);
            cmd.SetParameterValue("@PCDDesc", request.Body.PCDDesc);
            cmd.SetParameterValue("@Address", request.Body.Address);
            cmd.SetParameterValue("@Job", request.Body.Job);
            cmd.SetParameterValue("@Company", request.Body.Company);
            cmd.SetParameterValue("@Signature", request.Body.Signature);
            cmd.SetParameterValue("@CustomerType", request.Body.CustomerType);
            cmd.SetParameterValue("@AuditStatus", request.Body.AuditStatus);
            cmd.SetParameterValue("@Skills", request.Body.Skills);
            cmd.SetParameterValue("@CaseSeries", request.Body.CaseSeries);
            cmd.SetParameterValue("@Resume", request.Body.Resume);
            cmd.SetParameterValue("@Subscribe", request.Body.Subscribe);
            cmd.SetParameterValue("@InUser", request.Header.DisplayName);
            return(cmd.ExecuteEntity <CustomerIDEntry>());
        }
Exemple #18
0
        public BizEntity.PO.VendorRefundInfo LoadVendorRefundInfo(int vendorRefundSysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetVendorRefundMasterBySysNo");

            command.SetParameterValue("@SysNo", vendorRefundSysNo);
            return(command.ExecuteEntity <VendorRefundInfo>());
        }
Exemple #19
0
        public static CustomerLoginData Register(RequestOperation <CustomerRegisterData> request)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Customer_Register");

            cmd.SetParameterValue("@Account", request.Body.Login.Account);
            cmd.SetParameterValue("@Email", request.Body.Login.Email);
            cmd.SetParameterValue("@Password", request.Body.Login.Password);
            cmd.SetParameterValue("@QQAccount", request.Body.Login.QQAccount);
            cmd.SetParameterValue("@WechatAccount", request.Body.Login.WechatAccount);
            cmd.SetParameterValue("@WeiboAccount", request.Body.Login.WeiboAccount);
            cmd.SetParameterValue("@BaiduAccount", request.Body.Login.BaiduAccount);
            cmd.SetParameterValue("@UserRoleID", request.Body.Login.UserRoleID);
            cmd.SetParameterValue("@UserFrom", request.Body.Login.UserFrom);
            cmd.SetParameterValue("@UserStatus", request.Body.Login.UserStatus);

            cmd.SetParameterValue("@Name", request.Body.Customer.Name);
            cmd.SetParameterValue("@NickName", request.Body.Customer.NickName);
            cmd.SetParameterValue("@Face", request.Body.Customer.Face);
            cmd.SetParameterValue("@Sex", request.Body.Customer.Sex);
            cmd.SetParameterValue("@BirthDay", request.Body.Customer.BirthDay);
            cmd.SetParameterValue("@Mobile", request.Body.Customer.Mobile);
            cmd.SetParameterValue("@CustomerType", request.Body.Customer.CustomerType);
            cmd.SetParameterValue("@AuditStatus", request.Body.Customer.AuditStatus);
            cmd.SetParameterValue("@InUser", request.Header.DisplayName);
            return(cmd.ExecuteEntity <CustomerLoginData>());
        }
Exemple #20
0
        public static CustomerLoginData LoginByWechatAccount(RequestOperation <string> request)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("Customer_LoginByWechatAccount");

            cmd.SetParameterValue("@WechatAccount", request.Body);
            return(cmd.ExecuteEntity <CustomerLoginData>());
        }
Exemple #21
0
        /// <summary>
        /// 根据Id获取活动数据
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>返回用户数据</returns>
        public static RoleEntity GetById(int id)
        {
            var cmd = new DataCommand("Role.GetById");

            cmd.SetParameter("@Id", DbType.Int32, id);
            return(cmd.ExecuteEntity <RoleEntity>());
        }
Exemple #22
0
        public Model.TB_UserGroup GetUserGroupInfo(int userGroupId)
        {
            var cmd = new DataCommand("GetUserGroupInfo", new SqlCustomDbCommand());

            cmd.SetParameterValue("@Id", userGroupId);
            return(cmd.ExecuteEntity <Model.TB_UserGroup>());
        }
Exemple #23
0
        /// <summary>
        /// 根据权限编号获取有效权限
        /// </summary>
        /// <param name="functionKey">权限编号</param>
        /// <returns></returns>
        public static Functions GetValidFunctionsBySysNo(int sysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetValidFunctionsBySysNo");

            cmd.SetParameterValue("@SysNo", sysNo);
            return(cmd.ExecuteEntity <Functions>());
        }
Exemple #24
0
        public NewsInfo Load(int sysNo)
        {
            DataCommand dc = DataCommandManager.GetDataCommand("News_Load");

            dc.SetParameterValue("@SystemNumber", sysNo);
            return(dc.ExecuteEntity <NewsInfo>());
        }
Exemple #25
0
        /// <summary>
        /// 加载发票信息
        /// </summary>
        /// <param name="invoiceSysNo"></param>
        /// <returns></returns>
        public InvoiceInfo LoadBySysNo(int invoiceSysNo)
        {
            InvoiceMasterInfo             masterInfo      = null;
            List <InvoiceTransactionInfo> transactionList = null;

            //加载Master信息
            DataCommand dataCommand = DataCommandManager.GetDataCommand("GetInvoiceMasterBySysNo");

            dataCommand.SetParameterValue("@InvoiceNumber", invoiceSysNo);
            masterInfo = dataCommand.ExecuteEntity <InvoiceMasterInfo>();

            //加载Transaction列表
            dataCommand = DataCommandManager.GetDataCommand("GetInvoiceTransactionListByMasterSysNo");
            dataCommand.SetParameterValue("@MasterInvoiceNumber", masterInfo.SysNo);
            transactionList = dataCommand.ExecuteEntityList <InvoiceTransactionInfo>();

            InvoiceInfo invoice = new InvoiceInfo()
            {
                SysNo      = masterInfo.SysNo,
                MasterInfo = masterInfo,
                InvoiceTransactionInfoList = transactionList,
                CompanyCode = masterInfo.CompanyCode
            };

            return(invoice);
        }
Exemple #26
0
        /// <summary>
        /// 加载仓库信息
        /// </summary>
        /// <param name="sysNo"></param>
        /// <returns></returns>
        public static StockInfo LoadStock(int sysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("LoadStock");

            command.SetParameterValue("@SysNo", sysNo);
            return(command.ExecuteEntity <StockInfo>());
        }
Exemple #27
0
        public static StockShipTypeInfo GetStockShipTypeInfo(int sysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("GetStockShipTypeInfo");

            command.SetParameterValue("@SysNo", sysNo);
            return(command.ExecuteEntity <StockShipTypeInfo>());
        }
Exemple #28
0
        public RmaPolicyInfo GetStandardRmaPolicy()
        {
            DataCommand   cmd  = DataCommandManager.GetDataCommand("GetStandardRmaPolicy");
            RmaPolicyInfo info = cmd.ExecuteEntity <RmaPolicyInfo>();

            return(info);
        }
Exemple #29
0
        public static DocumentValid LoadUserTagValid(string name)
        {
            DataCommand cmd = new DataCommand("MockTest.LoadUserTag");

            cmd.SetParameter("@name", DbType.String, name);
            return(cmd.ExecuteEntity <DocumentValid>());
        }
Exemple #30
0
        public OPCOfflineInfo GetOPCOfflineBySysNo(int sysNo)
        {
            DataCommand command = DataCommandManager.GetDataCommand("SO_Get_OPCOfflineMaster");

            command.SetParameterValue("@SysNo", sysNo);
            return(command.ExecuteEntity <OPCOfflineInfo>());
        }
Exemple #31
0
        public static NewsInfo GetNewsInfo(int SysNo)
        {
            DataCommand cmd = DataCommandManager.GetDataCommand("GetNewsInfo");

            cmd.SetParameterValue("@SysNo", SysNo);
            return(cmd.ExecuteEntity <NewsInfo>());
        }
Exemple #32
0
 public Model.TB_BECM_COUNTTYPE GetCountType(string energyId)
 {
     try
     {
         var cmd = new DataCommand("getCountType", new SqlCustomDbCommand());
         cmd.SetParameterValue("@energyId", energyId);
         return cmd.ExecuteEntity<Model.TB_BECM_COUNTTYPE>();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Exemple #33
0
 public TB_AreaInfo GetAreaInfo(int areaId)
 {
     try
     {
         var cmd = new DataCommand("GetAreaInfo", new SqlCustomDbCommand());
         cmd.SetParameterValue("@ID", areaId);
         return cmd.ExecuteEntity<TB_AreaInfo>();
     }
     catch (Exception ee)
     {
         throw ee;
     }
 }
Exemple #34
0
 public Model.TB_User GetUserInfo(int userId)
 {
     var cmd = new DataCommand("GetUserInfo", new SqlCustomDbCommand());
     cmd.SetParameterValue("@Id", userId);
     return cmd.ExecuteEntity<Model.TB_User>();
 }
Exemple #35
0
 /// <summary>
 /// 根据用户名获取用户的对象
 /// </summary>
 /// <param name="username"></param>
 /// <returns></returns>
 public Model.Account GetAccount(string username)
 {
     var cmd = new DataCommand("getaccount", new SqlCustomDbCommand());
     cmd.SetParameterValue("@username",username);
     return cmd.ExecuteEntity<Model.Account>();
 }
Exemple #36
0
        //        public void AddUser(QueryUser model)
        //        {
        //            try
        //            {
        //                string sql = " select max(id) + 1 from tb_user ";
        //                int MaxID = Convert.ToInt32(SqlHelper.ExecuteScalar(sql));
        //                sql = @"insert into tb_user
        //                            (id,cname,password,status,groups)
        //                            values
        //                            (@id,@cname,@password,@status,@groups)";
        //                SqlParameter[] paras = new SqlParameter[] {
        //                    new SqlParameter("@cname", model.UserName),
        //                    new SqlParameter("@password", model.Password),
        //                    new SqlParameter("@status", model.Status),
        //                    new SqlParameter("@groups", model.GroupId) ,
        //                     new SqlParameter("@id", MaxID)
        //                };
        //                SqlHelper.ExecuteSql(sql, paras);
        //            }
        //            catch (Exception ee)
        //            {
        //                throw ee;
        //            }
        //        }
        //        public void UpdateUser(QueryUser model)
        //        {
        //            try
        //            {
        //                string sql = @"update tb_user
        //                                set
        //                                cname=@cname,
        //                                password=@password,
        //                                status=@status,
        //                                groups=@groups
        //                                where id=@id";
        //                SqlParameter[] paras = new SqlParameter[] {
        //                    new SqlParameter("@cname", model.UserName),
        //                    new SqlParameter("@password", model.Password),
        //                    new SqlParameter("@status", model.Status),
        //                    new SqlParameter("@groups", model.GroupId),
        //                     new SqlParameter("@id", model.UserID)
        //                };
        //                SqlHelper.ExecuteSql(sql, paras);
        //            }
        //            catch (Exception ee)
        //            {
        //                throw ee;
        //            }
        //        }
        //        public void DeleteUser(int id)
        //        {
        //            try
        //            {
        //                string sql = @"delete from tb_user
        //                                where id=@id";
        //                SqlParameter[] paras = new SqlParameter[] {
        //                     new SqlParameter("@id", id)
        //                };
        //                SqlHelper.ExecuteSql(sql, paras);
        //            }
        //            catch (Exception ee)
        //            {
        //                throw ee;
        //            }
        //        }
        //public bool IsExistUserName(QueryUser model)
        //{
        //    string sql = "select id from tb_user where cname=@cname";
        //    SqlParameter[] paras = new SqlParameter[] {
        //            new SqlParameter("@cname", model.UserName)
        //        };
        //    if (model.UserID > 0)
        //    {
        //        int id = Convert.ToInt32(SqlHelper.ExecuteScalar(sql, paras));
        //        if (id > 0 && id != model.UserID)
        //        {
        //            return true;
        //        }
        //        else
        //        {
        //            return false;
        //        }
        //    }
        //    else
        //    {
        //        return Convert.ToInt32(SqlHelper.ExecuteScalar(sql, paras)) > 0 ? true : false;
        //    }
        //}
        public QueryUser GetSingleUser(int userid)
        {
            try
            {
                var cmd = new DataCommand("getSingleUser", new SqlCustomDbCommand());
                cmd.SetParameterValue("@id", userid);
              //  List<QueryUser> list = cmd.ExecuteEntityList<QueryUser>();
                return cmd.ExecuteEntity<QueryUser>();

            }
            catch(Exception ee)
            {
                return null;
            }
        }
Exemple #37
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;
            }
        }
Exemple #38
0
 public Model.TB_Ems_Quota_Percent GetQuotaAlarm(string whereStr)
 {
     var cmd = new DataCommand("GetQuotaAlarmList", new SqlCustomDbCommand());
     cmd.ReplaceParameterValue("#whereStr#", whereStr);
     return cmd.ExecuteEntity<Model.TB_Ems_Quota_Percent>();
 }
Exemple #39
0
 /// <summary>
 /// 根据能源类型获取平价信息
 /// </summary>
 /// <param name="energyType"></param>
 /// <returns></returns>
 public Model.TB_Price_CommBill GetCommPriceByEnergyCode(string energyCode)
 {
     var cmd = new DataCommand("getCommPriceByEnergyCode", new SqlCustomDbCommand());
     cmd.SetParameterValue("@EnergyCode", energyCode);
     return cmd.ExecuteEntity<Model.TB_Price_CommBill>();
 }
Exemple #40
0
 public Model.TB_PAR_VALUE_SET GetParValueByTypeID(string typeId)
 {
     var cmd = new DataCommand("getParValueByTypeID", new SqlCustomDbCommand());
     cmd.SetParameterValue("@TYPEID", typeId);
     return cmd.ExecuteEntity<Model.TB_PAR_VALUE_SET>();
 }