public bool CheckNameSup(string supName) { string sql = @"SELECT COUNT(*) FROM SUPPLIER WHERE SupName = @SupName"; object[] obj = { "@SupName", supName }; return(Db.GetCount(sql, obj) > 0); }
public bool CheckPhone(string phoneNum) { string sql = @"SELECT COUNT(*) FROM SUPPLIER_PHONE WHERE Phone = @Phone"; object[] obj = { "@Phone", phoneNum }; return(Db.GetCount(sql, obj) > 0); }
public bool CheckNameUnique(string DepName, string ID) { if (ID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM DEPARTMENT WHERE REPLACE(DepName, ' ', '') = @DepName"; object[] obj = { "@DepName", DepName }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM DEPARTMENT WHERE REPLACE(DepName, ' ', '') = @DepName and DepID != @DepID"; object[] obj = { "@DepName", DepName, "@DepID", ID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckUnique(string posName, string ID) { if (ID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM POSITION WHERE REPLACE(PosName, ' ', '') = @PosName"; object[] obj = { "@PosName", posName }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM POSITION WHERE REPLACE(PosName, ' ', '') = @PosName and PosID != @PosID"; object[] obj = { "@PosName", posName, "@PosID", ID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckNameUnique(string tradmarkName, string ID) { if (ID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM TRADEMARK WHERE REPLACE(TrdName, ' ', '') = @TrdName"; object[] obj = { "@TrdName", tradmarkName }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM TRADEMARK WHERE REPLACE(TrdName, ' ', '') = @TrdName and TrdID != @TrdID"; object[] obj = { "@TrdName", tradmarkName, "@TrdID", ID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckNameUnique(string brandName, string BrandID) { if (BrandID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM BRAND WHERE REPLACE(BrandName, ' ', '') = @BrandName"; object[] obj = { "@BrandName", brandName }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM BRAND WHERE REPLACE(BrandName, ' ', '') = @BrandName and BrandID != @BrandID"; object[] obj = { "@BrandName", brandName, "@BrandID", BrandID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckNameUnique(string colorName, string colorID) { if (colorName.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM COLOR WHERE REPLACE(ClrName, ' ', '') = @ClrName"; object[] obj = { "@ClrName", colorName }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM COLOR WHERE REPLACE(ClrName, ' ', '') = @ClrName and ClrID != @ClrID"; object[] obj = { "@ClrName", colorName, "@ClrID", colorID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckNameUnique(string typeproductName, string ID) { if (ID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM TYPEPRODUCT WHERE REPLACE(TypeName, ' ', '') = @TypeName"; object[] obj = { "@TypeName", typeproductName }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM TYPEPRODUCT WHERE REPLACE(TypeName, ' ', '') = @TypeName and TypeProductID != @TypeProductID"; object[] obj = { "@TypeName", typeproductName, "@TypeProductID", ID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckName(string BnkAccNumber, string ID) { if (ID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM BANK WHERE REPLACE(BnkAccNumber, ' ', '') = @BnkAccNumber"; object[] obj = { "@BnkAccNumber", BnkAccNumber }; return(Db.GetCount(sql, obj) > 0); } else { string sql = @"SELECT COUNT(*) FROM BANK WHERE REPLACE(BnkAccNumber, ' ', '') = @BnkAccNumber and BnkAccNumber != @ID"; object[] obj = { "@BnkAccNumber", BnkAccNumber, "@ID", ID }; return(Db.GetCount(sql, obj) > 0); } }
public bool CheckUnique(string roleName, string ID) { if (ID.Equals("CREATE")) { string sql = @"SELECT COUNT(*) FROM _ROLES WHERE REPLACE(ROLENAME, ' ', '') = @RoleName"; object[] obj = { "@RoleName", roleName }; return Db.GetCount(sql, obj) > 0; } else { string sql = @"SELECT COUNT(*) FROM _ROLES WHERE REPLACE(ROLENAME, ' ', '') = @RoleName and RoleID != @RoleID"; object[] obj = { "@RoleName", roleName, "@RoleID", ID }; return Db.GetCount(sql, obj) > 0; } }