Exemple #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail model)
 {
     return(dal.Add(model));
 }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail model)
 {
     dal.Update(model);
 }
Exemple #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.HSPR.Tb_HSPR_OffsetPreDetail();
                    //model.IID=dt.Rows[n]["IID"].ToString();
                    //model.OffsetID=dt.Rows[n]["OffsetID"].ToString();
                    if (dt.Rows[n]["CommID"].ToString() != "")
                    {
                        model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString());
                    }
                    //model.CostID=dt.Rows[n]["CostID"].ToString();
                    //model.CustID=dt.Rows[n]["CustID"].ToString();
                    //model.RoomID=dt.Rows[n]["RoomID"].ToString();
                    if (dt.Rows[n]["FeesDueDate"].ToString() != "")
                    {
                        model.FeesDueDate = DateTime.Parse(dt.Rows[n]["FeesDueDate"].ToString());
                    }
                    if (dt.Rows[n]["DebtsAmount"].ToString() != "")
                    {
                        model.DebtsAmount = decimal.Parse(dt.Rows[n]["DebtsAmount"].ToString());
                    }
                    if (dt.Rows[n]["OldPrecAmount"].ToString() != "")
                    {
                        model.OldPrecAmount = decimal.Parse(dt.Rows[n]["OldPrecAmount"].ToString());
                    }
                    if (dt.Rows[n]["NewPrecAmount"].ToString() != "")
                    {
                        model.NewPrecAmount = decimal.Parse(dt.Rows[n]["NewPrecAmount"].ToString());
                    }
                    if (dt.Rows[n]["OffsetAmount"].ToString() != "")
                    {
                        model.OffsetAmount = decimal.Parse(dt.Rows[n]["OffsetAmount"].ToString());
                    }
                    //model.FeesID=dt.Rows[n]["FeesID"].ToString();
                    //model.PrecID=dt.Rows[n]["PrecID"].ToString();
                    if (dt.Rows[n]["TakeWise"].ToString() != "")
                    {
                        model.TakeWise = int.Parse(dt.Rows[n]["TakeWise"].ToString());
                    }
                    if (dt.Rows[n]["IsAudit"].ToString() != "")
                    {
                        model.IsAudit = int.Parse(dt.Rows[n]["IsAudit"].ToString());
                    }
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    if (dt.Rows[n]["OffsetLateFeeAmount"].ToString() != "")
                    {
                        model.OffsetLateFeeAmount = decimal.Parse(dt.Rows[n]["OffsetLateFeeAmount"].ToString());
                    }
                    //model.ReceID=dt.Rows[n]["ReceID"].ToString();
                    if (dt.Rows[n]["ReceCode"].ToString() != "")
                    {
                        model.ReceCode = new Guid(dt.Rows[n]["ReceCode"].ToString());
                    }
                    model.DelUserCode = dt.Rows[n]["DelUserCode"].ToString();
                    if (dt.Rows[n]["DelDate"].ToString() != "")
                    {
                        model.DelDate = DateTime.Parse(dt.Rows[n]["DelDate"].ToString());
                    }
                    model.ChangeMemo = dt.Rows[n]["ChangeMemo"].ToString();
                    if (dt.Rows[n]["IsProperty"].ToString() != "")
                    {
                        model.IsProperty = int.Parse(dt.Rows[n]["IsProperty"].ToString());
                    }
                    if (dt.Rows[n]["IsAutoPrec"].ToString() != "")
                    {
                        model.IsAutoPrec = int.Parse(dt.Rows[n]["IsAutoPrec"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }