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

            if (rowsCount > 0)
            {
                MobileSoft.Model.HSPR.Tb_HSPR_Parking model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.HSPR.Tb_HSPR_Parking();
                    //model.ParkID=dt.Rows[n]["ParkID"].ToString();
                    if (dt.Rows[n]["CommID"].ToString() != "")
                    {
                        model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString());
                    }
                    //model.CustID=dt.Rows[n]["CustID"].ToString();
                    //model.RoomID=dt.Rows[n]["RoomID"].ToString();
                    model.ParkType = dt.Rows[n]["ParkType"].ToString();
                    if (dt.Rows[n]["ParkArea"].ToString() != "")
                    {
                        model.ParkArea = decimal.Parse(dt.Rows[n]["ParkArea"].ToString());
                    }
                    if (dt.Rows[n]["CarparkID"].ToString() != "")
                    {
                        model.CarparkID = int.Parse(dt.Rows[n]["CarparkID"].ToString());
                    }
                    model.ParkName = dt.Rows[n]["ParkName"].ToString();
                    if (dt.Rows[n]["ParkingNum"].ToString() != "")
                    {
                        model.ParkingNum = int.Parse(dt.Rows[n]["ParkingNum"].ToString());
                    }
                    model.PropertyRight = dt.Rows[n]["PropertyRight"].ToString();
                    //model.StanID=dt.Rows[n]["StanID"].ToString();
                    model.PropertyUses = dt.Rows[n]["PropertyUses"].ToString();
                    model.UseState     = dt.Rows[n]["UseState"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    if (dt.Rows[n]["ParkCategory"].ToString() != "")
                    {
                        model.ParkCategory = int.Parse(dt.Rows[n]["ParkCategory"].ToString());
                    }
                    if (dt.Rows[n]["ResideType"].ToString() != "")
                    {
                        model.ResideType = int.Parse(dt.Rows[n]["ResideType"].ToString());
                    }
                    if (dt.Rows[n]["ParkSynchCode"].ToString() != "")
                    {
                        model.ParkSynchCode = new Guid(dt.Rows[n]["ParkSynchCode"].ToString());
                    }
                    if (dt.Rows[n]["SynchFlag"].ToString() != "")
                    {
                        model.SynchFlag = int.Parse(dt.Rows[n]["SynchFlag"].ToString());
                    }
                    model.ParkMemo = dt.Rows[n]["ParkMemo"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }