public static bool IsExistAccountType(EnumAccountType type, string userid) { string where = " UserID='" + userid + "' and AccountType =" + (int)type; object count = CommonBusiness.Select("UserAccounts", "count(0)", where); return(Convert.ToInt32(count) > 0); }
public static bool ConfirmLoginPwd(string userid, string loginname, string pwd) { pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd, loginname); object obj = CommonBusiness.Select("Users", "Count(0)", " UserID='" + userid + "' and LoginPWD='" + pwd + "' "); return(Convert.ToInt32(obj) > 0); }
public static bool IsExistLoginName(string loginName) { if (string.IsNullOrEmpty(loginName)) { return(false); } object count = CommonBusiness.Select("UserAccounts", "count(0)", " AccountName='" + loginName + "' and AccountType in(1,2) "); return(Convert.ToInt32(count) > 0); }
public static int GetShoppingCartCount(EnumDocType ordertype, string guid) { if (ordertype == EnumDocType.Order) { object obj = CommonBusiness.Select("OrderDetail", "count(0)", "[OrderID]='" + guid + "'"); return(Convert.ToInt32(obj)); } else { object obj = CommonBusiness.Select("ShoppingCart", "count(0)", "ordertype=" + (int)ordertype + " and [GUID]='" + guid + "'"); return(Convert.ToInt32(obj)); } }
public static bool IsExistOtherAccount(EnumAccountType type, string account, string companyid) { if (string.IsNullOrEmpty(account)) { return(false); } string where = " AccountName='" + account + "' and AccountType =" + (int)type; object count = CommonBusiness.Select("UserAccounts", "count(0)", where); return(Convert.ToInt32(count) > 0); }
public EnumResultStatus UpdateDepartmentStatus(string departid, EnumStatus status, string operateid, string operateip, string clientid) { if (status == EnumStatus.Delete) { object count = CommonBusiness.Select("Users", "count(0)", "DepartID='" + departid + "' and Status=1"); if (Convert.ToInt32(count) > 0) { return(EnumResultStatus.Exists); } } if (CommonBusiness.Update("Department", "Status", (int)status, "DepartID='" + departid + "'")) { var model = GetDepartments(clientid).Where(d => d.DepartID == departid).FirstOrDefault(); model.Status = (int)status; return(EnumResultStatus.Success); } else { return(EnumResultStatus.Failed); } }
public bool IsExistProductCode(string code, string clientid) { object obj = CommonBusiness.Select("Products", " Count(0) ", "ClientID='" + clientid + "' and ProductCode='" + code + "'"); return(Convert.ToInt32(obj) > 0); }