Exemple #1
0
 /// <summary>
 /// 编辑部门状态
 /// </summary>
 /// <param name="departid">部门ID</param>
 /// <param name="status">状态</param>
 /// <param name="operateid">操作人</param>
 /// <param name="operateip">操作IP</param>
 /// <returns></returns>
 public EnumResultStatus UpdateDepartmentStatus(string departid, EnumStatus status, string operateid, string operateip, string agentid)
 {
     if (status == EnumStatus.Delete)
     {
         object count = CommonBusiness.Select("UserDepart", "count(0)", "DepartID='" + departid + "' and Status=1");
         if (Convert.ToInt32(count) > 0)
         {
             return(EnumResultStatus.Exists);
         }
     }
     if (CommonBusiness.Update("Department", "Status", (int)status, "DepartID='" + departid + "' and AgentID='" + agentid + "'"))
     {
         var model = GetDepartments(agentid).Where(d => d.DepartID == departid).FirstOrDefault();
         model.Status = (int)status;
         return(EnumResultStatus.Success);
     }
     else
     {
         return(EnumResultStatus.Failed);
     }
 }
Exemple #2
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);
        }
Exemple #3
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);
        }
Exemple #4
0
 public static bool UpdateCartBatch(string autoid, string batch, string userid)
 {
     return(CommonBusiness.Update("ShoppingCart", "BatchCode", batch, "AutoID=" + autoid));
 }
Exemple #5
0
        public static int GetShoppingCartCount(EnumDocType ordertype, string guid)
        {
            object obj = CommonBusiness.Select("ShoppingCart", "count(0)", "ordertype=" + (int)ordertype + " and [GUID]='" + guid + "'");

            return(Convert.ToInt32(obj));
        }
Exemple #6
0
 public static bool DeleteClient(string clientID)
 {
     return(CommonBusiness.Update("Clients", "Status", 9, " ClientID='" + clientID + "'"));
 }
Exemple #7
0
 /// <summary>
 /// 作废单据
 /// </summary>
 /// <param name="docid"></param>
 /// <param name="userid"></param>
 /// <param name="operateip"></param>
 /// <param name="clientid"></param>
 /// <returns></returns>
 public bool InvalidDoc(string docid, string userid, string operateip, string clientid)
 {
     return(CommonBusiness.Update("StorageDoc", "Status", (int)EnumDocStatus.Invalid, "DocID='" + docid + "' and status=" + (int)EnumDocStatus.Normal));
 }
        /// <summary>
        /// 客户端账号是否存在
        /// </summary>
        /// <param name="loginName">账号</param>
        /// <returns></returns>
        public static bool IsExistLoginName(string loginName)
        {
            object count = CommonBusiness.Select("Users", "count(0)", "LoginName='" + loginName + "'");

            return(Convert.ToInt32(count) > 0);
        }
Exemple #9
0
 public bool UpdateProductDetailsStatus(string productdetailid, EnumStatus status, string operateIP, string operateID)
 {
     return(CommonBusiness.Update("ProductDetail", "Status", (int)status, " ProductDetailID='" + productdetailid + "'"));
 }
Exemple #10
0
 public bool UpdateProductIsNew(string productid, bool isNew, string operateIP, string operateID)
 {
     return(CommonBusiness.Update("Products", "IsNew", isNew ? "1" : "0", " ProductID='" + productid + "'"));
 }
Exemple #11
0
 /// <summary>
 /// 编辑货位状态
 /// </summary>
 /// <param name="id"></param>
 /// <param name="status"></param>
 /// <param name="operateid"></param>
 /// <param name="clientid"></param>
 /// <returns></returns>
 public bool UpdateDepotSeatStatus(string id, EnumStatus status, string operateid, string clientid)
 {
     return(CommonBusiness.Update("DepotSeat", "Status", (int)status, " DepotID='" + id + "'"));
 }
Exemple #12
0
 /// <summary>
 /// 编辑仓库状态
 /// </summary>
 /// <param name="id"></param>
 /// <param name="status"></param>
 /// <param name="operateid"></param>
 /// <param name="clientid"></param>
 /// <returns></returns>
 public bool UpdateWareHouseStatus(string id, EnumStatus status, string operateid, string clientid)
 {
     return(CommonBusiness.Update("WareHouse", "Status", (int)status, " WareID='" + id + "'"));
 }
Exemple #13
0
        public bool DeleteReply(string replyid)
        {
            bool bl = CommonBusiness.Update("CustomerReply", "Status", 9, "ReplyID='" + replyid + "'");

            return(bl);
        }
Exemple #14
0
        public bool DeleteContact(string contactid, string ip, string userid, string agentid)
        {
            bool bl = CommonBusiness.Update("Contact", "Status", 9, "ContactID='" + contactid + "'");

            return(bl);
        }
Exemple #15
0
        /// <summary>
        /// 是否明道网络已注册
        /// </summary>
        /// <param name="projectid"></param>
        /// <returns></returns>
        public static bool IsExistsMDProject(string projectid)
        {
            var count = CommonBusiness.Select("Agents", "count(0)", "MDProjectID='" + projectid + "'");

            return(Convert.ToInt32(count) > 0);
        }
Exemple #16
0
        public bool IsExistProductCode(string code, string clientid)
        {
            object obj = CommonBusiness.Select("Products", " Count(0) ", "ClientID='" + clientid + "' and ProductCode='" + code + "'");

            return(Convert.ToInt32(obj) > 0);
        }
Exemple #17
0
 public bool UpdateProductStatus(string productid, EnumStatus status, string operateIP, string operateID)
 {
     return(CommonBusiness.Update("Products", "Status", ((int)status).ToString(), " ProductID='" + productid + "'"));
 }
Exemple #18
0
 /// <summary>
 /// 删除库别
 /// </summary>
 /// <param name="id">库别ID</param>
 /// <param name="operateid">操作人</param>
 /// <param name="clientid">客户端ID</param>
 /// <returns></returns>
 public bool DeleteWarehouseType(string id, string operateid, string clientid)
 {
     return(CommonBusiness.Update("WareHouseType", "Status", (int)CloudSalesEnum.EnumStatus.Delete, " TypeID='" + id + "'"));
 }
Exemple #19
0
 public bool UpdateProductIsRecommend(string productid, bool isRecommend, string operateIP, string operateID)
 {
     return(CommonBusiness.Update("Products", "IsRecommend", isRecommend ? "1" : "0", " ProductID='" + productid + "'"));
 }
Exemple #20
0
 /// <summary>
 /// 编辑购物车产品数量
 /// </summary>
 /// <param name="autoid"></param>
 /// <param name="quantity"></param>
 /// <returns></returns>
 public static bool UpdateCartQuantity(string autoid, int quantity, string userid, string clientid)
 {
     return(CommonBusiness.Update("ShoppingCart", "Quantity", quantity, "AutoID=" + autoid));
 }
Exemple #21
0
 public bool UpdateProviderStatus(string providerid, EnumStatus status, string ip, string operateid)
 {
     return(CommonBusiness.Update("Providers", "Status", (int)status, "ProviderID='" + providerid + "'"));
 }
Exemple #22
0
 /// <summary>
 /// 删除购物车记录
 /// </summary>
 /// <param name="autoid"></param>
 /// <param name="userid"></param>
 /// <param name="clientid"></param>
 /// <returns></returns>
 public static bool DeleteCart(string autoid, string userid, string clientid)
 {
     return(CommonBusiness.Delete("ShoppingCart", "AutoID=" + autoid));
 }