Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public void Save()
 {
     if (IsNew())
     {
         DistributeDBI.Insert(this.NeedWaterClass.NeedWaterID, Begin, End, this.DistributeAmount, this.Remark);
     }
     else
     {
         DistributeDBI.Update(this.DistributeWaterID, Begin, End, this.DistributeAmount, this.Remark);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="begin"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public DataTable GetDistributeWaterDataTable(DateTime begin, DateTime end)
        {
            DataTable r = null;

            foreach (WaterUserClass w in this)
            {
                DataTable t = DistributeDBI.GetDistributeDataTable(w.WaterUserID, begin, end);
                if (r == null)
                {
                    r = t;
                }
                else
                {
                    r.Merge(t);
                }
            }
            return(r);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="distributeID"></param>
        /// <returns></returns>
        static public DistributeClass CreateByID(int distributeID)
        {
            DataTable tbl = DistributeDBI.GetDistributeDataTableByID(distributeID);

            if (tbl.Rows.Count > 0)
            {
                DataRow         row = tbl.Rows[0];
                DistributeClass d   = new DistributeClass();
                d.Begin             = Convert.ToDateTime(row[DBNames.tblDistributeWater.DistributeBeginDT]);
                d.End               = Convert.ToDateTime(row[DBNames.tblDistributeWater.DistributeEndDT]);
                d.DistributeAmount  = Convert.ToInt32(row[DBNames.tblDistributeWater.DistributeAmount]);
                d.DistributeWaterID = Convert.ToInt32(row[DBNames.tblDistributeWater.DistributeWaterID]);
                d.Remark            = row[DBNames.tblDistributeWater.Remark].ToString();

                int needID = Convert.ToInt32(row[DBNames.tblDistributeWater.NeedWaterID]);
                d.NeedWaterClass = NeedWaterClass.CreateByID(needID);

                return(d);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// 获取用水户的配水信息
 /// </summary>
 /// <param name="begin"></param>
 /// <param name="end"></param>
 /// <remarks>
 /// 由该用户的上级单位向其分配的水量信息
 /// </remarks>
 /// <returns></returns>
 public DataTable GetDistributeWaterDataTable(DateTime begin, DateTime end)
 {
     return(DistributeDBI.GetDistributeDataTable(this.WaterUserID, begin, end));
 }