Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail();
                    //model.RecdID=dt.Rows[n]["RecdID"].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();
                    //model.FeesID=dt.Rows[n]["FeesID"].ToString();
                    //model.ReceID=dt.Rows[n]["ReceID"].ToString();
                    model.ChargeMode = dt.Rows[n]["ChargeMode"].ToString();
                    if (dt.Rows[n]["AccountWay"].ToString() != "")
                    {
                        model.AccountWay = int.Parse(dt.Rows[n]["AccountWay"].ToString());
                    }
                    if (dt.Rows[n]["ChargeAmount"].ToString() != "")
                    {
                        model.ChargeAmount = decimal.Parse(dt.Rows[n]["ChargeAmount"].ToString());
                    }
                    if (dt.Rows[n]["LateFeeAmount"].ToString() != "")
                    {
                        model.LateFeeAmount = decimal.Parse(dt.Rows[n]["LateFeeAmount"].ToString());
                    }
                    if (dt.Rows[n]["ChargeDate"].ToString() != "")
                    {
                        model.ChargeDate = DateTime.Parse(dt.Rows[n]["ChargeDate"].ToString());
                    }
                    model.FeesMemo = dt.Rows[n]["FeesMemo"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    //model.OldCostID=dt.Rows[n]["OldCostID"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.HSPR.Tb_HSPR_FeesDetail model)
 {
     dal.Add(model);
 }