예제 #1
0
파일: LogBusiness.cs 프로젝트: GitMr/YXERP
        /// <summary>
        /// 获取日志
        /// </summary>
        /// <returns></returns>
        public static List <LogEntity> GetLogs(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid)
        {
            string tablename = "";

            switch (type)
            {
            case EnumLogObjectType.Customer:
                tablename = "CustomerLog";
                break;

            case EnumLogObjectType.Orders:
                tablename = "OrdersLog";
                break;
            }

            DataTable dt = CommonBusiness.GetPagerData(tablename, "*", "LogGUID='" + guid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List <LogEntity> list = new List <LogEntity>();

            foreach (DataRow dr in dt.Rows)
            {
                LogEntity model = new LogEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);

                list.Add(model);
            }
            return(list);
        }
예제 #2
0
        public static List <ClientAuthorizeLog> GetClientAuthorizeLogs(string clientID, string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            DataTable dt = CommonBusiness.GetPagerData("ClientAuthorizeLog", "*", " Status<>9 and ClientID='" + clientID + "' ", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <ClientAuthorizeLog> list = new List <ClientAuthorizeLog>();
            ClientAuthorizeLog        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new ClientAuthorizeLog();
                model.FillData(item);
                list.Add(model);
            }

            return(list);
        }
예제 #3
0
        public static List <StorageDocAction> GetStorageDocAction(string docid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid)
        {
            DataTable dt = CommonBusiness.GetPagerData("StorageDocAction", "*", "DocID='" + docid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List <StorageDocAction> list = new List <StorageDocAction>();

            foreach (DataRow dr in dt.Rows)
            {
                StorageDocAction model = new StorageDocAction();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid);

                list.Add(model);
            }
            return(list);
        }
예제 #4
0
        public List <OrderEntity> GetOpportunityaByCustomerID(string customerid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid)
        {
            List <OrderEntity> list = new List <OrderEntity>();
            DataTable          dt   = CommonBusiness.GetPagerData("Orders", "*", "CustomerID='" + customerid + "' and Status =0 ", "AutoID", pageSize, pageIndex, out totalCount, out pageCount, false);

            foreach (DataRow dr in dt.Rows)
            {
                OrderEntity model = new OrderEntity();
                model.FillData(dr);
                model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID);
                model.Stage = SystemBusiness.BaseBusiness.GetOpportunityStageByID(model.StageID, model.AgentID, model.ClientID);

                list.Add(model);
            }
            return(list);
        }
예제 #5
0
        /// <summary>
        /// 获取客户端列表
        /// </summary>
        /// <param name="keyWords"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public static List <Clients> GetClients(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            DataTable      dt   = CommonBusiness.GetPagerData("Clients", "*", "Status<>9", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <Clients> list = new List <Clients>();
            Clients        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new Clients();
                model.FillData(item);
                model.City           = CommonCache.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                model.IndustryEntity = IndustryBusiness.GetIndustryByClientID(AppSettings.Settings[AppSettingsWEB.Manage, "ClientID"]).Where(i => i.IndustryID.ToLower() == model.Industry.ToLower()).FirstOrDefault();
                list.Add(model);
            }

            return(list);
        }
예제 #6
0
        public List <ProvidersEntity> GetProviders(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID)
        {
            var dal = new StockDAL();

            string where = " ClientID='" + clientID + "' and Status<>9";

            DataTable dt = CommonBusiness.GetPagerData("Providers", "*", where, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List <ProvidersEntity> list = new List <ProvidersEntity>();

            foreach (DataRow dr in dt.Rows)
            {
                ProvidersEntity model = new ProvidersEntity();
                model.FillData(dr);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                list.Add(model);
            }
            return(list);
        }
예제 #7
0
        public List <CustomerEntity> GetCustomersByActivityID(string activityid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            List <CustomerEntity> list = new List <CustomerEntity>();
            string sqlWhere            = " ActivityID='" + activityid + "' and status<>9";

            DataTable dt = CommonBusiness.GetPagerData("Customer", "*", sqlWhere, "CustomerID", pageSize, pageIndex, out totalCount, out pageCount);

            foreach (DataRow dr in dt.Rows)
            {
                CustomerEntity model = new CustomerEntity();
                model.FillData(dr);

                model.Owner  = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID);
                model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID);
                model.Stage  = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID);
                list.Add(model);
            }
            return(list);
        }
예제 #8
0
        public static List <ReplyEntity> GetReplys(string guid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            List <ReplyEntity> list     = new List <ReplyEntity>();
            string             whereSql = " Status<>9 and GUID='" + guid + "' ";
            DataTable          dt       = CommonBusiness.GetPagerData("CustomerReply", "*", whereSql, "AutoID", "CreateTime desc ", pageSize, pageIndex, out totalCount, out pageCount, false);

            foreach (DataRow dr in dt.Rows)
            {
                ReplyEntity model = new ReplyEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);
                if (!string.IsNullOrEmpty(model.FromReplyID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }
                list.Add(model);
            }

            return(list);
        }
예제 #9
0
        /// <summary>
        /// 获取客户端列表
        /// </summary>
        /// <param name="keyWords"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public static List <Clients> GetClients(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string whereSql = "Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and ( CompanyName like '%" + keyWords + "%'  or  MobilePhone like '%" + keyWords + "%')";
            }
            DataTable      dt   = CommonBusiness.GetPagerData("Clients", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <Clients> list = new List <Clients>();
            Clients        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new Clients();
                model.FillData(item);
                model.City           = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                model.IndustryEntity = Manage.IndustryBusiness.GetIndustrys().Where(i => i.IndustryID.ToLower() == model.Industry.ToLower()).FirstOrDefault();
                list.Add(model);
            }

            return(list);
        }
예제 #10
0
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="keyWords"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public static List <Users> GetUsers(string keyWords, string departID, string roleID, string agentid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            string whereSql = "AgentID='" + agentid + "' and Status<>9";

            if (!string.IsNullOrEmpty(keyWords))
            {
                whereSql += " and ( Name like '%" + keyWords + "%' or MobilePhone like '%" + keyWords + "%' or Email like '%" + keyWords + "%')";
            }

            if (!string.IsNullOrEmpty(departID))
            {
                whereSql += " and DepartID='" + departID + "'";
            }

            if (!string.IsNullOrEmpty(roleID))
            {
                whereSql += " and RoleID='" + roleID + "'";
            }

            DataTable    dt   = CommonBusiness.GetPagerData("Users", "*", whereSql, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);
            List <Users> list = new List <Users>();
            Users        model;

            foreach (DataRow item in dt.Rows)
            {
                model = new Users();
                model.FillData(item);

                model.CreateUser = GetUserByUserID(model.CreateUserID, model.AgentID);
                model.Department = GetDepartmentByID(model.DepartID, model.AgentID);
                model.Role       = GetRoleByIDCache(model.RoleID, model.AgentID);

                list.Add(model);
            }

            return(list);
        }