public ActionResult Detail(String Device, String BILLDT)
        {
            if (Session["Login"] != null)
            {
               // IEnumerable<DAL.EstimatedBillingDevice> List = 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, BAL.Common.LayoutType(loginsession.UserType));

               BAL. EstimatedBillingDeviceModel List = new BAL.EstimatedBillingDeviceModel();
                if ((Device != null) || (BILLDT != null))
                {
                    String DeviceID = BAL.Security.URLDecrypt(Device);
                    String DeBILLDT = BAL.Security.URLDecrypt(BILLDT);
                    if ((DeviceID != "0") && (DeBILLDT != null))
                    {
                        try
                        {

                            List = BAL.EstimatedBillingModel.EstimatedBillingDeviceWiseRecordList(DeviceID, DeBILLDT);
                            return View(List);
                        }
                        catch (Exception ex)
                        { return Content(ex.Message.ToString()); }

                    }
                    else
                    { return RedirectToAction("Index", "EstimatedBilling"); }
                }
                else { return RedirectToAction("Index", "EstimatedBilling"); }

            }
            else
               { return RedirectToAction("Index", "Home"); }
        }
Ejemplo n.º 2
0
        public static EstimatedBillingDeviceModel EstimatedBillingDeviceWiseRecordList(String DeviceID, String BillingDate)
        {
            SelectList objconsumotiontype = new SelectList(DAL.DALConsumptionType.ConsumptionTypeDropDownList(), "Value", "Text");
            EstimatedBillingDeviceModel _objlist = new EstimatedBillingDeviceModel();
            _objlist.EstimatedBillingList = new List<EstimatedBillingDeviceClasss>();

            IEnumerable<DAL.EstimatedBillingDevice> list = DAL.DALEstimatedBilling.GetAllEstimatedBillingDeviceWiseRecordList(DeviceID, BAL.Common.DateGB(BillingDate));

            foreach (var item in list)
            {
               _objlist.EstimatedBillingList.Add(new EstimatedBillingDeviceClasss
                {
                    DeviceID = item.DeviceID,
                    ReadingDate = item.ReadingDate,
                    AMRConsumption = item.AMRConsumption,
                    SGEConsumption = item.SGEConsumption,
                    ManualConsumption = item.ManualConsumption,
                    IsApproved = item.IsApproved,
                    ConsumptionTypeID = item.ConsumptionTypeID,
                    Code = item.Code,
                    BillFromDate = item.BillFromDate,
                    BillTodate = item.BillTodate,
                    ID = item.ID,
                    UnitCode = item.UnitCode,
                    SectionMethod = new SelectList(ConsumptionTypeDropDownList(), "Value", "Text", item.ConsumptionTypeID)
                });

            }
            return _objlist;
        }