Ejemplo n.º 1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL model)
 {
     return(dal.Add(model));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL> DataTableToList(DataTable dt)
        {
            List <DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL> modelList = new List <DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DigiPower.Onlinecol.Standard.Model.T_UsersInfo_MDL();
                    if (dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    if (dt.Rows[n]["CompanyID"].ToString() != "")
                    {
                        model.CompanyID = int.Parse(dt.Rows[n]["CompanyID"].ToString());
                    }
                    if (dt.Rows[n]["RoleID"].ToString() != "")
                    {
                        model.RoleID = int.Parse(dt.Rows[n]["RoleID"].ToString());
                    }
                    model.UserName  = dt.Rows[n]["UserName"].ToString();
                    model.CardID    = dt.Rows[n]["CardID"].ToString();
                    model.LoginName = dt.Rows[n]["LoginName"].ToString();
                    model.Passwd    = dt.Rows[n]["Passwd"].ToString();
                    model.Sex       = dt.Rows[n]["Sex"].ToString();
                    model.Mobile    = dt.Rows[n]["Mobile"].ToString();
                    model.Tel       = dt.Rows[n]["Tel"].ToString();
                    model.Fax       = dt.Rows[n]["Fax"].ToString();
                    model.EMail     = dt.Rows[n]["EMail"].ToString();
                    model.QQ        = dt.Rows[n]["QQ"].ToString();
                    model.MSN       = dt.Rows[n]["MSN"].ToString();
                    if (dt.Rows[n]["Createdate"].ToString() != "")
                    {
                        model.Createdate = DateTime.Parse(dt.Rows[n]["Createdate"].ToString());
                    }
                    model.Createdby = dt.Rows[n]["Createdby"].ToString();
                    if (dt.Rows[n]["IsValid"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IsValid"].ToString() == "1") || (dt.Rows[n]["IsValid"].ToString().ToLower() == "true"))
                        {
                            model.IsValid = true;
                        }
                        else
                        {
                            model.IsValid = false;
                        }
                    }
                    model.UserType = dt.Rows[n]["UserType"].ToString();
                    if (dt.Rows[n]["IsLeader"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IsLeader"].ToString() == "1") || (dt.Rows[n]["IsLeader"].ToString().ToLower() == "true"))
                        {
                            model.IsLeader = true;
                        }
                        else
                        {
                            model.IsLeader = false;
                        }
                    }
                    if (dt.Rows[n]["IsSuperAdmin"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IsSuperAdmin"].ToString() == "1") || (dt.Rows[n]["IsSuperAdmin"].ToString().ToLower() == "true"))
                        {
                            model.IsSuperAdmin = true;
                        }
                        else
                        {
                            model.IsSuperAdmin = false;
                        }
                    }
                    if (dt.Rows[n]["LastLoginTime"].ToString() != "")
                    {
                        model.LastLoginTime = DateTime.Parse(dt.Rows[n]["LastLoginTime"].ToString());
                    }
                    model.LastLoginIP = dt.Rows[n]["LastLoginIP"].ToString();
                    if (dt.Rows[n]["TrainCount"].ToString() != "")
                    {
                        model.TrainCount = int.Parse(dt.Rows[n]["TrainCount"].ToString());
                    }
                    model.RegDate      = dt.Rows[n]["RegDate"].ToString();
                    model.OwnerFileTmp = dt.Rows[n]["OwnerFileTmp"].ToString();

                    modelList.Add(model);
                }
            }
            return(modelList);
        }