Esempio n. 1
0
        public ActionResult Index()
        {
            Vendor vd = new Vendor();
            vd.Manufacturers = GetManufacturerList();

            vd.StateModel = new List<State1>();
            vd.StateModel = GetAllState1();
            //////////////////////////////////////////////////////
            var addrs = new List<String>
                    {
                       "No Data"
                    };
            ViewData["addrs"] = addrs;
            ///////////////////////////////////////////////////////
            var addrs2 = new List<String>
                    {
                       "."
                    };
            ViewData["lat_lon"] = addrs2;
            ///////////////////////////////////////////////////////
            var addrs3 = new List<String>
                    {
                       "."
                    };
            ViewData["city_zip"] = addrs3;
            return View(vd);
        }
Esempio n. 2
0
        public ActionResult Index(Vendor vndr)
        {
            //Vendor vd = new Vendor();
            if (!ModelState.IsValid)

                vndr.Country = "";
            ////////////////////get country name from View/////////////////////////////////////////////////////////
            List<State1> objCountry = new List<State1>();
            objCountry = GetAllState1().Where(m => m.Id.ToString() == Request.Form["Country"]).ToList();
            var objCoun = objCountry[0].StateName;
            vndr.Country = objCoun;
            /////////////////////////////////////Checking category exist or not//////////////////////////////////////////////////////////
            var retrv_qry = _documentSession.Query<Vendor>().Where(x => x.Country == objCoun && x.State == vndr.State && x.City == vndr.City && x.Catgry == vndr.Catgry).Take(50).ToList();
            //////////////////////////////////////take the view in same condition---Part-1--///////////////////////////////////////////
            vndr.StateModel = new List<State1>();
            vndr.StateModel = GetAllState1();
            vndr.Manufacturers = GetManufacturerList();
            /////////////////////////////////////////////////////////////////--Part-2--//////////////////////////////////////
            string address = "", LtLn = "", zip = "";

            for (int i = 0; i < retrv_qry.Count; i++)
            {
                address = address + retrv_qry[i].Address1 + " " + retrv_qry[i].Pin + " " + retrv_qry[i].Phone + "~";
                //  address = address + retrv_qry[i].Address1 + " " + retrv_qry[i].Pin + " " + retrv_qry[i].Phone+Environment.NewLine;
                zip = retrv_qry[i].Pin;
                LtLn = LtLn + retrv_qry[i].Latitude + "," + retrv_qry[i].Longitude + "~";
            }

            if (retrv_qry != null)
            {
                var addrs = new List<String>
                    {
                       address
                       //retrv_qry[0].Address1,
                       //retrv_qry[1].Address1
                    };
                ViewData["addrs"] = addrs;
                /////////////////////////////////////////////////////////
                var addrs2 = new List<String>
                    {
                      LtLn
                    };
                ViewData["lat_lon"] = addrs2;
                /////////////////////////////////////////////////////////
                var addrs3 = new List<String>
                    {
                      zip
                    };
                ViewData["city_zip"] = addrs3;
            }
            else
            {
                var addrs = new List<String>
                    {
                       "No Data"
                    };
                ViewData["addrs"] = addrs;
                ////////////////////////////////////////////////////////
                var addrs2 = new List<String>
                    {
                       "."
                    };
                ViewData["lat_lon"] = addrs2;
                ////////////////////////////////////////////////////////
                var addrs3 = new List<String>
                    {
                       "."
                    };
                ViewData["city_zip"] = addrs3;
            }
            return View(vndr);
        }
Esempio n. 3
0
        public ActionResult CreateBusiness(Vendor vndr)
        {
            if (Session["user"] != null)
            {
                if (!ModelState.IsValid)
                    //return View();

                vndr.Country = "";
                List<State1> objCountry = new List<State1>();
                objCountry = GetAllState1().Where(m => m.Id.ToString() == Request.Form["Country"]).ToList();
                var objCoun = objCountry[0].StateName;
                vndr.Country = objCoun;
                _documentSession.Store(vndr);
                _documentSession.SaveChanges();
                return RedirectToAction("Business", new { message = string.Format("Business Added Successfully", vndr.Id) });
            }
            else
            {
                return RedirectToAction("Login", "Admin", new { message = string.Format("Please Login Again {0}", "Admin") });
            }
        }
Esempio n. 4
0
        public ActionResult EditBusiness(Vendor bsn)
        {
            if (Session["user"] != null)
            {
                if (!ModelState.IsValid)

                    _documentSession.Store(bsn);
                _documentSession.SaveChanges();
                return RedirectToAction("Business", new { message = string.Format("Saved changes to Business {0}", bsn.Id) });
            }
            else
            {
                return RedirectToAction("Login", "Admin", new { message = string.Format("Please Login Again {0}", "Admin") });
            }
        }
Esempio n. 5
0
 public ActionResult CreateBusiness(FormCollection collection)
 {
     if (Session["user"] != null)
     {
         Vendor vd = new Vendor();
         vd.Manufacturers = GetManufacturerList();
         vd.StateModel = new List<State1>();
         vd.StateModel = GetAllState1();
         return View(vd);
     }
     else
     {
         return RedirectToAction("Login", "Admin", new { message = string.Format("Please Login Again {0}", "Admin") });
     }
 }
Esempio n. 6
0
        public ActionResult CreateVendor(Vendor vndr, FormCollection formCollection)
        {
            if (Session["vendor"] != null)
            {

                if (!ModelState.IsValid)

                vndr.Country = "";
                List<State1> objCountry = new List<State1>();
                objCountry = GetAllState1().Where(m => m.Id.ToString() == Request.Form["Country"]).ToList();
                var objCoun = objCountry[0].StateName;
                vndr.Country = objCoun;
                _documentSession.Store(vndr);
                _documentSession.SaveChanges();

                return RedirectToAction("vendor", new { message = string.Format("Created Vendor {0}", vndr.CompanyName) });
            }
            else
            {
                return RedirectToAction("LogOff", new { message = string.Format("Successfully Logged Off") });
            }
            //return View();
        }
Esempio n. 7
0
        public ActionResult CreateVendor(FormCollection collection, Category cat)
        {
            if (Session["vendor"] != null)
            {

                Vendor vd = new Vendor();
                vd.Manufacturers = GetManufacturerList();
                vd.StateModel = new List<State1>();
                vd.StateModel = GetAllState1();
                vd.EMailUser = Session["vendor"].ToString();
                var move = _documentSession.Load<Mov>();
                return View(vd);
            }
            else
            {
                return RedirectToAction("LogOff", new { message = string.Format("Successfully Logged Off") });
            }
        }
Esempio n. 8
0
        public ActionResult VendorList(Vendor move, LoginPage lg)
        {
            if (Session["vendor"] != null)
            {
                var mov = _documentSession.Query<Vendor>().Where(x => x.EMailUser == Session["vendor"].ToString()).Take(50).ToList();

                //var mov = _documentSession.Query<Vendor>()
                //     .Customize(x => x.WaitForNonStaleResults())
                //     .Take(50).ToList();

                return View(mov);
            }
            else
            {
                return RedirectToAction("LogOff", new { message = string.Format("Please Login Again") });
                //return View();
            }
        }
Esempio n. 9
0
        public ActionResult VendorEdit(Vendor vndr)
        {
            if (Session["vendor"] != null)
            {
                if (!ModelState.IsValid)
                {
                    _documentSession.Store(vndr);
                    _documentSession.SaveChanges();
                }
                return RedirectToAction("Vendor", new { message = string.Format("Saved changes to Business {0}", vndr.Id) });

            }
            else
            {
                return RedirectToAction("LogOff", new { message = string.Format("Please Login Again {0}", vndr.Name) });
            }
        }