Exemplo n.º 1
0
        public ActionResult BillLayout(String TemplateID)
        {
            if (Session["Login"] != null)
            {
                LoginSession loginsession = (LoginSession)Session["Login"];
                ViewBag.CompanyLogo = loginsession.CompanyLogo;
                String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
                String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, BAL.Common.LayoutType(loginsession.UserType));

                try
                {
                    if (TemplateID != null)
                    {
                        String DecTemplateID = BAL.Security.URLDecrypt(TemplateID);
                        ConsumerTemplateList template = new ConsumerTemplateList();
                        if ((DecTemplateID != "0") && (DecTemplateID != null))
                        {
                            template = BAL.ConsumerTemplateModel.ViewConsumerTemplate(DecTemplateID);
                        }
                       return PartialView("BillLayout", template);

                    }
                    else
                    { return Content("Select View Of Bill "); }
                }
                catch (Exception ex)
                {
                    return Content("ERROR :" + ex.Message);
                }

            }
            else
            {
                return RedirectToAction("Index", "Home");
            }
        }
Exemplo n.º 2
0
        public static ConsumerTemplateList ViewConsumerTemplate(Int64 ID)
        {
            ConsumerTemplateList objconsumer = new ConsumerTemplateList();
            using (var context = new SycousCon())
            {
                try
                {
                    var parmode = new SqlParameter
                  {
                      ParameterName = "mode",
                      Value = 2,
                      Direction = ParameterDirection.Input
                  };

                    var parTemplateID = new SqlParameter
                    {
                        ParameterName = "TemplateID",
                        Value = ID.ToString(),
                        Direction = ParameterDirection.Input
                    };

                    objconsumer = context.ExecuteStoreQuery<ConsumerTemplateList>("exec [Sycous].[GetAllConsumerTemplate] @mode,@TemplateID", parmode, parTemplateID).FirstOrDefault();
                    return objconsumer;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }
Exemplo n.º 3
0
 public ActionResult TView(String TemplateID)
 {
     if (Session["Login"] != null)
     {
         LoginSession loginsession = (LoginSession)Session["Login"];
         ViewBag.CompanyLogo = loginsession.CompanyLogo;
         ViewBag.Layout1 = BAL.Common.LayoutType(loginsession.UserType);
         String actionName = this.ControllerContext.RouteData.Values["action"].ToString();
         String controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
         ViewBag.Menu = BAL.Common.GetActiveMenu(controllerName, actionName, BAL.Common.LayoutType(loginsession.UserType));
         ViewBag.RoleName = loginsession.RoleName;
         if (TemplateID != null)
         {
             String DecTemplateID = BAL.Security.URLDecrypt(TemplateID);
             ConsumerTemplateList template = new ConsumerTemplateList();
             if ((DecTemplateID != "0") && (DecTemplateID != null))
             {
                 template = BAL.ConsumerTemplateModel.ViewConsumerTemplate(DecTemplateID);
             }
             return View(template);
         }
         else
         { return RedirectToAction("Index", "Template"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }