public static void Insertinvoiceperiods(Createinvoiceperiods item)
        {
            if (item != null)
            {
                item.Uid    = Guid.NewGuid();
                item.num    = Context.customer_services.Where(x => x.status == customer_services.Status.ready).Count();
                item.status = Createinvoiceperiods.Statusinvoiceperiods.Wait;
                Context.Createinvoiceperiods.Add(item);
                Context.SaveChanges();

                foreach (var i in Context.customer_services.Where(x => x.status == customer_services.Status.ready))
                {
                    AssetDbContext add  = new AssetDbContext();
                    var            data = new waterwork.Models.Water_usage()
                    {
                        Uid = Guid.NewGuid(),
                        invoiceperiods_id    = item.Uid,
                        customer_services_id = i.Uid,
                        water_Unit           = 0
                    };
                    add.Water_usage.Add(data);
                    add.SaveChanges();
                }
                ;
            }
        }
Ejemplo n.º 2
0
        public static IEnumerable GetWater_usage_id(Guid id)
        {
            AssetDbContext Context = new AssetDbContext();
            var            item    = Context.Water_usage.Where(x => x.invoiceperiods_id == id && x.water_Unit == 0).ToList();

            return(item.ToList());
        }
Ejemplo n.º 3
0
        public ActionResult Information()
        {
            AssetDbContext Context = new AssetDbContext();
            var            cus     = customer_services.Getcustomer_services();

            return(View(cus));
        }
Ejemplo n.º 4
0
        public static int GetWater_usage_inid(Guid id)
        {
            AssetDbContext Context = new AssetDbContext();
            int            item    = Context.Water_usage.Where(x => x.invoiceperiods_id == id && x.water_Unit == 0).Count();

            return(item);
        }
Ejemplo n.º 5
0
        public ActionResult DocumentViewerPartial()
        {
            AssetDbContext Context = new AssetDbContext();
            string         id      = Session["Uid"].ToString();
            var            pro     = Context.customer_services.Where(x => x.Uid.ToString() == id).ToList();

            return(PartialView("DocumentViewerPartial", pro));
        }
Ejemplo n.º 6
0
 public IssueController(AssetDbContext db)
 {
     _db     = db;
     AssetVM = new AssetViewModel()
     {
         AssetDetails      = _db.AssetDetails.ToList(),
         AssetIssueDetails = new AssetIssueDetails()
     };
 }
Ejemplo n.º 7
0
        public ActionResult AddServicesquantity( )
        {
            AssetDbContext Context = new AssetDbContext();
            string         id      = Url.RequestContext.RouteData.Values["id"].ToString();

            customer_services[] cus = Context.customer_services.Where(x => x.customer_id.ToString() == id).ToArray();

            return(PartialView("AddServicesquantity", cus.ToList()));
        }
        public AssetEntryUnitOfWork(AssetDbContext context)
        {
            _context = context;

            AssetEntry         = new AssetEntryRepository(_context);
            Finance            = new FinanceRepository(_context);
            ServiceOrRepairing = new ServiceOrRepairingRepository(_context);
            Note      = new NoteRepository(_context);
            Attchment = new AttachmentRepository(_context);
        }
Ejemplo n.º 9
0
        public ActionResult ExportDocumentViewer()
        {
            AssetDbContext Context = new AssetDbContext();
            string         id      = Session["Uid"].ToString();
            var            pro     = Context.customer_services.Where(x => x.Uid.ToString() == id).ToList();
            XtraReport1    report  = new XtraReport1();

            report.DataSource = pro;
            return(ReportViewerExtension.ExportTo(report));
        }
Ejemplo n.º 10
0
        public static void Insertcustomer_services(customer_services item)
        {
            AssetDbContext Context = new AssetDbContext();

            if (item != null)
            {
                item.Uid = Guid.NewGuid();
                Context.customer_services.Add(item);
                Context.SaveChanges();
            }
        }
Ejemplo n.º 11
0
        public AssetSetupUnitOfWork(AssetDbContext context)
        {
            _context = context;

            AssetType = new AssetTypeRepository(_context);

            AssetGroup = new AssetGroupRepository(_context);

            AssetManufacurer = new AssetManufactureRepository(_context);

            AssetModel = new AssetModelRepository(_context);
        }
Ejemplo n.º 12
0
        public ActionResult Misterupdate(MVCxGridViewBatchUpdateValues <customer_services, int> updateValues)
        {
            AssetDbContext context = new AssetDbContext();

            foreach (var Item in updateValues.Update)
            {
                var data = context.customer_services.Find(Item.Uid);
                data.status           = customer_services.Status.ready;
                data.meter_id         = Item.meter_id;
                data.meter_First_unit = Item.meter_First_unit;
                context.SaveChanges();
            }
            return(PartialView("MisterDataEditPartialView", waterwork.DAL.DALcustomer_services.Getcustomer_services_Wait()));
        }
Ejemplo n.º 13
0
        public ActionResult Water_usageAdd(Water_usage item)
        {
            AssetDbContext Context = new AssetDbContext();
            var            data    = Context.Water_usage.Find(item.customer_services_id);

            data.invoiceperiods_id = new Guid(Session["invoiceperiods_id"].ToString());
            data.water_Unit        = item.water_Unit;
            Context.SaveChanges();
            Session["invoiceperiods_id"] = data.invoiceperiods_id;
            ViewBag.time = Session["invoiceperiods_id"];
            if (DAL.DALWater_usage.GetWater_usage_inid(data.invoiceperiods_id) == 0)
            {
                var i = Context.Createinvoiceperiods.Find(data.invoiceperiods_id);
                i.status = Statusinvoiceperiods.ready;
                Context.SaveChanges();
                DALbill_Water.bill_Water_Add(data.invoiceperiods_id);
            }
            return(View(DAL.DALWater_usage.GetWater_usage()));
        }
Ejemplo n.º 14
0
        public static void bill_Water_Add(Guid id)
        {
            AssetDbContext Context   = new AssetDbContext();
            var            Water_use = Context.Water_usage.Where(x => x.invoiceperiods_id == id).ToList();

            foreach (var i in Water_use)
            {
                var data = new bill_Water_usage
                {
                    Uid              = Guid.NewGuid(),
                    Water_usage_id   = i.Uid,
                    water_usagefirst = 0,
                    water_usageafter = i.water_Unit,
                    unit             = 0 - i.water_Unit,
                    service_charge   = 15,
                    Minimum_rate     = 35,
                    price            = (0 - i.water_Unit) * 5,
                    status           = bill_Water_usage.Statusbill.Wait
                };
                Context.bill_Water_usage.Add(data);
                Context.SaveChanges();
            }
        }
Ejemplo n.º 15
0
 public AssetLocationUnitOfWork(AssetDbContext context)
 {
     _context      = context;
     AssetLocation = new AssetLocationRepository(_context);
 }
 public AssetGroupUnitOfWork(AssetDbContext context)
 {
     _context   = context;
     AssetGroup = new AssetGroupRepository(_context);
 }
Ejemplo n.º 17
0
 public HrUnitOfWork(AssetDbContext context)
 {
     _context = context;
     Employee = new EmployeeRepository(_context);
 }
Ejemplo n.º 18
0
        public static IEnumerable Getprovince()
        {
            AssetDbContext Context = new AssetDbContext();

            return(Context.province.ToList());
        }
Ejemplo n.º 19
0
        public static IEnumerable Getcustomer_services()
        {
            AssetDbContext Context = new AssetDbContext();

            return(Context.customer_services.ToList());
        }
Ejemplo n.º 20
0
        public static IEnumerable GetUserProfile(string id)
        {
            AssetDbContext Context = new AssetDbContext();

            return(Context.customers.Where(x => x.Uid.ToString() == id).ToList());
        }
Ejemplo n.º 21
0
        public static IEnumerable GetSearchUserProfile()
        {
            AssetDbContext Context = new AssetDbContext();

            return(Context.customers.ToList());
        }
Ejemplo n.º 22
0
 public NoteUnitOfWork(AssetDbContext context)
 {
     _context = context;
     Note     = new NoteRepository(_context);
 }
Ejemplo n.º 23
0
        public static IEnumerable Getplace(int id)
        {
            AssetDbContext Context = new AssetDbContext();

            return(Context.place.Where(x => x.amphur_id == id).ToList());
        }
Ejemplo n.º 24
0
 public GeneralCategoryRepository()
 {
     _context = new AssetDbContext();
 }
 public OrganizationUnitOfWork(AssetDbContext context)
 {
     _context  = context;
     Orgnation = new OrganizationRepository(_context);
     Branch    = new BranchRepository(_context);
 }
Ejemplo n.º 26
0
        public static IEnumerable Getamphur(int id)
        {
            AssetDbContext Context = new AssetDbContext();

            return(Context.amphur.Where(x => x.province_id == id).ToList());
        }
Ejemplo n.º 27
0
 public BranchRepository(AssetDbContext context)
     : base(context)
 {
 }
Ejemplo n.º 28
0
 public Services(AssetDbContext db)
 {
     _Db = db;
 }
 public DesignationUnitOfWork(AssetDbContext context)
 {
     _context    = context;
     Designation = new DesignationRepository(_context);
 }
Ejemplo n.º 30
0
 public AssetRepository(AssetDbContext context)
 {
     _context = context;
 }