コード例 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching> modelList = new List <MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching();
                    //model.ScID=dt.Rows[n]["ScID"].ToString();
                    if (dt.Rows[n]["CommID"].ToString() != "")
                    {
                        model.CommID = int.Parse(dt.Rows[n]["CommID"].ToString());
                    }
                    if (dt.Rows[n]["ScType"].ToString() != "")
                    {
                        model.ScType = int.Parse(dt.Rows[n]["ScType"].ToString());
                    }
                    model.ScTyCode = dt.Rows[n]["ScTyCode"].ToString();
                    if (dt.Rows[n]["ScNum"].ToString() != "")
                    {
                        model.ScNum = int.Parse(dt.Rows[n]["ScNum"].ToString());
                    }
                    model.ScName      = dt.Rows[n]["ScName"].ToString();
                    model.ScAddress   = dt.Rows[n]["ScAddress"].ToString();
                    model.ScLinkMan   = dt.Rows[n]["ScLinkMan"].ToString();
                    model.ScLinkPhone = dt.Rows[n]["ScLinkPhone"].ToString();
                    model.ScMemo      = dt.Rows[n]["ScMemo"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching model)
 {
     dal.Update(model);
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.HSPR.Tb_HSPR_CommunityServiceMatching model)
 {
     dal.Add(model);
 }