Beispiel #1
0
        /// <summary>
        /// 账号是否存在
        /// </summary>
        /// <param name="loginName">账号</param>
        /// <returns></returns>
        public static bool IsExistLoginName(string loginName)
        {
            if (string.IsNullOrEmpty(loginName))
            {
                return(false);
            }

            object count = CommonBusiness.Select("Users", "count(0)", " Status=1 and (LoginName='" + loginName + "'  or BindMobilePhone='" + loginName + "')");

            return(Convert.ToInt32(count) > 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)
 {
     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 + "'"))
     {
         return(EnumResultStatus.Success);
     }
     else
     {
         return(EnumResultStatus.Failed);
     }
 }
Beispiel #3
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);
     }
 }
Beispiel #4
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);
        }
Beispiel #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));
        }
Beispiel #6
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);
        }
        /// <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);
        }