public ActionResult SView(String SupID)
 {
     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 (SupID != null)
         {
             String DecSupID = BAL.Security.URLDecrypt(SupID);
             SupplyList supplier = new SupplyList();
             if ((DecSupID != "0") && (DecSupID != null))
             {
                 supplier = BAL.SupplyModel.ViewSupply(DecSupID);
             }
             return View(supplier);
         }
         else
         { return RedirectToAction("Index", "Supplier"); }
     }
     else
     { return RedirectToAction("Index", "Home"); }
 }
Beispiel #2
0
 public static SupplyList ViewSupply(Int64 SupplyID)
 {
     SupplyList objunit = new SupplyList();
     using (var context = new SycousCon())
     {
         try
         {
             objunit = (from S in context.Suppliers
                        join C in context.ClientMasters
                           on S.ClientID equals C.ClientID
                        join L in context.SiteMasters
                        on S.SiteID equals L.Id
                        join E in context.Energies
                         on S.EnergyID equals E.ID
                        join U in context.UnitMasters
                        on S.UnitID equals U.ID
                        where (S.IsDeleted == 0 && S.ID == SupplyID)
                        select new SupplyList
                        {
                            SupplierID = SqlFunctions.StringConvert((Double)S.ID),
                            Client = C.Name,
                            Site = L.SiteName,
                            Energy = E.EnergyName,
                            Unit = U.UnitCode,
                            Multiplier = S.Volume
                        }).FirstOrDefault();
             if (objunit != null)
             { return objunit; }
             else
             {
                 objunit = null;
                 return objunit;
             }
         }
         catch (Exception ex)
         {
             context.Dispose();
             throw;
         }
     }
 }
Beispiel #3
0
 public Object ViewRecord(Int64 SupplyID)
 {
     DAL.SupplyList vwSupply = new DAL.SupplyList();
     try
     {
         vwSupply = DAL.DALSupplier.ViewSupply(Convert.ToInt64(SupplyID));
     }
     catch (Exception ex)
     {
         throw;
     }
     return vwSupply;
 }
Beispiel #4
0
        public static SupplyList SupplierView(String ClintID)
        {
            SupplyList supplyList = new SupplyList();
            using (var context = new SycousCon())
            {
                try
                {
                    var parmode = new SqlParameter
                    {
                        ParameterName = "mode",
                        Value = 1,
                        Direction = ParameterDirection.Input
                    };

                    var parClint = new SqlParameter
                    {
                        ParameterName = "ClientID",
                        Value = ClintID,
                        Direction = ParameterDirection.Input
                    };
                    //supplyList = context.ExecuteStoreQuery<SupplyList>("exec [SYCOUS].[[PropertyDetails]] @mode,@ClientID", parmode, parClint).FirstOrDefault();
                    supplyList = context.ExecuteStoreQuery<SupplyList>("exec [SYCOUS].[SupplierDetails] @mode,@ClientID", parmode, parClint).FirstOrDefault();

                    return supplyList;
                }
                catch (Exception ex)
                {
                    context.Dispose();
                    throw;
                }
            }
        }