Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            List<data> search;
            using (var db = new WaltonCrmEntities())
            {
                var spareParts =
                    db.SpareParts.Select(x => new data
                    {
                        id = x.ItemID,
                        text = x.ItemName
                    }).ToList();
                search = spareParts;
            }
            if (context.Request.QueryString["term"] != null)
            {
                var term = context.Request.QueryString["term"].ToString();

                context.Response.Clear();
                context.Response.ContentType = "application/json";

                //q	2term	2

                search = search.Where(x => x.text.ToLower().Contains(term)).ToList();
            }

            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            string json = jsSerializer.Serialize(search);
            context.Response.Write(json);
            context.Response.End();
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     using (var db=new WaltonCrmEntities())
     {
         var dataToBing = db.SpareParts.Take(1000).ToList();
         GridView1.DataSource = dataToBing;
         GridView1.DataBind();
     }
     GridView1.UseAccessibleHeader = true;
     GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
 }
        public static string getSpareParts()
        {
            List<String> spareParts;
            using (var db = new WaltonCrmEntities())
            {
                spareParts = db.SpareParts.Select(x =>x.ItemName).ToList();
            }
            JavaScriptSerializer js = new JavaScriptSerializer();
            return js.Serialize(spareParts);
            //return spareParts;

        }
Ejemplo n.º 4
0
    public static List<Select2Data> getSpareParts(string search, string page)
    {
        //q	2term	2
        var db = new WaltonCrmEntities();
        var dataOfSelect = db.SpareParts.Select(x => new Select2Data
        {
            id = x.ItemID,
            text = x.ItemName
        }).ToList();
        JavaScriptSerializer js = new JavaScriptSerializer();
        return dataOfSelect;

    }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {

            String userName = Request["userName"];
            String password = Request["password"];

            using (var dataContext=new WaltonCrmEntities())
            {
                
                

            }
        }
Ejemplo n.º 6
0
 public void GetDropDownListBindings()
 {
     if (!User.Identity.IsAuthenticated)
     {
         List<DropDownListBinding> downList;
         using (var db = new WaltonCrmEntities())
         {
             downList = db.SpareParts.Where(x => x.ItemID < 100).Select(x => new DropDownListBinding
             {
                 Id = x.ItemID,
                 ItemName = x.ItemName + "_" + x.ItemCode
             }).ToList();
         }
         JavaScriptSerializer js = new JavaScriptSerializer();
         HttpContext.Current.Response.Write(js.Serialize(downList));
     }
     else
     {
         HttpContext.Current.Response.Write("hi");
     }
     //return js.Serialize(downList);
 }
Ejemplo n.º 7
0
 public static List<SparePart> ajaxcall(string text)
 {
     
     var spareParts = new WaltonCrmEntities().SpareParts.ToList();
     return spareParts;
 }