예제 #1
0
 public ActionResult LifeStyleEdit()
 {
     if (!string.IsNullOrEmpty(Session["username"] as string))
     {
         if (Session["roleid"].ToString() == "1" || Session["roleid"].ToString() == "4")
         {
             try
             {
                 Salesdata          sd          = new Salesdata();
                 List <SquareSales> squareSales = sd.GetLifeStyledata();
                 ViewBag.comment = sd.GetSalesComments()[1].comment;
                 return(View(squareSales));
             }
             catch (Exception ex)
             {
                 return(View("Error", ex));
             }
         }
         else
         {
             return(View("Accessdenied"));
         }
     }
     else
     {
         return(RedirectToAction("Index", "Login"));
     }
 }
예제 #2
0
        public string Print()
        {
            Salesdata sd    = new Salesdata();
            Sales     sales = new Sales();

            sales.SquareSales = sd.GetSquareSalesdata();
            sales.LifeStyles  = sd.GetLifeStyledata();
            sales.Comments    = sd.GetSalesComments();
            return(new PageOrientations().RenderRazorViewToString(this, "Print", sales));
        }
예제 #3
0
 // GET: Sales
 public ActionResult Index()
 {
     if (!string.IsNullOrEmpty(Session["username"] as string))
     {
         try
         {
             Salesdata sd    = new Salesdata();
             Sales     sales = new Sales();
             sales.SquareSales = sd.GetSquareSalesdata();
             sales.LifeStyles  = sd.GetLifeStyledata();
             sales.Comments    = sd.GetSalesComments();
             return(View(sales));
         }
         catch (Exception ex)
         {
             return(View("Error", ex));
         }
     }
     else
     {
         return(RedirectToAction("Index", "Login"));
     }
 }