示例#1
0
        public void UpdateSheep(string breedId, GenderEnum gender, GrowthStageEnum growthStage, OriginEnum origin, float?birthWeight, int compatriotNumber, DateTime?birthDay, float?ablactationWeight, DateTime?ablactationDate, string fatherId, string motherId, string sheepfoldId, SheepStatusEnum sheepStatusEnum, string principalId, string remark, string id)
        {
            string sql = "update \"T_Sheep\"  set \"BreedId\"=:breedId,\"Gender\"=:gender,\"GrowthStage\"=:growthStage,\"SheepfoldId\"=:sheepfoldId,\"BirthWeight\"=:birthWeight,\"CompatriotNumber\"=:compatriotNumber,\"Birthday\"=:birthday,\"Origin\"=:origin, \"AblactationWeight\"=:ablactationWeight,\"AblactationDate\"=:ablactationDate,\"FatherId\"=:fatherId,\"MotherId\"=:motherId,\"Status\"=:status,\"PrincipalId\"=:principalId,\"Remark\"=:remark where \"Id\"=:id";

            IDbParameters pms = AdoTemplate.CreateDbParameters();

            pms.AddWithValue("breedId", breedId);
            pms.AddWithValue("gender", (int)gender);
            pms.AddWithValue("growthStage", (int)growthStage);
            pms.AddWithValue("sheepfoldId", sheepfoldId);
            pms.AddWithValue("birthWeight", birthWeight);
            pms.AddWithValue("compatriotNumber", compatriotNumber);
            pms.AddWithValue("birthday", birthDay);
            pms.AddWithValue("origin", (int)origin);
            pms.AddWithValue("ablactationWeight", ablactationWeight);
            pms.AddWithValue("ablactationDate", ablactationDate);
            pms.AddWithValue("fatherId", fatherId);
            pms.AddWithValue("motherId", motherId);
            pms.AddWithValue("status", (int)sheepStatusEnum);
            pms.AddWithValue("principalId", principalId);
            pms.AddWithValue("remark", remark);
            pms.AddWithValue("id", id);

            AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }
            GrowthStageEnum gender = (GrowthStageEnum)value;

            return(((int)gender).ToString());
        }
示例#3
0
        public void AddExceptAssessSheep(string id, string sheepId, string reason, GrowthStageEnum growthStageEnum, string principalId, string operatorId, DateTime createTime, string remark)
        {
            string sql = "INSERT into \"T_ExceptAssess\" (\"Id\",\"SheepId\",\"Reason\",\"SourceGrowthStage\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"IsDel\",\"Remark\")VALUES(:id,:sheepId,:reason,:sourceGrowthStage,:principalId,:operatorId,:createTime,false,:remark);update \"T_Sheep\" set \"GrowthStage\"=:growthStage where \"Id\"=:updateSheepId";

            IDbParameters pms = AdoTemplate.CreateDbParameters();

            pms.AddWithValue("id", id);
            pms.AddWithValue("sheepId", sheepId);
            pms.AddWithValue("reason", reason);
            pms.AddWithValue("sourceGrowthStage", (int)growthStageEnum);
            pms.AddWithValue("principalId", principalId);
            pms.AddWithValue("operatorId", operatorId);
            pms.AddWithValue("createTime", createTime);
            pms.AddWithValue("remark", remark);

            pms.AddWithValue("growthStage", (int)GrowthStageEnum.FattingSheep);
            pms.AddWithValue("updateSheepId", sheepId);

            AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms);
        }
示例#4
0
        public void AddSheep(string id, string serialNumber, string breedId, GenderEnum gender, GrowthStageEnum growthStage, OriginEnum origin, float?birthWeight, int compatriotNumber, DateTime?birthDay, string fatherId, string motherId, string sheepfoldId, SheepStatusEnum sheepStatusEnum, string principalId, string operatorId, DateTime createTime, string remark, string buySource, decimal buyMoney, float?buyWeight, DateTime buyOperationDate, string buyPrincipalId, string buyRemark)
        {
            string sql = "INSERT into \"T_Sheep\" (\"Id\",\"SerialNumber\",\"BreedId\",\"Gender\",\"GrowthStage\",\"SheepfoldId\",\"BirthWeight\",\"CompatriotNumber\",\"Birthday\",\"Origin\",\"FatherId\",\"MotherId\",\"Status\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"Remark\")VALUES(:id,:serialNumber,:breedId,:gender,:growthStage,:sheepfoldId,:birthWeight,:compatriotNumber,:birthday,:origin,:fatherId,:motherId,:status,:principalId,:operaterId,:createTime,:remark);INSERT into \"T_BuySheep\" (\"ExpenditureId\",\"SheepId\",\"Source\",\"Weight\")VALUES(:expenditureId,:sheepId,:source,:buyWeight);INSERT into \"T_Expenditure\" (\"Id\",\"Money\",\"OperationDate\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"Remark\")VALUES(:exId,:money,:buyOperationDate,:buyPrincipalId,:buyOperatorId,:buyCreateTime,:buyRemark)";

            IDbParameters pms = AdoTemplate.CreateDbParameters();

            pms.AddWithValue("id", id);
            pms.AddWithValue("serialNumber", serialNumber);
            pms.AddWithValue("breedId", breedId);
            pms.AddWithValue("gender", (int)gender);
            pms.AddWithValue("growthStage", (int)growthStage);
            pms.AddWithValue("sheepfoldId", sheepfoldId);
            pms.AddWithValue("birthWeight", birthWeight);
            pms.AddWithValue("compatriotNumber", compatriotNumber);
            pms.AddWithValue("birthday", birthDay);
            pms.AddWithValue("origin", (int)origin);
            pms.AddWithValue("fatherId", fatherId);
            pms.AddWithValue("motherId", motherId);
            pms.AddWithValue("status", (int)sheepStatusEnum);
            pms.AddWithValue("principalId", principalId);
            pms.AddWithValue("operaterId", operatorId);
            pms.AddWithValue("createTime", createTime);
            pms.AddWithValue("remark", remark);

            string expenditureId = Guid.NewGuid().ToString();

            pms.AddWithValue("expenditureId", expenditureId);
            pms.AddWithValue("sheepId", id);
            pms.AddWithValue("source", buySource);
            pms.AddWithValue("buyWeight", buyWeight);

            pms.AddWithValue("exId", expenditureId);
            pms.AddWithValue("money", buyMoney);
            pms.AddWithValue("buyOperationDate", buyOperationDate);
            pms.AddWithValue("buyPrincipalId", buyPrincipalId);
            pms.AddWithValue("buyOperatorId", operatorId);
            pms.AddWithValue("buyCreateTime", createTime);
            pms.AddWithValue("buyRemark", buyRemark);

            AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms);
        }