Ejemplo n.º 1
0
        public ActionResult PharmacyBillReport(string date_from, string date_to)
        {
            List <BillDetails> BillList = new List <BillDetails>();
            Property           p        = new Property();
            DataSet            ds       = new DataSet();

            p.OnTable    = "GetBillRecord";
            p.Condition1 = date_from;
            p.Condition2 = date_to;
            ds           = dl.GetBillReport_sp(p);
            try
            {
                foreach (DataRow item in ds.Tables[0].Rows)
                {
                    BillDetails m = new BillDetails();

                    m.BillNo     = item["BillNo"].ToString();
                    m.Date       = item["Date"].ToString();
                    m.EmployeeId = item["EmployeeId"].ToString();
                    m.FullName   = item["FullName"].ToString();
                    m.Name       = item["Name"].ToString();
                    m.Total      = item["Total"].ToString();

                    BillList.Add(m);
                }
                ViewBag.BillList = BillList;
            }
            catch (Exception ex)
            {
            }
            return(View());
        }
Ejemplo n.º 2
0
 public PDC()
 {
     SysDate     = DateTime.Now;
     BillDetails = new BillDetails();
     references  = new TRNReferences();
     country     = new Country();
 }
Ejemplo n.º 3
0
        public IActionResult SaveBill(CustomModelBag modelBag)
        {
            int  outletId = int.Parse(User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Actor)?.Value);
            int  staffid  = int.Parse(User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.PrimarySid)?.Value);
            Bill newbill  = new Bill();

            newbill.BillId        = (int)DateTime.Now.GetHashCode();
            newbill.Date          = DateTime.Now;
            newbill.TotalPayable  = TotalAmount;
            newbill.PaymentMethod = "Sold";
            newbill.StaffId       = staffid;
            newbill.BuyerId       = BuyerId;
            db.Bill.Add(newbill);
            db.SaveChanges();
            BillDetails billDetails = new BillDetails();

            foreach (var item in billdetails)
            {
                billDetails.Id        = DateTime.Now.GetHashCode() + staffid.GetHashCode();
                billDetails.BillId    = newbill.BillId;
                billDetails.ProductId = item.ProductId;
                billDetails.Quantity  = item.Quantity;
                billDetails.Amount    = item.Amount;
                db.BillDetails.Add(billDetails);
                db.SaveChanges();
            }
            billdetails.Clear();
            TotalAmount = 0;
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        private void CreateDatabaseOrModifyDatabase(List <VehicleDetails> vehicleList)
        {
            DeleteDatabase(FuelDB.Singleton.DBPath);
            FuelDB.Singleton.CreateTable <VehicleDetails>();
            FuelDB.Singleton.CreateTable <BillDetails>();

            //FuelDB.Singleton.CreateDatabase<Fuel>();

            var details = vehicleList?.First();

            vehicleList.RemoveAt(0);
            var billDetails = new BillDetails
            {
                AvailableLiters   = details.VID,
                BillCurrentNumber = details.DriverID_PK,
                BillPrefix        = details.RegNo,
                DeviceStatus      = details.DriverName
            };

            AppPreferences.SaveString(this, Utilities.DEVICESTATUS, billDetails.DeviceStatus);
            AppPreferences.SaveBool(this, Utilities.IsDownloaded, true);
            FuelDB.Singleton.InsertValues(vehicleList);
            btnDownloadData.Clickable = false;
            FuelDB.Singleton.InsertBillDetails(billDetails);
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> PutBillDetail(int id, BillDetails billDetail)
        {
            if (id != billDetail.id)
            {
                return(BadRequest());
            }

            _context.Entry(billDetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BillDetailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 6
0
        // GET: Invoices/Details/5
        public ActionResult Details(int id)
        {
            List <DataPoint> dataPoints = new List <DataPoint>();
            BillDetails      res        = CallApi.Get(Request.Cookies["jwt"], "bills/details", id.ToString()).Content.ReadAsAsync <BillDetails>().Result;

            Dictionary <string, double> keyValuePairs = new Dictionary <string, double>();

            foreach (ProductDetails productDetails in res.ProductDetails)
            {
                foreach (WasteDiscount productWaste in productDetails.WasteDiscounts)
                {
                    if (!keyValuePairs.ContainsKey(productWaste.Waste.Name))
                    {
                        keyValuePairs.Add(productWaste.Waste.Name, productWaste.DiscountedAmount * productWaste.Waste.RecyclingPrice);
                    }
                    else
                    {
                        keyValuePairs[productWaste.Waste.Name] += productWaste.DiscountedAmount * productWaste.Waste.RecyclingPrice;
                    }
                }
            }
            foreach (var x in keyValuePairs)
            {
                dataPoints.Add(new DataPoint(x.Key, x.Value));
            }

            ViewBag.DataPoints = JsonConvert.SerializeObject(dataPoints);

            return(View(res));
        }
Ejemplo n.º 7
0
        public async Task <BillDetails> FetchBillDetailsAsync(string billSlug)
        {
            HttpClient client = new HttpClient();

            client.DefaultRequestHeaders.Add("X-API-Key", "hxY9fxmPmO7Ev1UT6KUlbYaPVKM5v619B2DWRjIY");

            var url     = $"https://api.propublica.org/congress/v1/116/bills/{billSlug}.json";
            var results = await client.GetAsync(url);

            var stringResults = await results.Content.ReadAsStringAsync();

            var propublicaBillDetails = JsonConvert.DeserializeObject <PropublicaBillDetails>(stringResults);
            var billDetails           = new BillDetails
            {
                BillId            = propublicaBillDetails.Results[0].BillId,
                BillNumber        = propublicaBillDetails.Results[0].Number,
                BillTitle         = propublicaBillDetails.Results[0].Title,
                IntroducedDate    = propublicaBillDetails.Results[0].IntroducedDate,
                HousePassage      = propublicaBillDetails.Results[0].HousePassage,
                SenatePassage     = propublicaBillDetails.Results[0].SenatePassage,
                Enacted           = propublicaBillDetails.Results[0].Enacted,
                Vetoed            = propublicaBillDetails.Results[0].Vetoed,
                SummaryShort      = propublicaBillDetails.Results[0].SummaryShort,
                Summary           = propublicaBillDetails.Results[0].Summary,
                CongressdotgovUrl = propublicaBillDetails.Results[0].CongressdotgovUrl,
                GovtrackUrl       = propublicaBillDetails.Results[0].GovtrackUrl,
                BillUri           = propublicaBillDetails.Results[0].BillUri
            };

            return(billDetails);
        }
Ejemplo n.º 8
0
        public ActionResult AddSubCategoryToCategory(BillDetailViewModel model)
        {
            List <BillDetails> details = new List <BillDetails>();

            for (int i = 0; i < model.lstDetails.Count; i++)
            {
                for (int j = 0; j < model.lstDetails[i].lstSubCategory.Count; j++)
                {
                    if (model.lstDetails[i].lstSubCategory[j].Quantity == 0 || model.lstDetails[i].lstSubCategory[j].Quantity == null)
                    {
                    }
                    else
                    {
                        BillDetails billdetails = new BillDetails();

                        billdetails.ChallanId = model.ChallanId;
                        billdetails.BillId    = model.BillId;

                        billdetails.CategoryId = model.lstDetails[i].CategoryId;

                        billdetails.SubCategoryId = model.lstDetails[i].lstSubCategory[j].SubCategoryId;

                        billdetails.Quantity = Convert.ToDecimal(model.lstDetails[i].lstSubCategory[j].Quantity);

                        details.Add(billdetails);
                    }
                }
            }

            challanDAL.AddSubCategory(details);
            TempData["SuccessMsg"] = "Bill Created Successfully";

            return(RedirectToAction("Index"));
        }
 /// <summary>
 /// Instantiate all objects used globally
 /// </summary>
 public FunctionalTest()
 {
     _bill = new BillDetails
     {
         Title       = "Electricity Bill",
         Catagory    = BillCategory.Office,
         Amount      = 5000,
         DateOfEntry = DateTime.Now,
         DueDate     = DateTime.Now.AddDays(15),
         PaymentMode = BillPaymentMode.Bank_Transfer,
         Status      = BillStatus.Unpaid
     };
     _user = new User
     {
         UserName        = "******",
         Password        = "******",
         ConfirmPassword = "******",
         Email           = "*****@*****.**",
         UserType        = UserType.Visitor
     };
     config  = new ConfigurationBuilder().AddJsonFile("appsettings.test.json").Build();
     _server = new TestServer(new WebHostBuilder()
                              .UseStartup <Startup>());
     _client = _server.CreateClient();
 }
Ejemplo n.º 10
0
        public BillDetails CreateBill(BillDetails bill)
        {
            var entity = new Entities.Bill()
            {
                Created = bill.Created,
                Partner = bill.Partner != null?Partners
                          .Single(x => x.Id == bill.Partner.Id) : null,
                              Condominium = bill.Condominium != null?Condominiums
                                            .Single(x => x.Id == bill.Condominium.Id) : null,
                                                Description     = bill.Description,
                                                Serial          = bill.Serial,
                                                PaymentDeadline = bill.PaymentDeadline,
                                                Done            = bill.Done,
                                                Items           = bill.Items
                                                                  .Select(x => new Entities.BillItem()
                {
                    Description = x.Description, Price = x.Price
                })
                                                                  .ToList(),
                                                Tags = bill.Tags
                                                       .Select(x => new BillTag()
                {
                    Label = x.Label, Ratio = x.Rate
                })
                                                       .ToList()
            };

            DbContext.Add(entity);
            DbContext.Add(entity.Tags);
            DbContext.Add(entity.Items);
            DbContext.SaveChanges();

            return(entity.ToModelWithItems());
        }
        public BoundaryTest()
        {
            _bill = new BillDetails
            {
                Title       = "Electricity Bill",
                Catagory    = BillCategory.Office,
                Amount      = 1000,
                DateOfEntry = DateTime.Now,
                DueDate     = DateTime.Now.AddDays(30),
                PaymentMode = BillPaymentMode.Bank_Transfer,
                Status      = BillStatus.Unpaid
            };

            _user = new User
            {
                UserName        = "******",
                Password        = "******",
                ConfirmPassword = "******",
                Email           = "*****@*****.**",
                UserType        = UserType.Visitor
            };
            _userLogin = new UserLogin
            {
                UserName = "******",
                Password = "******",
            };
            MongoDBUtility mongoDBUtility = new MongoDBUtility();

            context         = mongoDBUtility.MongoDBContext;
            _userRepository = new UserRepository(context);
            _billRepository = new BillRepository(context);
            _userService    = new UserService(_userRepository);
            _billService    = new BillService(_billRepository);
            config          = new ConfigurationBuilder().AddJsonFile("appsettings.test.json").Build();
        }
Ejemplo n.º 12
0
        public async Task <ActionResult <object> > GetBillDetails(int id)
        {
            var bill = await _context.Bills.FindAsync(id);

            if (bill == null)
            {
                return(NotFound());
            }
            var result = new BillDetails
            {
                Bill           = bill,
                ProductDetails = _context.BillProducts.Where(x => x.BillId == bill.BillId)
                                 .Select(y => new ProductDetails {
                    Product        = y.Product,
                    Amount         = y.Amount,
                    WasteDiscounts = _context.BillProductWastes.Where(z => z.BillProductId == y.Id)
                                     .Select(z => new WasteDiscount {
                        Waste = z.Waste, DiscountedAmount = z.DiscountedAmount
                    }).ToList()
                }).ToList(),
            };


            return(result);
        }
Ejemplo n.º 13
0
        private void endToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListViewItem item = listviewitem.SelectedItems[0];

            cId = int.Parse(item.SubItems[0].Text);

            Bill bill = new Bill();

            bill.ComputerId = cId;

            billBLL.GetBillId(bill);

            string dateTime = DateTime.Now.ToShortTimeString();


            Bill bills = new Bill();

            bills.EndTime = DateTime.Parse(dateTime);
            bills.BillID  = StaticClass.BillID;

            billBLL.GetEndTime(bills);

            Computer pc = new Computer();

            pc.ComputerID = cId;

            computers.IsActiveFalse(pc);

            BillDetails bd = new BillDetails();

            bd.ShowDialog();
        }
Ejemplo n.º 14
0
        public void CreateDatabaseOrModifyDatabase(List <VehicleDetails> vehicleList)
        {
            DeleteDatabase(FuelDB.Singleton.DBPath);
            FuelDB.Singleton.CreateTable <VehicleDetails>();
            FuelDB.Singleton.CreateTable <BillDetails>();

            var details = vehicleList?.First();

            vehicleList.RemoveAt(0);
            var billDetails = new BillDetails
            {
                AvailableLiters   = details.VID,
                BillCurrentNumber = details.DriverID_PK,
                BillPrefix        = details.RegNo,
                DeviceStatus      = details.DriverName
            };

            AppPreferences.SaveString(this, Utilities.DEVICESTATUS, billDetails.DeviceStatus);
            AppPreferences.SaveBool(this, Utilities.IsDownloaded, true);
            FuelDB.Singleton.InsertValues(vehicleList);
            btnDownloadData.Clickable = false;
            FuelDB.Singleton.InsertBillDetails(billDetails);

            RunOnUiThread(() =>
            {
                loader.Visibility = Android.Views.ViewStates.Gone;
                mainHolder.Alpha  = 1f;
                Window.ClearFlags(Android.Views.WindowManagerFlags.NotTouchable);
                Toast.MakeText(this, "success..", ToastLength.Short).Show();
                btnDownloadData.Clickable = false;
                AppPreferences.SaveBool(this, Utilities.IsDownloaded, true);
            });
            ExceptionLog.LogDetails(this, "Database created successfully");
        }
Ejemplo n.º 15
0
        public async Task <ActionResult <BillDetails> > PostBillDetail(BillDetails billDetails)
        {
            _context.BillDetails.Add(billDetails);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetBillDetail", new { id = billDetails.id }, billDetails));
        }
Ejemplo n.º 16
0
        public static bool ThemChiTietHoaDon(BillDetails cthd)
        {
            bool   kq;
            string sql = string.Format("insert into BillDetails values ({0}, {1}, {2}, {3}. {4}, {5})", cthd.Id_bill, cthd.Id_pro, cthd.Qty, cthd.Price, cthd.Discount, cthd.Amount);

            kq = SqlDataAccessHelper.ExecuteNonQuery(sql);
            return(kq);
        }
Ejemplo n.º 17
0
        // POST: api/DownloadCopy
        public IHttpActionResult Post([FromBody] BillDetails bills, [FromUri] string domainType)
        {
            //List<BillDetails> lst = new List<BillDetails>();
            //List<BillDetails> downloadedBills = new List<BillDetails>();
            string strBaseFilePath = null;

            byte[]          Filebytes     = null;
            List <FileData> lstActualData = new List <FileData>();

            try
            {
                GoGreenService         service     = new GoGreenService();
                IEnumerable <FileData> lstFileData = service.GetBillFiles(bills.billNumber, "");
                foreach (FileData data in lstFileData)
                {
                    try
                    {
                        strBaseFilePath = null;
                        Filebytes       = null;
                        string[] SplitFilePath = data.FilePath.Replace('\\', '/').Split('/');
                        strBaseFilePath = data.PhysicalBasePath;
                        string NodeType = StringExtensions.GetNodeType(data.NodeType);
                        if (NodeType == "")
                        {
                            NodeType = "UNCATEGORIZED";
                        }


                        if (File.Exists(strBaseFilePath + data.FilePath))
                        {
                            Filebytes = File.ReadAllBytes(strBaseFilePath + data.FilePath);
                        }
                        FileData fileObject = new FileData();
                        fileObject.FileName    = SplitFilePath[SplitFilePath.Length - 1];
                        fileObject.BasePathId  = data.BasePathId;
                        fileObject.FilePath    = data.FilePath.Replace('\\', '/');
                        fileObject.NodeType    = NodeType;
                        fileObject.FileContent = Filebytes;

                        lstActualData.Add(fileObject);
                        service.UpdateBillStatus(bills.companyId, bills.billNumber, bills.LawFirmId);
                    }
                    catch (Exception ex)
                    {
                        log.Error("Error" + ex.Message + ex.StackTrace);
                    }
                }


                return(Ok(lstActualData));
            }
            catch (Exception ex)
            {
                log.Error("Error" + ex.Message + ex.StackTrace);
                return(Ok(lstActualData));
            }
        }
Ejemplo n.º 18
0
 public BillDetails CreateBill(BillDetails bill)
 {
     if (bill == null)
     {
         throw new ArgumentNullException("bill");
     }
     bill.Id = _nextId++;
     Bills.Add(bill);
     return(bill);
 }
        public void Delete(BillDetails obj)
        {
            ClearParameter();


            AddParameter("@billid", obj.BillId);
            AddParameter("@menuitemid", obj.MenuItemId);

            FetchData("sp_Delete_TempBillDetails");
        }
Ejemplo n.º 20
0
        public BillDetails Post([FromBody] BillDetails bill)
        {
            Console.WriteLine(bill);
            Console.WriteLine("bill/post");
            if (bill.Created is null)
            {
                bill.Created = DateTime.Now;
            }

            return(BillService.CreateBill(bill));
        }
Ejemplo n.º 21
0
        public static void CreateBill(BillDetails billDetails)
        {
            string FileName = @"./DataManagement/Bills/";

            FileName += billDetails.bill.BillId.ToString() + ".bin";
            Stream          SaveFileStream = File.Create(FileName);
            BinaryFormatter serializer     = new BinaryFormatter();

            serializer.Serialize(SaveFileStream, billDetails);
            SaveFileStream.Close();
        }
Ejemplo n.º 22
0
 public override int InsertOrUpdate(BillDetails obj)
 {
     try
     {
         new DalBillDetails().InsertOrUpdate(obj);
         return(1);
     }
     catch (Exception)
     {
         return(0);
     }
 }
 public int DeleteData(BillDetails obj)
 {
     try
     {
         new DalTempBillDetails().Delete(obj);
         return(1);
     }
     catch (Exception)
     {
         return(0);
     }
 }
Ejemplo n.º 24
0
        public BillDetails GetOwnerUIControl()
        {
            BillDetails ret = null;

            if (UIControl != null)
            {
                if (UIControl is BillDetails)
                {
                    ret = (BillDetails)UIControl;
                }
            }
            return(ret);
        }
        public async Task <ActionResult <bool> > GenerateBill(BillDetails billDetails)
        {
            try
            {
                var result = await _billService.SaveBillAsync(billDetails);

                return(result);
            }
            catch (Exception exception)
            {
                return(BadRequest(exception.ToString()));
            }
        }
Ejemplo n.º 26
0
        private void txtid_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e != null && e.KeyChar == 13)
            {
                string pid = txtid.Text;
                if (bus.checkExistProduct(pid) == true)
                {
                    Product             p = bus.getProduct(pid);
                    BillDetailWithTotal d = new BillDetailWithTotal();
                    d.ProductCode = p.ProductCode;
                    //d.ProductCode = p.ProductName;
                    d.UnitPrice = p.PriceHistories.Last().Price;
                    d.Number    = int.Parse(nud_Number.Text);
                    d.Subtotal  = d.Number * d.UnitPrice;
                    BillDetails.Add(d);
                    lstManageBillIn.DataSource = null;
                    lstManageBillIn.DataSource = BillDetails;
                    lstManageBillIn.Columns["Bill"].Visible           = false;
                    lstManageBillIn.Columns["Product"].Visible        = false;
                    lstManageBillIn.Columns["BallotNum"].Visible      = false;
                    lstManageBillIn.Columns["ProductCode"].HeaderText = "Tên sản phẩm";
                    lstManageBillIn.Columns["UnitPrice"].HeaderText   = "Đơn giá";
                    lstManageBillIn.Columns["Number"].HeaderText      = "Số lượng";
                    lstManageBillIn.Columns["Subtotal"].HeaderText    = "Thành tiền";
                    lstManageBillIn.Columns["Subtotal"].DisplayIndex  = 4;
                    txtid.Text      = "";
                    nud_Number.Text = "1";
                }
                else
                {
                    MessageBox.Show("Vui lòng nhập đúng mã sản phẩm");
                }
            }
            //tính thành tiền
            int    sc        = lstManageBillIn.Rows.Count;
            double thanhtien = 0;

            for (int i = 0; i < sc; i++)
            {
                thanhtien += double.Parse(lstManageBillIn.Rows[i].Cells["Subtotal"].Value.ToString());
            }
            txt_Total.Text = Convert.ToString(thanhtien);
            //tính tổng số lượng
            int numproduct = 0;

            for (int j = 0; j < sc; j++)
            {
                numproduct += int.Parse(lstManageBillIn.Rows[j].Cells["Number"].Value.ToString());
            }
            txt_TotalNum.Text = Convert.ToString(numproduct);
        }
Ejemplo n.º 27
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                btnUpdate.Enabled   = false;
                cmbMenuItem.Enabled = true;

                BillDetails billDetails = new BillDetails();
                billDetails.BillId              = _billId;
                billDetails.MenuItemId          = Convert.ToInt32(ListView1.FocusedItem.SubItems[1].Text);
                billDetails.Quantity            = Convert.ToInt32(txtSaleQty.Text);
                billDetails.UnitPrice           = Convert.ToDecimal(ListView1.FocusedItem.SubItems[3].Text);
                billDetails.IsDiscountAvailable = false;
                billDetails.TotalPrice          = Convert.ToDecimal(txtTotalAmount.Text);
                billDetails.ReceivedBy          = BaseObject.User_ID;
                billDetails.IsDeleted           = false;

                new BllTempBillDetails().InsertOrUpdate(billDetails);

                for (int j = 0; j <= ListView1.Items.Count - 1; j++)
                {
                    if (ListView1.Items[j].SubItems[1].Text == ListView1.FocusedItem.SubItems[1].Text)
                    {
                        ListView1.Items[j].SubItems[3].Text = txtPrice.Text;
                        ListView1.Items[j].SubItems[4].Text = txtSaleQty.Text;
                        ListView1.Items[j].SubItems[5].Text = txtTotalAmount.Text;
                        txtSubTotal.Text = subtot().ToString();
                        Calculate();

                        BillInfo billInfo = createBillInfoObject();

                        new BllBillInfo().InsertOrUpdate(billInfo);

                        cmbMenuItem.Text    = "";
                        txtPrice.Text       = "";
                        txtSaleQty.Text     = "";
                        txtTotalAmount.Text = "";

                        //cmbMenuItem.Focus();
                        txtMenuCode.Focus();
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                KryptonMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 28
0
        public void InsertOrUpdate(BillDetails obj)
        {
            ClearParameter();


            AddParameter("@billdetailid", obj.BillDetailId);
            AddParameter("@billid", obj.BillId);
            AddParameter("@menuitemid", obj.MenuItemId);
            AddParameter("@quantity", obj.Quantity);
            AddParameter("@unitprice", obj.UnitPrice);
            AddParameter("@isdiscountavailable", obj.IsDiscountAvailable);
            AddParameter("@totalprice", obj.TotalPrice);
            AddParameter("@receivedby", 1);

            FetchData("sp_InsertUpdate_BillDetails");
        }
        public override BillDetails LoadFromReader(DataTableReader reader)
        {
            var temp = new BillDetails();

            if (reader != null && !reader.IsClosed)
            {
                temp.BillDetailId = reader.GetInt32(0);
                if (!reader.IsDBNull(1))
                {
                    temp.BillId = reader.GetInt32(1);
                }
                if (!reader.IsDBNull(2))
                {
                    temp.MenuItemId = reader.GetInt32(2);
                }
                if (!reader.IsDBNull(3))
                {
                    temp.Quantity = reader.GetInt32(3);
                }
                if (!reader.IsDBNull(4))
                {
                    temp.UnitPrice = reader.GetDecimal(4);
                }
                if (!reader.IsDBNull(5))
                {
                    temp.IsDiscountAvailable = reader.GetBoolean(5);
                }
                if (!reader.IsDBNull(6))
                {
                    temp.TotalPrice = reader.GetDecimal(6);
                }
                if (!reader.IsDBNull(7))
                {
                    temp.ReceivedBy = reader.GetInt32(7);
                }
                if (!reader.IsDBNull(8))
                {
                    temp.IsDeleted = reader.GetBoolean(8);
                }
                if (!reader.IsDBNull(9))
                {
                    temp.MenuItemName = reader.GetString(9);
                }
            }

            return(temp);
        }
Ejemplo n.º 30
0
        private void InsertUpadatedBillDetails()
        {
            var bill        = FuelDB.Singleton.GetBillDetails();
            var billall     = bill.First();
            var billDetails = new BillDetails
            {
                AvailableLiters   = ConstantValues.ZERO,
                BillCurrentNumber = (Convert.ToInt32(billall.BillCurrentNumber) + 1).ToString(),
                BillPrefix        = billall.BillPrefix,
                DeviceStatus      = billall.DeviceStatus
            };

            FuelDB.Singleton.DeleteTable <BillDetails>();
            FuelDB.Singleton.CreateTable <BillDetails>();
            FuelDB.Singleton.InsertBillDetails(billDetails);
            availableFuel = 0f;
        }