Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = ddlUname.SelectedText;
            string password = tbxPassword.Text;

            pms_User_Info user = new pms_User_Info();

            TSM.Model.pms_User_Info modelpms_User_Info = m_bllpms_User_Info.GetModel(userName, password);

            if (modelpms_User_Info == null)
            {
                // 参数错误,首先弹出Alert对话框然后关闭弹出窗口
                Alert.Show("输入的用户名或密码有误,请重新输入!", String.Empty, ActiveWindow.GetHideRefreshReference());
                return;
            }
            else
            {
                string id    = modelpms_User_Info.UserInfoID.ToString();
                string uname = modelpms_User_Info.UserName.ToString();
                LoginSuccess(id, uname);
                return;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <TSM.Model.pms_User_Info> DataTableToList(DataTable dt)
        {
            List <TSM.Model.pms_User_Info> modelList = new List <TSM.Model.pms_User_Info>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSM.Model.pms_User_Info model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.pms_User_Info();
                    if (dt.Rows[n]["UserInfoID"].ToString() != "")
                    {
                        model.UserInfoID = int.Parse(dt.Rows[n]["UserInfoID"].ToString());
                    }
                    model.UserName = dt.Rows[n]["UserName"].ToString();
                    model.Pwd      = dt.Rows[n]["Pwd"].ToString();
                    if (dt.Rows[n]["CompanyInfoID"].ToString() != "")
                    {
                        model.CompanyInfoID = int.Parse(dt.Rows[n]["CompanyInfoID"].ToString());
                    }
                    if (dt.Rows[n]["DeptInfoID"].ToString() != "")
                    {
                        model.DeptInfoID = int.Parse(dt.Rows[n]["DeptInfoID"].ToString());
                    }
                    if (dt.Rows[n]["PermissionInfoID"].ToString() != "")
                    {
                        model.PermissionInfoID = int.Parse(dt.Rows[n]["PermissionInfoID"].ToString());
                    }
                    model.UserTel   = dt.Rows[n]["UserTel"].ToString();
                    model.UserPhone = dt.Rows[n]["UserPhone"].ToString();
                    model.UserMail  = dt.Rows[n]["UserMail"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.pms_User_Info model)
 {
     dal.Update(model);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.pms_User_Info model)
 {
     return(dal.Add(model));
 }