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

            if (rowsCount > 0)
            {
                DigiPower.Onlinecol.Standard.Model.T_CompanyArchiveUser_MDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DigiPower.Onlinecol.Standard.Model.T_CompanyArchiveUser_MDL();
                    if (dt.Rows[n]["CompanyArchiveUserID"].ToString() != "")
                    {
                        model.CompanyArchiveUserID = int.Parse(dt.Rows[n]["CompanyArchiveUserID"].ToString());
                    }
                    if (dt.Rows[n]["CompanyID"].ToString() != "")
                    {
                        model.CompanyID = int.Parse(dt.Rows[n]["CompanyID"].ToString());
                    }
                    model.ArchiveUserCode = dt.Rows[n]["ArchiveUserCode"].ToString();
                    model.UserName        = dt.Rows[n]["UserName"].ToString();
                    model.Sex             = dt.Rows[n]["Sex"].ToString();
                    if (dt.Rows[n]["Birthday"].ToString() != "")
                    {
                        model.Birthday = DateTime.Parse(dt.Rows[n]["Birthday"].ToString());
                    }
                    model.Educate = dt.Rows[n]["Educate"].ToString();
                    model.Tel     = dt.Rows[n]["Tel"].ToString();
                    model.Email   = dt.Rows[n]["Email"].ToString();
                    model.QQ      = dt.Rows[n]["QQ"].ToString();
                    if (dt.Rows[n]["TrainCount"].ToString() != "")
                    {
                        model.TrainCount = int.Parse(dt.Rows[n]["TrainCount"].ToString());
                    }
                    if (dt.Rows[n]["RegDate"].ToString() != "")
                    {
                        model.RegDate = DateTime.Parse(dt.Rows[n]["RegDate"].ToString());
                    }
                    if (dt.Rows[n]["RegFlag"].ToString() != "")
                    {
                        if ((dt.Rows[n]["RegFlag"].ToString() == "1") || (dt.Rows[n]["RegFlag"].ToString().ToLower() == "true"))
                        {
                            model.RegFlag = true;
                        }
                        else
                        {
                            model.RegFlag = false;
                        }
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
コード例 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(DigiPower.Onlinecol.Standard.Model.T_CompanyArchiveUser_MDL model)
 {
     dal.Update(model);
 }
コード例 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(DigiPower.Onlinecol.Standard.Model.T_CompanyArchiveUser_MDL model)
 {
     return(dal.Add(model));
 }