Ejemplo n.º 1
0
        public ActionResult GetUserInfo(SearchUserData data)
        {
            ExamUserInfoModel model = new ExamUserInfoModel();

            model.GetUserInfo(data);
            return(Json(new { tableData = model.ListUserInfo11, YListUserInfo = model.YListUserInfo, CPListUserInfo = model.ListDetailInfo, LExamType = model.LExamType }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
    public void InquirySearch(string ACTION, string Mobile, string Id)
    {
        JavaScriptSerializer     js = new JavaScriptSerializer();
        List <SearchUserData>    cm = new List <SearchUserData>();
        List <GeneralDataSearch> g  = new List <GeneralDataSearch>();

        try
        {
            if (ACTION == "getsearchdata")
            {
                GeneralDataSearch data = new GeneralDataSearch();
                data.MESSAGE        = "";
                data.ORIGINAL_ERROR = "";
                data.ERROR_STATUS   = false;
                data.RECORDS        = true;

                string    qry = "select im.*,cm.Name as CName,r.Name as RName from InquiryMaster im, CourseMaster cm,Reference r where im.CourseId=cm.Id and im.Refid=r.Id and im.mobileno = '" + Mobile + "' and im.UserId='" + Id + "'";
                DataTable dt  = D.GetDataTable(qry);
                if (dt.Rows.Count > 0)
                {
                    SearchUserData d = new SearchUserData();
                    d.Id           = dt.Rows[0]["Id"].ToString();
                    d.Name         = dt.Rows[0]["Name"].ToString();
                    d.MobileNo     = dt.Rows[0]["MobileNo"].ToString();
                    d.Discount     = dt.Rows[0]["Discount"].ToString();
                    d.InquiryDate  = Convert.ToDateTime(dt.Rows[0]["InquiryDate"]).ToString("dd-MM-yyyy");
                    d.FollowUpdate = Convert.ToDateTime(dt.Rows[0]["FollowUpdate"]).ToString("dd-MM-yyyy");
                    d.CName        = dt.Rows[0]["CName"].ToString();
                    d.RName        = dt.Rows[0]["RName"].ToString();
                    cm.Add(d);

                    data.getuserdata = cm;
                    g.Add(data);
                    Context.Response.Write(js.Serialize(g[0]));
                }
                else
                {
                    data.MESSAGE        = "Failed To Load";
                    data.ORIGINAL_ERROR = "Mobile No Not Exists";
                    data.ERROR_STATUS   = true;
                    data.RECORDS        = false;
                    g.Add(data);
                    Context.Response.Write(js.Serialize(g[0]));
                    return;
                }
            }
        }
        catch (Exception ex)
        {
            GeneralDataSearch data = new GeneralDataSearch();
            data.MESSAGE        = "Failed To Load";
            data.ORIGINAL_ERROR = ex.Message;
            data.ERROR_STATUS   = true;
            data.RECORDS        = false;
            g.Add(data);
            Context.Response.Write(js.Serialize(g[0]));
        }
    }
Ejemplo n.º 3
0
    public void GetCustomerData(string type)
    {
        JavaScriptSerializer js = new JavaScriptSerializer();
        int i = 0;
        List <SearchUserData>    list = new List <SearchUserData>();
        List <GeneralDataSearch> g    = new List <GeneralDataSearch>();

        if (type == "customer")
        {
            try
            {
                DataTable dt2 = D.GetDataTable("select *,name + ' - ' + Convert(nvarchar,MobileNo) as fullname from InquiryMaster");
                if (dt2.Rows.Count != 0)
                {
                    for (i = 0; i <= dt2.Rows.Count - 1; i++)
                    {
                        SearchUserData hc = new SearchUserData();
                        hc.Id   = dt2.Rows[i]["Id"].ToString();
                        hc.Name = dt2.Rows[i]["fullname"].ToString();
                        list.Add(hc);
                    }
                    GeneralDataSearch data = new GeneralDataSearch();
                    data.MESSAGE        = "Successfully !";
                    data.ORIGINAL_ERROR = "";
                    data.ERROR_STATUS   = false;
                    data.RECORDS        = true;
                    data.getuserdata    = list;
                    g.Add(data);
                    Context.Response.Write(js.Serialize(g[0]));
                }
                else
                {
                    GeneralDataSearch data = new GeneralDataSearch();
                    data.MESSAGE        = "Data Not Available";
                    data.ORIGINAL_ERROR = "";
                    data.ERROR_STATUS   = false;
                    data.RECORDS        = false;
                    g.Add(data);
                    Context.Response.Write(js.Serialize(g[0]));
                }
            }
            catch (Exception ex)
            {
                GeneralDataSearch data = new GeneralDataSearch();
                data.MESSAGE        = "Failed";
                data.ORIGINAL_ERROR = ex.Message;
                data.ERROR_STATUS   = true;
                data.RECORDS        = false;
                g.Add(data);
                Context.Response.Write(js.Serialize(g[0]));
            }
        }
    }
Ejemplo n.º 4
0
        public Reply Search([FromUri] SearchUserData data)
        {
            try
            {
                _sessionService.Validate(data.UserId, data.SessionToken);
            }
            catch (InvalidSessionException)
            {
                return(new Reply(HttpStatusCode.BadRequest, "Invalid session"));
            }

            var users = _userService.Search(data.UserId, data.SearchKeyword);

            return(new SearchUserReply
            {
                Users = users
            });
        }
Ejemplo n.º 5
0
        public async Task <IEnumerable <User> > SearchUsers(string JWT, SearchUserData searchData)
        {
            using (AppDBContext _context = new AppDBContext())
            {
                User authUser = await _context.Users.Where(u => u.JWT == JWT).SingleOrDefaultAsync();

                var users = await _context.Users.Include(u => u.Information)
                            .ThenInclude(i => i.Conversations)
                            .Where(u => (u.Firstname + " " + u.Lastname).Contains(searchData.Name) ||
                                   (u.Lastname + " " + u.Firstname).Contains(searchData.Name))
                            .ToListAsync();

                foreach (var search in searchData.Users)
                {
                    users.RemoveAll(user => user.JWT == search.JWT);
                }

                return(GetVideoInitiatedUsers(users, authUser));
            }
        }
Ejemplo n.º 6
0
 public JsonResult SearchUsers([FromBody] SearchUserData searchData)
 {
     return(new JsonResult(Search.SearchUsers(Request.Headers["Authorization"].ToString().Remove(0, 7), searchData)));
 }