示例#1
0
        public async Task <IHttpActionResult> SelectUser(Guid?IdOwner, bool?status)
        {
            //obtiene si tiene mensajes pendientes de leer en general retorna true o false
            var response = await user.GetUser(IdOwner, status);

            return(Ok(response));
        }
示例#2
0
        protected void btnLogin_ServerClick(object sender, EventArgs e)
        {
            BLUser blUser = new BLUser();

            try
            {
                DataSet dsUsers = blUser.GetUser(txtUserName.Value, txtPassword.Value);
                if (dsUsers.Tables.Count > 0)
                {
                    if (dsUsers.Tables[0].Rows.Count == 0)
                    {
                        //Invalid User
                        msg = "Username หรือ Password ผิดพลาด กรุณา Login ใหม่";
                    }
                    else
                    {
                        actionResult = true;
                        User users = new User();

                        users.UserId = dsUsers.Tables[0].Rows[0]["USER_ID"].ToString();
                        //users.UserName = dsUsers.Tables[0].Rows[0]["USER_NAME"].ToString();
                        users.UserName  = dsUsers.Tables[0].Rows[0]["CUSTOMER_DESCRIPTION"].ToString();
                        users.DeptId    = dsUsers.Tables[0].Rows[0]["DEPT_ID"].ToString();
                        users.Email     = dsUsers.Tables[0].Rows[0]["EMAIL"].ToString();
                        users.DeptName  = dsUsers.Tables[0].Rows[0]["DEPT_NAME"].ToString();
                        users.RoleMenus = new List <string>();
                        foreach (DataRow dr in dsUsers.Tables[0].Rows)
                        {
                            users.RoleMenus.Add(dr["MENU_ID"].ToString());
                        }

                        Session["User"] = users;

                        if (chkRemember.Checked)
                        {
                            Session.Timeout = 3000;
                        }

                        Response.Redirect("Home/Index.aspx");
                    }
                }
                else
                {
                    msg = "Username หรือ Password ผิดพลาด กรุณา Login ใหม่";
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#3
0
文件: User.xaml.cs 项目: ttss2272/stt
        /*
         * Created by:-
         * Created Date:-
         * Purpose
         */
        #region ---------------------------------------------------BindUserGrid()-------------------------------------------------
        private void bindUserGrid()
        {
            DataSet ds = obj_User.GetUser(0, txtSearchUser.Text);

            if (ds.Tables[0].Rows.Count > 0)
            {
                gvUser.ItemsSource = ds.Tables[0].DefaultView;
            }
            else
            {
                gvUser.ItemsSource = null;
                //MessageBox.Show("Data Not Found", "Message");
                //ClearFields();
            }
        }