Example #1
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Garfield.Model.hr_employee model)
 {
     return(dal.Update(model));
 }
Example #2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Garfield.Model.hr_employee model)
 {
     return(dal.Add(model));
 }
Example #3
0
 /// <summary>
 /// 更新密码
 /// </summary>
 public bool changepwd(Garfield.Model.hr_employee model)
 {
     return(dal.changepwd(model));
 }
Example #4
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Garfield.Model.hr_employee> DataTableToList(DataTable dt)
        {
            List <Garfield.Model.hr_employee> modelList = new List <Garfield.Model.hr_employee>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Garfield.Model.hr_employee model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Garfield.Model.hr_employee();
                    if (dt.Rows[n]["ID"] != null && dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["uid"] != null && dt.Rows[n]["uid"].ToString() != "")
                    {
                        model.uid = dt.Rows[n]["uid"].ToString();
                    }
                    if (dt.Rows[n]["pwd"] != null && dt.Rows[n]["pwd"].ToString() != "")
                    {
                        model.pwd = dt.Rows[n]["pwd"].ToString();
                    }
                    if (dt.Rows[n]["name"] != null && dt.Rows[n]["name"].ToString() != "")
                    {
                        model.name = dt.Rows[n]["name"].ToString();
                    }
                    if (dt.Rows[n]["idcard"] != null && dt.Rows[n]["idcard"].ToString() != "")
                    {
                        model.idcard = dt.Rows[n]["idcard"].ToString();
                    }
                    if (dt.Rows[n]["birthday"] != null && dt.Rows[n]["birthday"].ToString() != "")
                    {
                        model.birthday = dt.Rows[n]["birthday"].ToString();
                    }
                    if (dt.Rows[n]["d_id"] != null && dt.Rows[n]["d_id"].ToString() != "")
                    {
                        model.d_id = int.Parse(dt.Rows[n]["d_id"].ToString());
                    }
                    if (dt.Rows[n]["dname"] != null && dt.Rows[n]["dname"].ToString() != "")
                    {
                        model.dname = dt.Rows[n]["dname"].ToString();
                    }
                    if (dt.Rows[n]["postid"] != null && dt.Rows[n]["postid"].ToString() != "")
                    {
                        model.postid = int.Parse(dt.Rows[n]["postid"].ToString());
                    }
                    if (dt.Rows[n]["post"] != null && dt.Rows[n]["post"].ToString() != "")
                    {
                        model.post = dt.Rows[n]["post"].ToString();
                    }
                    if (dt.Rows[n]["email"] != null && dt.Rows[n]["email"].ToString() != "")
                    {
                        model.email = dt.Rows[n]["email"].ToString();
                    }
                    if (dt.Rows[n]["sex"] != null && dt.Rows[n]["sex"].ToString() != "")
                    {
                        model.sex = dt.Rows[n]["sex"].ToString();
                    }
                    if (dt.Rows[n]["tel"] != null && dt.Rows[n]["tel"].ToString() != "")
                    {
                        model.tel = dt.Rows[n]["tel"].ToString();
                    }
                    if (dt.Rows[n]["status"] != null && dt.Rows[n]["status"].ToString() != "")
                    {
                        model.status = dt.Rows[n]["status"].ToString();
                    }
                    if (dt.Rows[n]["zhiwuid"] != null && dt.Rows[n]["zhiwuid"].ToString() != "")
                    {
                        model.zhiwuid = int.Parse(dt.Rows[n]["zhiwuid"].ToString());
                    }
                    if (dt.Rows[n]["zhiwu"] != null && dt.Rows[n]["zhiwu"].ToString() != "")
                    {
                        model.zhiwu = dt.Rows[n]["zhiwu"].ToString();
                    }
                    if (dt.Rows[n]["sort"] != null && dt.Rows[n]["sort"].ToString() != "")
                    {
                        model.sort = int.Parse(dt.Rows[n]["sort"].ToString());
                    }
                    if (dt.Rows[n]["EntryDate"] != null && dt.Rows[n]["EntryDate"].ToString() != "")
                    {
                        model.EntryDate = dt.Rows[n]["EntryDate"].ToString();
                    }
                    if (dt.Rows[n]["address"] != null && dt.Rows[n]["address"].ToString() != "")
                    {
                        model.address = dt.Rows[n]["address"].ToString();
                    }
                    if (dt.Rows[n]["remarks"] != null && dt.Rows[n]["remarks"].ToString() != "")
                    {
                        model.remarks = dt.Rows[n]["remarks"].ToString();
                    }
                    if (dt.Rows[n]["education"] != null && dt.Rows[n]["education"].ToString() != "")
                    {
                        model.education = dt.Rows[n]["education"].ToString();
                    }
                    if (dt.Rows[n]["level"] != null && dt.Rows[n]["level"].ToString() != "")
                    {
                        model.level = dt.Rows[n]["level"].ToString();
                    }
                    if (dt.Rows[n]["professional"] != null && dt.Rows[n]["professional"].ToString() != "")
                    {
                        model.professional = dt.Rows[n]["professional"].ToString();
                    }
                    if (dt.Rows[n]["schools"] != null && dt.Rows[n]["schools"].ToString() != "")
                    {
                        model.schools = dt.Rows[n]["schools"].ToString();
                    }
                    if (dt.Rows[n]["title"] != null && dt.Rows[n]["title"].ToString() != "")
                    {
                        model.title = dt.Rows[n]["title"].ToString();
                    }
                    if (dt.Rows[n]["isDelete"] != null && dt.Rows[n]["isDelete"].ToString() != "")
                    {
                        model.isDelete = int.Parse(dt.Rows[n]["isDelete"].ToString());
                    }
                    if (dt.Rows[n]["Delete_time"] != null && dt.Rows[n]["Delete_time"].ToString() != "")
                    {
                        model.Delete_time = DateTime.Parse(dt.Rows[n]["Delete_time"].ToString());
                    }
                    if (dt.Rows[n]["portal"] != null && dt.Rows[n]["portal"].ToString() != "")
                    {
                        model.portal = dt.Rows[n]["portal"].ToString();
                    }
                    if (dt.Rows[n]["theme"] != null && dt.Rows[n]["theme"].ToString() != "")
                    {
                        model.theme = dt.Rows[n]["theme"].ToString();
                    }
                    if (dt.Rows[n]["canlogin"] != null && dt.Rows[n]["canlogin"].ToString() != "")
                    {
                        model.canlogin = int.Parse(dt.Rows[n]["canlogin"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }