public void AddDelivery(string id, string femaleId, DeliveryWayEnum deliveryWay, MidwiferyReasonEnum deliverReason, string deliverReasonOtherDetail, int?liveMaleCount, int?liveFemaleCount, int totalCount, DateTime deliveryDate, string principalId, string operatorId, DateTime createTime, string remark) { string sql = "INSERT into \"T_Delivery\" (\"Id\",\"SheepId\",\"DeliveryWay\",\"DeliverReason\",\"DeliverReasonOtherDetail\",\"LiveMaleCount\",\"LiveFemaleCount\",\"TotalCount\",\"DeliveryDate\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"Remark\")VALUES(:id,:sheepId,:deliveryWay,:deliverReason,:deliverReasonOtherDetail,:liveMaleCount,:liveFemaleCount,:totalCount,:deliveryDate,:principalId,:operatorId,:createTime,:remark);update \"T_Mating\" set \"IsRemindful\"=:isRemindful where \"FemaleId\"=:mid;"; IDbParameters pms = AdoTemplate.CreateDbParameters(); pms.AddWithValue("id", id); pms.AddWithValue("sheepId", femaleId); pms.AddWithValue("deliveryWay", (int)deliveryWay); pms.AddWithValue("deliverReason", (int)deliverReason); pms.AddWithValue("deliverReasonOtherDetail", deliverReasonOtherDetail); pms.AddWithValue("liveMaleCount", liveMaleCount); pms.AddWithValue("liveFemaleCount", liveFemaleCount); pms.AddWithValue("totalCount", totalCount); pms.AddWithValue("deliveryDate", deliveryDate); pms.AddWithValue("principalId", principalId); pms.AddWithValue("operatorId", operatorId); pms.AddWithValue("createTime", createTime); pms.AddWithValue("remark", remark); pms.AddWithValue("isRemindful", false); pms.AddWithValue("mid", femaleId); AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms); }
public void AddDelivery(string id, string femaleId, DeliveryWayEnum deliveryWay, MidwiferyReasonEnum deliverReason, string deliverReasonOtherDetail, int?liveMaleCount, int?liveFemaleCount, int totalCount, DateTime deliveryDate, string principalId, string operatorId, DateTime createTime, string remark, List <Chanyi.Shepherd.QueryModel.AddModel.BaseInfo.Sheep> lambList, string lambBreedId, string fatherId) { StringBuilder sb = new StringBuilder(); sb.Append("INSERT into \"T_Delivery\" (\"Id\",\"SheepId\",\"DeliveryWay\",\"DeliverReason\",\"DeliverReasonOtherDetail\",\"LiveMaleCount\",\"LiveFemaleCount\",\"TotalCount\",\"DeliveryDate\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"Remark\")VALUES(:id,:sheepId,:deliveryWay,:deliverReason,:deliverReasonOtherDetail,:liveMaleCount,:liveFemaleCount,:totalCount,:deliveryDate,:principalId,:operatorId,:createTime,:remark);update \"T_Mating\" set \"IsRemindful\"=:isRemindful where \"FemaleId\"=:mid;"); IDbParameters pms = AdoTemplate.CreateDbParameters(); pms.AddWithValue("id", id); pms.AddWithValue("sheepId", femaleId); pms.AddWithValue("deliveryWay", (int)deliveryWay); pms.AddWithValue("deliverReason", (int)deliverReason); pms.AddWithValue("deliverReasonOtherDetail", deliverReasonOtherDetail); pms.AddWithValue("liveMaleCount", liveMaleCount); pms.AddWithValue("liveFemaleCount", liveFemaleCount); pms.AddWithValue("totalCount", totalCount); pms.AddWithValue("deliveryDate", deliveryDate); pms.AddWithValue("principalId", principalId); pms.AddWithValue("operatorId", operatorId); pms.AddWithValue("createTime", createTime); pms.AddWithValue("remark", remark); pms.AddWithValue("isRemindful", false); pms.AddWithValue("mid", femaleId); int mc = liveMaleCount ?? 0; int fc = liveFemaleCount ?? 0; for (int i = 0; i < lambList.Count; i++) { sb.AppendFormat("INSERT into \"T_Sheep\" (\"Id\",\"SerialNumber\",\"BreedId\",\"Gender\",\"GrowthStage\",\"SheepfoldId\",\"BirthWeight\",\"CompatriotNumber\",\"Birthday\",\"AblactationWeight\",\"AblactationDate\",\"Origin\",\"FatherId\",\"MotherId\",\"Status\",\"PrincipalId\",\"OperatorId\",\"CreateTime\",\"Remark\")VALUES(:id{0},:serialNumber{0},:breedId{0},:gender{0},:growthStage{0},:sheepfoldId{0},:birthWeight{0},:compatriotNumber{0},:birthday{0},:ablactationWeight{0},:ablactationDate{0},:origin{0},:fatherId{0},:motherId{0},:status{0},:principalId{0},:operatorId{0},:createTime{0},:remark{0});", i); Chanyi.Shepherd.QueryModel.AddModel.BaseInfo.Sheep sheep = lambList[i]; pms.AddWithValue("id" + i, Guid.NewGuid().ToString()); pms.AddWithValue("serialNumber" + i, sheep.SerialNumber); pms.AddWithValue("breedId" + i, lambBreedId); pms.AddWithValue("gender" + i, (int)sheep.Gender); pms.AddWithValue("growthStage" + i, (int)GrowthStageEnum.Lamb); pms.AddWithValue("sheepfoldId" + i, sheep.SheepfoldId); pms.AddWithValue("birthWeight" + i, sheep.BirthWeight); pms.AddWithValue("compatriotNumber" + i, mc + fc); pms.AddWithValue("birthday" + i, deliveryDate); pms.AddWithValue("ablactationWeight" + i, null); pms.AddWithValue("ablactationDate" + i, null); pms.AddWithValue("origin" + i, (int)OriginEnum.HomeBred); pms.AddWithValue("fatherId" + i, fatherId); pms.AddWithValue("motherId" + i, femaleId); pms.AddWithValue("status" + i, (int)SheepStatusEnum.Nomal); pms.AddWithValue("principalId" + i, principalId); pms.AddWithValue("operatorId" + i, operatorId); pms.AddWithValue("createTime" + i, createTime); pms.AddWithValue("remark" + i, sheep.Remark); } AdoTemplate.ExecuteNonQuery(CommandType.Text, sb.ToString(), pms); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return(null); } DeliveryWayEnum gender = (DeliveryWayEnum)value; return(((int)gender).ToString()); }
public void UpdateDelivery(DeliveryWayEnum deliveryWay, MidwiferyReasonEnum deliverReason, string deliverReasonOtherDetail, int?liveMaleCount, int?liveFemaleCount, int totalCount, DateTime deliveryDate, string principalId, string remark, string id) { string sql = "UPDATE \"T_Delivery\" SET \"DeliveryWay\"=:deliveryWay,\"DeliverReason\"=:deliverReason,\"DeliverReasonOtherDetail\"=:deliverReasonOtherDetail,\"LiveMaleCount\"=:liveMaleCount,\"LiveFemaleCount\"=:liveFemaleCount,\"TotalCount\"=:totalCount,\"DeliveryDate\"=:deliveryDate,\"PrincipalId\"=:principalId,\"Remark\"=:remark where \"Id\"=:id"; IDbParameters pms = AdoTemplate.CreateDbParameters(); pms.AddWithValue("deliveryWay", (int)deliveryWay); pms.AddWithValue("deliverReason", (int)deliverReason); pms.AddWithValue("deliverReasonOtherDetail", deliverReasonOtherDetail); pms.AddWithValue("liveMaleCount", liveMaleCount); pms.AddWithValue("liveFemaleCount", liveFemaleCount); pms.AddWithValue("totalCount", totalCount); pms.AddWithValue("deliveryDate", deliveryDate); pms.AddWithValue("principalId", principalId); pms.AddWithValue("remark", remark); pms.AddWithValue("id", id); AdoTemplate.ExecuteNonQuery(CommandType.Text, sql, pms); }