示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="needWater"></param>
        /// <returns></returns>
        static public DistributeClass CreateByNeedWater(NeedWaterClass needWater)
        {
            if (needWater == null)
            {
                throw new ArgumentNullException("needWater");
            }

            DistributeClass d = new DistributeClass();

            d.NeedWaterClass = needWater;
            return(d);
        }
示例#2
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);
            }
        }
示例#3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="needWater"></param>
        /// <returns></returns>
        public static DistributeClass CreateByNeedWater(NeedWaterClass needWater)
        {
            if (needWater == null)
            {
                throw new ArgumentNullException("needWater");
            }

            DistributeClass d = new DistributeClass();
            d.NeedWaterClass = needWater;
            return d;
        }
示例#4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="distributeID"></param>
        /// <returns></returns>
        public static 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;
            }
        }