Exemplo n.º 1
0
        public ActionResult MyProduct(IFormCollection fr)
        {
            ISVContext     context = HttpContext.RequestServices.GetService(typeof(ISV.Models.ISVContext)) as ISVContext;
            classviewmodel cv      = new classviewmodel();
            CompanyRecords cr      = new CompanyRecords();

            cr.id = Int32.Parse(fr["id"]);
            // cr.user_id == Int32.Parse(fr["user_id"]);
            cr.product_name         = fr["product_name"].ToString();
            cr.description          = fr["description"].ToString();
            cr.category             = fr["Category"].ToString();
            cr.modules              = fr["module"].ToString();
            cr.metatags             = fr["meta_tag"].ToString();
            cr.geographical_focus   = fr["geographical_focus"].ToString();
            cr.target_job_titles    = fr["target_job_titles"].ToString();
            cr.target_industry_type = fr["target_company_type"].ToString();
            cr.target_campany_size  = fr["target_campany_size"].ToString();
            cr.dept_user_type       = fr["dep_user_type"].ToString();
            cr.semantic             = fr["semantic"].ToString();
            cr.cognitive            = fr["cognitive"].ToString();

            var value = HttpContext.Session.GetObjectFromJson <List <Role_Permission> >("role1");

            cv.rolelist = value;
            var usernm = HttpContext.Session.GetObjectFromJson <List <User> >("userid");

            cv.usernm = usernm;
            context.updateproduct(cr, cv);
            List <CompanyRecords> a = context.GetMyProduct(cv);

            ViewBag.myproduct = a;
            cv.myproduct      = context.myproduct(cv);
            return(View(cv));
        }
Exemplo n.º 2
0
        public ActionResult MyProduct()
        {
            ISVContext     context = HttpContext.RequestServices.GetService(typeof(ISV.Models.ISVContext)) as ISVContext;
            classviewmodel cv      = new classviewmodel();
            var            value   = HttpContext.Session.GetObjectFromJson <List <Role_Permission> >("role1");

            cv.rolelist = value;
            var usernm = HttpContext.Session.GetObjectFromJson <List <User> >("userid");

            cv.usernm = usernm;
            List <CompanyRecords> a = context.GetMyProduct(cv);

            ViewBag.myproduct = a;
            cv.myproduct      = context.myproduct(cv);
            var mypro = cv.myproduct.ToString();

            HttpContext.Session.SetString("mypro", mypro);
            return(View(cv));
        }
Exemplo n.º 3
0
        public IActionResult Login(IFormCollection fr)
        {
            ISVContext     context = HttpContext.RequestServices.GetService(typeof(ISV.Models.ISVContext)) as ISVContext;
            classviewmodel cv      = new classviewmodel();
            User           u       = new User();
            CompanyRecords cr      = new CompanyRecords();

            u.Username  = fr["uname"].ToString();
            u.Password  = fr["psw"].ToString();
            cv.rolelist = context.loguser(u);
            List <Role_Permission> role1 = cv.rolelist;

            HttpContext.Session.SetObjectAsJson("role1", role1);
            cv.usernm = context.getuserid(u);
            List <User> userid = cv.usernm;

            HttpContext.Session.SetObjectAsJson("userid", userid);
            cv.myproduct = context.myproduct(cv);
            //HttpContext.Session.SetObjectAsJson("mypro",cv.myproduct);
            //Session["mypro"] = cv.myproduct;
            //var count = cv.myproduct.Count();
            var mypro = cv.myproduct.ToString();

            HttpContext.Session.SetString("mypro", mypro);
            //List<CompanyRecords> myproduct = cv.myproduct;
            if (cv.rolelist != null)
            {
                HttpContext.Session.SetString("username", u.Username);
                return(View("index", cv));
            }
            else
            {
                ModelState.AddModelError("Error", "Your username or password was incorrect.");
                return(View("Login"));
            }
        }