Beispiel #1
0
          public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<AccountFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();

              if (!string.IsNullOrWhiteSpace(Weight))
            {
                listWhere.Add("Weight=@Weight");
                listPara.Add(new MySqlParameter("Weight", this.Weight));
              }
              if (!string.IsNullOrWhiteSpace(SheepId))
            {
                listWhere.Add("SheepId=@SheepId");
                listPara.Add(new MySqlParameter("SheepId", this.SheepId));

            }
           


    }
Beispiel #2
0
         public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<AccountFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();

            if (!string.IsNullOrWhiteSpace(Id))
            {
                listWhere.Add("a.Id=@Id");
                listPara.Add(new MySqlParameter("Id", this.Id));
            }
            if (!string.IsNullOrWhiteSpace(DisaseId))
            {
                listWhere.Add("a.DisaseId=@DiseaseId");
                listPara.Add(new MySqlParameter("DiseaseId", this.DiseaseId));

            }
            if (!string.IsNullOrWhiteSpace(SymptomId))
            {
                listWhere.Add("a.SymptomId=@SymptomId");
                listPara.Add(new MySqlParameter("SymptomId", this.SymptomId));
            }
    }
Beispiel #3
0
        public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<AccountFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();

             if (!string.IsNullOrWhiteSpace(Name))
            {
                listWhere.Add("Name=@Name");
                listPara.Add(new MySqlParameter("Name", this.Name));

            }

            if (!string.IsNullOrWhiteSpace(Description))
            {
                listWhere.Add("Description=@Description");
                listPara.Add(new MySqlParameter("Description", this.Description));
            }
           

    }
Beispiel #4
0
         public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<AccountFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();
    }
Beispiel #5
0
        public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<DiseaseFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();

            if (!string.IsNullOrWhiteSpace(Id))
            {
                listWhere.Add("a.SicknessId=@SicknessId");
                listPara.Add(new MySqlParameter("SicknessId", this.SicknessId));
            }
    }
          public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<AccountFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();

            if (!string.IsNullOrWhiteSpace(TypeId))
            {
                listWhere.Add("a.TypeId=@TypeId");
                listPara.Add(new MySqlParameter("TypeId", this.TypeId));
            }
            if (!string.IsNullOrWhiteSpace(Pid))
            {
                listWhere.Add("Pid=@Pid");
                listPara.Add(new MySqlParameter("Pid", this.Pid));

            }
 
    }
Beispiel #7
0
         public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty<AccountFilter>(this))
            {
                paras = null;
                return string.Empty;
            }

            List<string> listWhere = new List<string>();
            List<MySqlParameter> listPara = new List<MySqlParameter>();

            if (!string.IsNullOrWhiteSpace(Name))
            {
                listWhere.Add("Name=@Name");
                listPara.Add(new MySqlParameter("Name", this.Name));

            }
             if (!string.IsNullOrWhiteSpace(Administrator))
            {
                listWhere.Add("(Administrator like @Administrator or Administrator like @Administrator)");
                listPara.Add(new MySqlParameter("Administrator", this.Administrator.Wrap("%")));
            }

    }
Beispiel #8
0
        public string ToSqlWhere(out MySqlParameter[] paras)
        {
            if (FilterHelper.IsObjectEmpty <AccountFilter>(this))
            {
                paras = null;
                return(string.Empty);
            }

            List <string>         listWhere = new List <string>();
            List <MySqlParameter> listPara  = new List <MySqlParameter>();

            if (!string.IsNullOrWhiteSpace(SerialNumber))
            {
                listWhere.Add("SerialNumber=@SerialNumber");
                listPara.Add(new MySqlParameter("SerialNumber", this.SerialNumber));
            }
            if (!string.IsNullOrWhiteSpace(GrowthStage))
            {
                listWhere.Add("GrowthStage=@GrowthStage");
                listPara.Add(new MySqlParameter("GrowthStage", this.GrowthStage));
            }
            if (!string.IsNullOrWhiteSpace(Gender))
            {
                listWhere.Add("Gender=@Gender");
                listPara.Add(new MySqlParameter("Gender", this.Gender));
            }

            if (!string.IsNullOrWhiteSpace(SheepfoldId))
            {
                listWhere.Add("SheepfoldId=@SheepfoldId");
                listPara.Add(new MySqlParameter("SheepfoldId", this.SheepfoldId));
            }
            if (!string.IsNullOrWhiteSpace(BirthWeight))
            {
                listWhere.Add("( BirthWeight like @ BirthWeight or  BirthWeight like @ BirthWeight)");
                listPara.Add(new MySqlParameter(" BirthWeight", this.BirthWeight.Wrap("%")));
            }
            if (StartTime != null)
            {
                listWhere.Add("Birthday >= @StartTime");
                listPara.Add(new MySqlParameter("StartTime", this.StartTime));
            }
            if (EndTime != null)
            {
                listWhere.Add("Birthday <= @EndTime");
                listPara.Add(new MySqlParameter("EndTime", this.EndTime));
            }

            if (!string.IsNullOrWhiteSpace(AblactationWeight))
            {
                listWhere.Add("( AblactationWeight like @ AblactationWeight or  AblactationWeight like @ AblactationWeight)");
                listPara.Add(new MySqlParameter(" AblactationWeight", this.AblactationWeight.Wrap("%")));
            }

            if (StartTime != null)
            {
                listWhere.Add("AblactationDate >= @StartTime");
                listPara.Add(new MySqlParameter("StartTime", this.StartTime));
            }
            if (EndTime != null)
            {
                listWhere.Add("AblactationDate <= @EndTime");
                listPara.Add(new MySqlParameter("EndTime", this.EndTime));
            }

            if (!string.IsNullOrWhiteSpace(Origin))
            {
                listWhere.Add("(Origin like @Origin or Origin like @Origin)");
                listPara.Add(new MySqlParameter("Origin", this.Origin.Wrap("%")));
            }

            if (!string.IsNullOrWhiteSpace(FatherId))
            {
                listWhere.Add("FatherId=@FatherId");
                listPara.Add(new MySqlParameter("FatherId", this.FatherId));
            }

            if (!string.IsNullOrWhiteSpace(FatherId))
            {
                listWhere.Add("MotherId=@MotherId");
                listPara.Add(new MySqlParameter("MotherId", this.MotherId));
            }
            paras = listPara.ToArray();
            return(" where " + string.Join(" and ", listWhere));
        }