예제 #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LYSC.CompanyWeb.Model.HKSJ_Relationship> DataTableToList(DataTable dt)
        {
            List <LYSC.CompanyWeb.Model.HKSJ_Relationship> modelList = new List <LYSC.CompanyWeb.Model.HKSJ_Relationship>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LYSC.CompanyWeb.Model.HKSJ_Relationship model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LYSC.CompanyWeb.Model.HKSJ_Relationship();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["Address"] != null && dt.Rows[n]["Address"].ToString() != "")
                    {
                        model.Address = dt.Rows[n]["Address"].ToString();
                    }
                    if (dt.Rows[n]["Zip"] != null && dt.Rows[n]["Zip"].ToString() != "")
                    {
                        model.Zip = dt.Rows[n]["Zip"].ToString();
                    }
                    if (dt.Rows[n]["plane"] != null && dt.Rows[n]["plane"].ToString() != "")
                    {
                        model.plane = dt.Rows[n]["plane"].ToString();
                    }
                    if (dt.Rows[n]["Fax"] != null && dt.Rows[n]["Fax"].ToString() != "")
                    {
                        model.Fax = dt.Rows[n]["Fax"].ToString();
                    }
                    if (dt.Rows[n]["QQ_MSN"] != null && dt.Rows[n]["QQ_MSN"].ToString() != "")
                    {
                        model.QQ_MSN = dt.Rows[n]["QQ_MSN"].ToString();
                    }
                    if (dt.Rows[n]["Date"] != null && dt.Rows[n]["Date"].ToString() != "")
                    {
                        model.Date = DateTime.Parse(dt.Rows[n]["Date"].ToString());
                    }
                    if (dt.Rows[n]["people"] != null && dt.Rows[n]["people"].ToString() != "")
                    {
                        model.people = dt.Rows[n]["people"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LYSC.CompanyWeb.Model.HKSJ_Relationship model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LYSC.CompanyWeb.Model.HKSJ_Relationship model)
 {
     return(dal.Add(model));
 }