Esempio n. 1
0
        // GET: SetupProcessTest
        public ActionResult Step1(int?edit)
        {
            Session["userId"] = 229;

            if (Session["userId"] == null || Session["userId"].ToString() == "")
            {
                return(RedirectToAction("UserLogin", "Login"));
            }

            int           userId = Convert.ToInt32(Session["userId"]);
            CompanyAccess ca     = new CompanyAccess();
            StepAccess    sa     = new StepAccess();
            // Get company types to list
            List <CompanyType> ctList = ca.GetAllCompanyType();

            ViewBag.TypeId = new SelectList(ctList, "TypeId", "TypeName");

            //Get states to list
            List <State> stateList = ca.GetAllStates();

            ViewBag.StateId = new SelectList(stateList, "StateId", "StateName");

            if (Convert.ToInt32(Session["companyStep"]) == 1 && edit != 1)
            {
                return(View());
            }

            if (edit == 1)
            {
                if (!string.IsNullOrEmpty(Session["userId"].ToString()))
                {
                    userId = Convert.ToInt32(Session["userId"]);
                    //----------
                    Company preCompany = ca.GetCompanyDetailsCompanyId(userData.Company_Id);


                    _comCode     = preCompany.CompanyCode;
                    ViewBag.Edit = "Yes";

                    return(View(preCompany));
                }
            }

            return(RedirectToAction("UserLogin", "Login"));
        }