예제 #1
0
        //啟用字軌
        public ActionResult RP(int ID)
        {
            Receipts chechData = db.Receipts.Where(p => p.IsEnabled == true).FirstOrDefault();

            if (chechData == null)
            {
                Receipts EditData = db.Receipts.Find(ID);
                EditData.Id            = EditData.Id;
                EditData.Value         = EditData.Value;
                EditData.InvoicePeriod = EditData.InvoicePeriod;
                EditData.Title         = EditData.Title;
                EditData.StartNum      = EditData.StartNum;
                EditData.EndNum        = EditData.EndNum;
                EditData.CurrentNum    = EditData.CurrentNum;
                EditData.IsEnabled     = true;
                db.SaveChanges();
            }
            else
            {
                TempData["Data"] = "已經有啟用中的字軌";
            }
            return(RedirectToAction("Index"));
        }
예제 #2
0
        async Task GetReicipts()
        {
            if (IsBusy)
            {
                return;
            }

            Exception error = null;

            try
            {
                IsBusy = true;

                var service = DependencyService.Get <AzureReceiptService>();
                var items   = await service.GetReceiptsAsync();

                Receipts.Clear();
                foreach (var item in items)
                {
                    Receipts.Add(item);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("Error: " + ex);
                error = ex;
            }
            finally
            {
                IsBusy = false;
            }

            if (error != null)
            {
                await Application.Current.MainPage.DisplayAlert("Error!", error.Message, "OK");
            }
        }
예제 #3
0
        private void SendReceiptByEmail(Tickets ticket)
        {
            var          fromAddress  = new MailAddress("*****@*****.**", "Cinema");
            var          toAddress    = new MailAddress(CurrentUser.email);
            const string fromPassword = "******";
            const string subject      = "Your ticket is formed in.";

            Receipts receipt = new Receipts
            {
                content = $"<p><strong>Your ticket: {ticket.id}</strong></p> <p></p> <p><span style = 'text-decoration: underline;'> Your film: {_database.Films.Single(f=>f.id == ticket.MovieSession.id_film).title}</span> </p> <p><span style='text-decoration: underline;'> Your hall: {ticket.MovieSession.id_hall.ToString()}</span></p><p><span style = 'text-decoration: underline;'> Date: {ticket.MovieSession.date.ToString()}</span></p> <p><span style = 'text-decoration: underline;'> Cinema: {ticket.MovieSession.Cinemas.title}</span></p>"
            };

            _database.Receipts.Add(receipt);

            string body = receipt.content;

            var smtp = new SmtpClient
            {
                Host                  = "smtp.gmail.com",
                Port                  = 587,
                EnableSsl             = true,
                DeliveryMethod        = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials           = new NetworkCredential(fromAddress.Address, fromPassword)
            };

            using (var message = new MailMessage(fromAddress, toAddress)
            {
                Subject = subject,
                Body = body,
                IsBodyHtml = true
            })
            {
                smtp.Send(message);
                StatusText = "Your ticket is ordered. Receipt has sent to your e-mail.";
            }
        }
예제 #4
0
        public ActionResult cardImplement(Receipts d)

        {
            using (GiftCardEntities db = new GiftCardEntities())
            {
                try
                {
                    GiftCards _GiftCard = db.GiftCards.Where(g => g.GiftCardID == d.GiftCardID).FirstOrDefault();
                    if (d.PurchaseAmount == 0)
                    {
                        d.PurchaseAmount = Convert.ToInt32(_GiftCard.Credit);
                        _GiftCard.Credit = 0;
                    }
                    else if (d.PurchaseAmount > 0)
                    {
                        int KeepOriganalCredit = Convert.ToInt32(_GiftCard.Credit);
                        _GiftCard.Credit = d.PurchaseAmount;
                        d.PurchaseAmount = KeepOriganalCredit - d.PurchaseAmount;
                    }
                    else if (d.PurchaseAmount < 0)
                    {
                        d.PurchaseAmount = (d.PurchaseAmount + (Convert.ToInt32(_GiftCard.Credit) * -1)) * -1;
                        _GiftCard.Credit = 0;
                    }
                    _GiftCard.FirstName = "amicam";
                    _GiftCard.Receipts.Add(d);
                    db.SaveChanges();
                }
                catch (Exception)
                {
                    return(Json(new { success = false, errors = true }));
                }

                return(Json(new { success = true, errors = true }));
            }
        }
예제 #5
0
        //新增单据/修改单据(单据状态为待审核状态)
        public ActionResult InvoiceSave(string id)
        {
            ViewBag.types = ListToSelect(SysDataDictService.GetReceiptsCategories().Select(o => new SelectListItem()
            {
                Value = o.DicSN.ToString(), Text = o.Title
            }), emptyTitle: "请选择");
            var supplierForAdd = SupplierService.Find(o => o.Id == Pharos.Sys.SupplierUser.SupplierId);
            var obj            = new Receipts()
            {
                CreateTitle = supplierForAdd.Title, CreateDT = DateTime.Now
            };                                                                                       //CreateTitle = CurrentUser.FullName

            if (!id.IsNullOrEmpty())
            {
                obj = InvoiceBLL.FindById(id);
                obj.IsNullThrow();
                var supplier = SupplierService.Find(o => o.Id == obj.CreateUID);
                if (supplier != null)
                {
                    obj.CreateTitle = supplier.Title;
                }
            }
            return(View(obj));
        }
예제 #6
0
        public void Styling_receipt(Receipts receipt_data, DataTable products)
        {
            load_file();
            // Receipt Header

            styling_table("F2", receipt_data.Client_name, false, false, false, false);
            styling_table("F3", receipt_data.Client_address, false, false, false, false);
            styling_table("D2", receipt_data.Client_phone, false, false, false, false);
            styling_table("D3", receipt_data.Receipt_type, false, false, false, false);
            styling_table("B2", receipt_data.Id, false, false, false, false);
            styling_table("B3", receipt_data.Receipt_date, false, false, false, false);

            // Receipt Table
            int j = 6;

            for (int i = 0; i < products.Rows.Count; i++)
            {
                styling_table("B" + j.ToString(), products.Rows[i]["category"].ToString(),
                              false, false, false, true);
                styling_table("C" + j.ToString(), products.Rows[i]["name"].ToString(),
                              false, false, false, true);
                styling_table("D" + j.ToString(), products.Rows[i]["vendor"].ToString(),
                              false, false, false, true);
                styling_table("E" + j.ToString(), products.Rows[i]["quantity"].ToString(),
                              false, false, false, true);
                styling_table("F" + j.ToString(), products.Rows[i]["price"].ToString(),
                              false, false, false, true);
                styling_table("G" + j.ToString(), products.Rows[i]["total_price"].ToString(),
                              false, false, true, true);

                j++;
            }
            j++;

            // Receipt Footer
            styling_table("B" + j.ToString(), receipt_data.receipt_dis_total,
                          false, false, false, false);
            styling_table("C" + j.ToString(), "الاجمالي بعد الخصم",
                          true, false, false, true);
            styling_table("D" + j.ToString(), receipt_data.receipt_dis + "%",
                          false, false, false, false);
            styling_table("E" + j.ToString(), "الخصم",
                          true, false, false, true);
            styling_table("F" + j.ToString(), receipt_data.receipt_total,
                          false, false, false, false);
            styling_table("G" + j.ToString(), "اجمالي الفاتورة",
                          true, false, true, true);

            j++;

            styling_table("B" + j.ToString(), receipt_data.Newbalance,
                          false, false, false, false);
            styling_table("C" + j.ToString(), "الرصيد الحالي",
                          true, false, false, true);
            styling_table("D" + j.ToString(), receipt_data.Paid,
                          false, false, false, false);
            styling_table("E" + j.ToString(), receipt_data.Pay_type,
                          true, false, false, true);
            styling_table("F" + j.ToString(), receipt_data.Past_Balance,
                          false, false, false, false);
            styling_table("G" + j.ToString(), "الرصيد السابق",
                          true, false, true, true);

            j++;
            j++;
            styling_table("F" + j.ToString(), receipt_data.Readable_balance,
                          false, false, false, false);
            styling_table("G" + j.ToString(), "الرصيد الحالي بالأحرف",
                          true, false, false, true);

            j++;
            j++;

            styling_table("F" + j.ToString(), receipt_data.Notes,
                          false, false, false, false);
            styling_table("G" + j.ToString(), "ملاحظات",
                          true, false, false, true);

            workbook.SaveAs(Environment.GetEnvironmentVariable("belal_file_location", EnvironmentVariableTarget.User) + "\\test1.xlsx");
        }
예제 #7
0
 public Task <Receipt> CreateAsync(Receipt item)
 {
     return(Receipts.CreateAsync(item));
 }
예제 #8
0
 public Receipt Create(Receipt item)
 {
     return(Receipts.Create(item));
 }
예제 #9
0
        public string FTP_ORClackamas(string houseno, string sname, string Dir, string account, string parcelNumber, string searchType, string orderNumber, string ownername, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            string outparcelno = "", address = "", ChkMultiParcel = "", LocationAddress = "", MultiParcelData = "", Authority_Address = "";
            string Property_Address = "", Alternate_Property = "", Property_Description = "", Property_Category = "", Status = "", TaxCode_Area = "", Neighborhood = "", Year_Built = "", Property_Details = "", Assemnt_Details1 = "", Assemnt_Details2 = "";
            string Receipt = "-", Date_Time = "-", Tax_Year = "-", TCA_District = "-", Amount_Applied = "-", Desription = "-", Name = "-", Tender_Type = "-", Receipt_Details = "-", stryearBuilt = "-";
            string authority_Address = "", authority_Mail = "", authority_Details = "";
            string Taxyear = "-", Installment = "-", EarliestDueDate = "-", Principal = "-", InterestCosts = "-", Totaldue = "-", Cummulativedue = "-", TaxBalnce_details = "-";
            string TaxProperty_Address = "-", Taxdetail_Year = "-", Category = "-", TCA_Dist = "-", Charged = "-", Minimum = "-", Balnce_Due = "-", Due_Date = "-", TAXAssement_details, authority_Phone = "";

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");
                    if (searchType == "titleflex")
                    {
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "OR", "Clackamas");
                        if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes"))
                        {
                            driver.Quit();
                            return("MultiParcel");
                        }
                        else if (HttpContext.Current.Session["titleparcel"].ToString() == "")
                        {
                            HttpContext.Current.Session["Nodata_ORClackmas"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }
                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("http://ascendweb.clackamas.us/ascendweb/(S(cisqdyhth2sdnfwpxlheqkqs))/default.aspx");
                        Thread.Sleep(2000);
                        address = houseno + " " + sname;
                        driver.FindElement(By.Id("mStreetAddress")).SendKeys(address);
                        //Screen-Shot
                        gc.CreatePdf_WOP(orderNumber, "AddressSearch", driver, "OR", "Clackamas");
                        driver.FindElement(By.Id("mSubmit")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        try
                        {
                            string norecord = driver.FindElement(By.XPath("//*[@id='mMessage']")).Text;
                            if (norecord.Contains("0 records"))
                            {
                                driver.Navigate().GoToUrl("http://ascendweb.clackamas.us/ascendweb/(S(cisqdyhth2sdnfwpxlheqkqs))/default.aspx");
                                Thread.Sleep(2000);
                                address = houseno + " " + Dir + " " + sname;
                                driver.FindElement(By.Id("mStreetAddress")).SendKeys(address);
                                //Screen-Shot
                                gc.CreatePdf_WOP(orderNumber, "AddressSearch", driver, "OR", "Clackamas");
                                driver.FindElement(By.Id("mSubmit")).SendKeys(Keys.Enter);
                                Thread.Sleep(2000);
                            }
                        }
                        catch
                        { }
                        try
                        {
                            //MultiParcel

                            ChkMultiParcel = driver.FindElement(By.XPath("//*[@id='Table2']/tbody/tr/td[2]")).Text;

                            if (ChkMultiParcel == "1 records returned from your search input.")
                            {
                                driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr[3]/td/div/table/tbody/tr[2]/td[1]/a")).Click();
                                Thread.Sleep(3000);
                                //Screen-Shot
                                gc.CreatePdf_WOP(orderNumber, "Single Address Search", driver, "OR", "Clackamas");
                            }

                            else
                            {
                                IWebElement         MultiParcelTable = driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr/td/table/tbody/tr[3]/td/div/table/tbody"));
                                IList <IWebElement> MultiParcelTR    = MultiParcelTable.FindElements(By.TagName("tr"));
                                IList <IWebElement> MultiParcelTD;

                                int maxCheck = 0;

                                foreach (IWebElement multi in MultiParcelTR)
                                {
                                    if (maxCheck <= 10)
                                    {
                                        MultiParcelTD = multi.FindElements(By.TagName("td"));
                                        if (MultiParcelTD.Count != 0)
                                        {
                                            parcelNumber    = MultiParcelTD[0].Text;
                                            LocationAddress = MultiParcelTD[1].Text;
                                            MultiParcelData = LocationAddress;
                                            gc.insert_date(orderNumber, parcelNumber, 151, MultiParcelData, 1, DateTime.Now);
                                        }
                                        maxCheck++;
                                    }
                                }
                                HttpContext.Current.Session["multiparcel_ORClackamas"] = "Yes";
                                if (MultiParcelTR.Count > 10)
                                {
                                    HttpContext.Current.Session["multiParcel_ORClackamas_count"] = "Maximum";
                                }
                                driver.Quit();
                                return("MultiParcel");
                            }
                        }
                        catch { }
                        try
                        {
                            IWebElement INodata = driver.FindElement(By.Id("Table2"));
                            if (INodata.Text.Contains("0 records returned"))
                            {
                                HttpContext.Current.Session["Nodata_ORClackmas"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }

                    else if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://ascendweb.clackamas.us/ascendweb/(S(cisqdyhth2sdnfwpxlheqkqs))/default.aspx");
                        Thread.Sleep(2000);
                        driver.FindElement(By.Id("mParcelID2")).SendKeys(parcelNumber);
                        //Screen-Shot
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "OR", "Clackamas");
                        driver.FindElement(By.Id("mSubmit")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        try
                        {
                            IWebElement INodata = driver.FindElement(By.Id("Table1"));
                            if (INodata.Text.Contains("does not exist"))
                            {
                                HttpContext.Current.Session["Nodata_ORClackmas"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }
                    else if (searchType == "block")
                    {
                        driver.Navigate().GoToUrl("http://ascendweb.clackamas.us/ascendweb/(S(cisqdyhth2sdnfwpxlheqkqs))/default.aspx");
                        Thread.Sleep(2000);
                        driver.FindElement(By.Id("mAlternateParcelID")).SendKeys(account);
                        //Screen-Shot
                        gc.CreatePdf(orderNumber, account, "AccountSearch", driver, "OR", "Clackamas");
                        driver.FindElement(By.Id("mSubmit")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                        try
                        {
                            IWebElement INodata = driver.FindElement(By.Id("Table1"));
                            if (INodata.Text.Contains("does not exist"))
                            {
                                HttpContext.Current.Session["Nodata_ORClackmas"] = "Yes";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }
                    //Scrapped Data

                    //Property Deatails
                    outparcelno          = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[1]/tbody/tr/td/table/tbody/tr/td[2]")).Text;
                    Property_Address     = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[1]/tbody/tr/td/table/tbody/tr/td[4]")).Text;
                    Alternate_Property   = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[2]/td/div/table/tbody/tr[1]/td[2]")).Text;
                    Property_Description = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[2]/td/div/table/tbody/tr[2]/td[2]")).Text;
                    Property_Category    = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[2]/td/div/table/tbody/tr[3]/td[2]")).Text;
                    Status       = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[2]/td/div/table/tbody/tr[4]/td[2]")).Text;
                    TaxCode_Area = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[2]/td/div/table/tbody/tr[5]/td[2]")).Text;
                    Neighborhood = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[4]/td/div/table/tbody/tr[1]/td[2]")).Text;
                    try
                    {
                        IWebElement         Properttable = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/table[2]/tbody/tr[4]/td/div/table/tbody"));
                        IList <IWebElement> PropertTR    = Properttable.FindElements(By.TagName("tr"));
                        IList <IWebElement> PropertTD;

                        foreach (IWebElement row2 in PropertTR)
                        {
                            PropertTD = row2.FindElements(By.TagName("td"));
                            if (PropertTD.Count != 0 && !row2.Text.Contains("Change property ratio") && row2.Text.Contains("Year Built"))
                            {
                                Year_Built = PropertTD[1].Text;
                            }
                        }
                    }
                    catch
                    { }
                    //Screen-Shot
                    gc.CreatePdf(orderNumber, outparcelno, "Property_Search", driver, "OR", "Clackamas");

                    Property_Details = Property_Address + "~" + Alternate_Property + "~" + Property_Description + "~" + Property_Category + "~" + Status + "~" + TaxCode_Area + "~" + Neighborhood + "~" + Year_Built;
                    gc.insert_date(orderNumber, outparcelno, 152, Property_Details, 1, DateTime.Now);


                    //Assessment Details
                    IWebElement         valuetableElement = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[1]/tbody/tr[4]/td/div[4]/table/tbody/tr[2]/td/div/table/tbody"));
                    IList <IWebElement> valuetableRow     = valuetableElement.FindElements(By.TagName("tr"));
                    IList <IWebElement> valuerowTD;
                    IList <IWebElement> valuerowTH;

                    List <string> Value_Type     = new List <string>();
                    List <string> AVR_Total      = new List <string>();
                    List <string> Exempt         = new List <string>();
                    List <string> TVR_Total      = new List <string>();
                    List <string> Real_Mkt_Land  = new List <string>();
                    List <string> Real_Mkt_Bldg  = new List <string>();
                    List <string> Real_Mkt_Total = new List <string>();
                    List <string> M5_Mkt_Land    = new List <string>();
                    List <string> M5_Mkt_Bldg    = new List <string>();
                    List <string> M5_SAV         = new List <string>();
                    List <string> SAVL           = new List <string>();
                    List <string> MAV            = new List <string>();
                    List <string> Mkt_Exception  = new List <string>();
                    List <string> AV_Exception   = new List <string>();

                    int i = 0;
                    foreach (IWebElement row in valuetableRow)
                    {
                        valuerowTD = row.FindElements(By.TagName("td"));

                        if (i == 0)
                        {
                            valuerowTH = row.FindElements(By.TagName("th"));
                            Value_Type.Add(valuerowTH[1].Text.Trim().Replace("\r\n", ""));
                            Value_Type.Add(valuerowTH[2].Text.Trim().Replace("\r\n", ""));
                        }
                        else if (i == 1)
                        {
                            AVR_Total.Add(valuerowTD[1].Text);
                            AVR_Total.Add(valuerowTD[2].Text);
                        }
                        else if (i == 2)
                        {
                            Exempt.Add(valuerowTD[1].Text);
                            Exempt.Add(valuerowTD[2].Text);
                        }
                        else if (i == 3)
                        {
                            TVR_Total.Add(valuerowTD[1].Text);
                            TVR_Total.Add(valuerowTD[2].Text);
                        }
                        else if (i == 4)
                        {
                            Real_Mkt_Land.Add(valuerowTD[1].Text);
                            Real_Mkt_Land.Add(valuerowTD[2].Text);
                        }
                        else if (i == 5)
                        {
                            Real_Mkt_Bldg.Add(valuerowTD[1].Text);
                            Real_Mkt_Bldg.Add(valuerowTD[2].Text);
                        }
                        else if (i == 6)
                        {
                            Real_Mkt_Total.Add(valuerowTD[1].Text);
                            Real_Mkt_Total.Add(valuerowTD[2].Text);
                        }
                        else if (i == 7)
                        {
                            M5_Mkt_Land.Add(valuerowTD[1].Text);
                            M5_Mkt_Land.Add(valuerowTD[2].Text);
                        }
                        else if (i == 8)
                        {
                            M5_Mkt_Bldg.Add(valuerowTD[1].Text);
                            M5_Mkt_Bldg.Add(valuerowTD[2].Text);
                        }
                        else if (i == 9)
                        {
                            M5_SAV.Add(valuerowTD[1].Text);
                            M5_SAV.Add(valuerowTD[2].Text);
                        }
                        else if (i == 10)
                        {
                            SAVL.Add(valuerowTD[1].Text);
                            SAVL.Add(valuerowTD[2].Text);
                        }
                        else if (i == 11)
                        {
                            MAV.Add(valuerowTD[1].Text);
                            MAV.Add(valuerowTD[2].Text);
                        }
                        else if (i == 12)
                        {
                            Mkt_Exception.Add(valuerowTD[1].Text);
                            Mkt_Exception.Add(valuerowTD[2].Text);
                        }
                        else if (i == 13)
                        {
                            AV_Exception.Add(valuerowTD[1].Text);
                            AV_Exception.Add(valuerowTD[2].Text);
                        }

                        i++;
                    }
                    Assemnt_Details1 = Value_Type[0] + "~" + AVR_Total[0] + "~" + Exempt[0] + "~" + TVR_Total[0] + "~" + Real_Mkt_Land[0] + "~" + Real_Mkt_Bldg[0] + "~" + Real_Mkt_Total[0] + "~" + M5_Mkt_Land[0] + "~" + M5_Mkt_Bldg[0] + "~" + M5_SAV[0] + "~" + SAVL[0] + "~" + MAV[0] + "~" + Mkt_Exception[0] + "~" + AV_Exception[0];
                    Assemnt_Details2 = Value_Type[1] + "~" + AVR_Total[1] + "~" + Exempt[1] + "~" + TVR_Total[1] + "~" + Real_Mkt_Land[1] + "~" + Real_Mkt_Bldg[1] + "~" + Real_Mkt_Total[1] + "~" + M5_Mkt_Land[1] + "~" + M5_Mkt_Bldg[1] + "~" + M5_SAV[1] + "~" + SAVL[1] + "~" + MAV[1] + "~" + Mkt_Exception[1] + "~" + AV_Exception[1];
                    gc.insert_date(orderNumber, outparcelno, 153, Assemnt_Details1, 1, DateTime.Now);
                    gc.insert_date(orderNumber, outparcelno, 153, Assemnt_Details2, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //Tax Balnce Details
                    try
                    {
                        IWebElement         TBBalnce = driver.FindElement(By.XPath("/html/body/form/table[1]/tbody/tr[2]/td/table[2]/tbody/tr/td/table/tbody/tr[5]/td/div/table/tbody"));
                        IList <IWebElement> TRBalnce = TBBalnce.FindElements(By.TagName("tr"));
                        IList <IWebElement> TDBalnce;

                        foreach (IWebElement assess in TRBalnce)
                        {
                            TDBalnce = assess.FindElements(By.TagName("td"));
                            if (TDBalnce.Count != 0)
                            {
                                Taxyear           = TDBalnce[0].Text;
                                Installment       = TDBalnce[1].Text;
                                EarliestDueDate   = TDBalnce[2].Text;
                                Principal         = TDBalnce[3].Text;
                                InterestCosts     = TDBalnce[4].Text;
                                Totaldue          = TDBalnce[5].Text;
                                Cummulativedue    = TDBalnce[6].Text;
                                TaxBalnce_details = Taxyear + "~" + Installment + "~" + EarliestDueDate + "~" + Principal + "~" + InterestCosts + "~" + Totaldue + "~" + Cummulativedue;
                                gc.insert_date(orderNumber, outparcelno, 179, TaxBalnce_details, 1, DateTime.Now);
                            }
                        }


                        //Tax Detailed Statement
                        driver.FindElement(By.XPath("//*[@id='mDetailedStatement']")).Click();
                        Thread.Sleep(2000);

                        TaxProperty_Address = driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td/table/tbody/tr/td/table/tbody/tr[1]/td/table[1]/tbody/tr/td[4]")).Text;

                        IWebElement         TBDetails = driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td/table/tbody/tr/td/table/tbody/tr[2]/td/table/tbody/tr/td/div/table/tbody"));
                        IList <IWebElement> TRDetails = TBDetails.FindElements(By.TagName("tr"));
                        IList <IWebElement> TDDetails;

                        int k = 0;
                        foreach (IWebElement Details in TRDetails)
                        {
                            TDDetails = Details.FindElements(By.TagName("td"));
                            if (k != 0)
                            {
                                if (TDDetails.Count != 0)
                                {
                                    Taxdetail_Year      = TDDetails[0].Text;
                                    Category            = TDDetails[1].Text;
                                    TCA_Dist            = TDDetails[2].Text;
                                    Charged             = TDDetails[3].Text;
                                    Minimum             = TDDetails[4].Text;
                                    Balnce_Due          = TDDetails[5].Text;
                                    Due_Date            = TDDetails[6].Text;
                                    TAXAssement_details = Taxdetail_Year + "~" + Category + "~" + TCA_Dist + "~" + Charged + "~" + Minimum + "~" + Balnce_Due + "~" + Due_Date;
                                    gc.insert_date(orderNumber, outparcelno, 199, TAXAssement_details, 1, DateTime.Now);
                                }
                            }
                            k++;
                        }

                        driver.Navigate().Back();
                        Thread.Sleep(2000);
                    }
                    catch
                    { }
                    //Tax Payment Details
                    IWebElement         Receipttable    = driver.FindElement(By.XPath("/html/body/form/div[5]/table/tbody/tr[2]/td/div/table/tbody"));
                    IList <IWebElement> ReceipttableRow = Receipttable.FindElements(By.TagName("tr"));
                    int rowcount = ReceipttableRow.Count;

                    for (int j = 2; j <= rowcount; j++)
                    {
                        try
                        {
                            driver.FindElement(By.XPath("/html/body/form/div[5]/table/tbody/tr[2]/td/div/table/tbody/tr[" + j + "]/td[2]/a")).Click();
                            Thread.Sleep(3000); IWebElement TaxReTB = driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr[1]/td/table/tbody"));
                            IList <IWebElement>             TaxReTR = TaxReTB.FindElements(By.TagName("tr"));
                            IList <IWebElement>             TaxReTD;
                            foreach (IWebElement Receis in TaxReTR)
                            {
                                TaxReTD = Receis.FindElements(By.TagName("td"));
                                {
                                    if (TaxReTD.Count != 0)
                                    {
                                        Receipt         = TaxReTD[1].Text;
                                        Date_Time       = TaxReTD[3].Text;
                                        Receipt_Details = Receipt + "~" + Date_Time + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "";
                                        gc.insert_date(orderNumber, outparcelno, 161, Receipt_Details, 1, DateTime.Now);
                                    }
                                }
                            }

                            IWebElement         TaxReceiptTB = driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td/table/tbody/tr[2]/td/div/table/tbody"));
                            IList <IWebElement> TaxReceiptTR = TaxReceiptTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxReceiptTD;

                            foreach (IWebElement Receipts in TaxReceiptTR)
                            {
                                TaxReceiptTD = Receipts.FindElements(By.TagName("td"));
                                {
                                    if (TaxReceiptTD.Count != 0)
                                    {
                                        Tax_Year        = TaxReceiptTD[1].Text;
                                        TCA_District    = TaxReceiptTD[2].Text;
                                        Amount_Applied  = TaxReceiptTD[3].Text;
                                        Desription      = TaxReceiptTD[4].Text;
                                        Receipt_Details = "" + "~" + "" + "~" + Tax_Year + "~" + TCA_District + "~" + Amount_Applied + "~" + Desription + "~" + "" + "~" + "" + "~" + "";
                                        gc.insert_date(orderNumber, outparcelno, 161, Receipt_Details, 1, DateTime.Now);
                                    }
                                }
                            }

                            //Payer Details

                            IWebElement         TaxTB = driver.FindElement(By.XPath("/html/body/form/table/tbody/tr[2]/td[2]/table/tbody/tr[5]/td/table/tbody/tr[2]/td/div/table/tbody"));
                            IList <IWebElement> TaxTR = TaxTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxTD;

                            foreach (IWebElement Res in TaxTR)
                            {
                                TaxTD = Res.FindElements(By.TagName("td"));
                                {
                                    if (TaxTD.Count != 0 && !Res.Text.Contains("Name"))
                                    {
                                        Name        = TaxTD[0].Text;
                                        Tender_Type = TaxTD[1].Text;
                                        string TotalAmount_Applied = TaxTD[2].Text;
                                        Receipt_Details = "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + Name + "~" + Tender_Type + "~" + TotalAmount_Applied;
                                        gc.insert_date(orderNumber, outparcelno, 161, Receipt_Details, 1, DateTime.Now);
                                    }
                                }
                            }

                            driver.Navigate().GoToUrl("http://ascendweb.clackamas.us/ascendweb/(S(rbsmpxkc0vynv1vyuqc13ri4))/ParcelInfo.aspx");
                            Thread.Sleep(3000);
                        }
                        catch { }
                    }

                    try
                    {
                        driver.FindElement(By.XPath("//*[@id='mReceipts']/tbody/tr[2]/td[2]/a")).Click();
                        Thread.Sleep(3000);
                        gc.CreatePdf(orderNumber, outparcelno, "Tax Payment Details", driver, "OR", "Clackamas");
                        driver.Navigate().GoToUrl("http://ascendweb.clackamas.us/ascendweb/(S(rbsmpxkc0vynv1vyuqc13ri4))/ParcelInfo.aspx");
                        Thread.Sleep(3000);
                    }
                    catch
                    { }

                    //Tax information
                    driver.Navigate().GoToUrl("https://web3.clackamas.us/taxstatements/");
                    driver.FindElement(By.Id("pn")).SendKeys(outparcelno);
                    driver.FindElement(By.XPath("/html/body/div[3]/form/fieldset/table/tbody/tr[4]/td[2]/input[5]")).Click();
                    Thread.Sleep(3000);
                    //Screen-Shot
                    gc.CreatePdf(orderNumber, outparcelno, "City Tax Details", driver, "OR", "Clackamas");

                    //Download the pdf for Tax Details
                    String Parent_Window = driver.CurrentWindowHandle;

                    IJavaScriptExecutor js1 = driver as IJavaScriptExecutor;

                    IWebElement ButtonLinkSearch = driver.FindElement(By.XPath("//*[@id='st1']/a"));
                    string      script           = ButtonLinkSearch.GetAttribute("href");
                    driver.ExecuteJavaScript <object>(script);
                    IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
                    var newScrollHeight    = (long)js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight); return document.body.scrollHeight;");
                    Thread.Sleep(2000);
                    //gc.downloadfileHeader(script, orderNumber, outparcelno, "Clacmas_Tax", "OR", "Clackamas", driver);

                    System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
                    driver.SwitchTo().Window(driver.WindowHandles.Last());
                    Thread.Sleep(2000);
                    gc.CreatePdf_Chrome(orderNumber, outparcelno, "Clacmas_Tax.pdf", driver, "OR", "Clackamas");

                    driver.SwitchTo().Window(Parent_Window);
                    Thread.Sleep(2000);

                    //Tax Authority
                    try
                    {
                        driver.Navigate().GoToUrl("https://clackamas.us/at");
                        Thread.Sleep(2000);
                        gc.CreatePdf(orderNumber, outparcelno, "Authority Search", driver, "OR", "Clackamas");
                        authority_Address = driver.FindElement(By.XPath("//*[@id='block-views-block-ccts-locations-ccts-locations-view']/div/div/div/div/div/span/div[2]/p[2]/a")).Text.Replace("\r\n", " ");
                        authority_Phone   = driver.FindElement(By.XPath("//*[@id='block-views-block-ccts-locations-ccts-locations-view']/div/div/div/div/div/span/div[2]/p[1]/a[1]")).Text;
                        Authority_Address = authority_Address + " " + authority_Phone;
                        authority_Mail    = driver.FindElement(By.XPath("//*[@id='block-views-block-ccts-locations-ccts-locations-view']/div/div/div/div/div/span/div[2]/p[1]/a[2]")).Text;
                        authority_Details = Authority_Address + "~" + authority_Mail;
                        gc.insert_date(orderNumber, outparcelno, 163, authority_Details, 1, DateTime.Now);
                    }
                    catch
                    {
                    }
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "OR", "Clackamas", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    //megrge pdf files
                    gc.mergpdf(orderNumber, "OR", "Clackamas");
                    return("Data Inserted Successfully");
                }

                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
예제 #10
0
        public static ReceiptsAll GetAllInfo(string ReceiptID)
        {
            ReceiptsAll res = new ReceiptsAll();

            DataSet ds = new DataSet();

            string[][] param =
            {
                new string[] { "p_ReceiptId", ReceiptID },
            };
            string errorString = "";
            string cnStr       = GetConnectionString();

            DataStoreProcQuery_Param(cnStr, "spSelect_Receipt_AllInfo", ref ds, param, ref errorString);

            if (string.IsNullOrEmpty(errorString) && ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    DataRow   dr = dt.Rows[0];
                    Receipts  rc = new Receipts();
                    rc.ReceiptId            = dr["ReceiptId"].ToString();
                    rc.CreatedBy            = dr["CreatedBy"].ToString();
                    rc.CreatedDate          = dr["CreatedDate"].ToString();
                    rc.TotalAmountBeforeTax = double.Parse(dr["TotalAmountBeforeTax"].ToString()).ToString("0,0");
                    rc.TotalTax             = double.Parse(dr["TotalTax"].ToString()).ToString("0,0");
                    rc.TotalAmount          = double.Parse(dr["TotalAmount"].ToString()).ToString("0,0");
                    rc.DiscountAmount       = double.Parse(dr["DiscountAmount"].ToString()).ToString("0,0");
                    rc.TotalMoney           = double.Parse(dr["TotalMoney"].ToString()).ToString("0,0");
                    rc.CashPayAmt           = double.Parse(dr["CashPayAmt"].ToString()).ToString("0,0");
                    rc.CardPayAmt           = double.Parse(dr["CardPayAmt"].ToString()).ToString("0,0");
                    rc.ReturnAmt            = double.Parse(dr["ReturnAmt"].ToString()).ToString("0,0");
                    res.receipt             = rc;
                }
                /////
                if (ds.Tables[1].Rows.Count > 0)
                {
                    DataTable             dt  = ds.Tables[1];
                    List <ReceiptDetails> lst = new List <ReceiptDetails>();
                    foreach (DataRow dr in dt.Rows)
                    {
                        ReceiptDetails rc = new ReceiptDetails();
                        rc.ReceiptId            = dr["ReceiptId"].ToString();
                        rc.ProductId            = dr["ProductId"].ToString();
                        rc.ProductName          = GetProductName(dr["ProductId"].ToString());
                        rc.Qty                  = double.Parse(dr["Qty"].ToString()).ToString("0,0");
                        rc.Price                = double.Parse(dr["Price"].ToString()).ToString("0,0");
                        rc.TotalAmountBeforeTax = double.Parse(dr["TotalAmountBeforeTax"].ToString()).ToString("0,0");
                        rc.TaxAmount            = double.Parse(dr["TaxAmount"].ToString()).ToString("0,0");
                        rc.TotalAmount          = double.Parse(dr["TotalAmount"].ToString()).ToString("0,0");

                        lst.Add(rc);
                    }
                    res.lst_Detail = lst;
                }
                ///thẻ
                if (ds.Tables[2].Rows.Count > 0)
                {
                    DataTable           dt  = ds.Tables[2];
                    List <ReceiptsCard> lst = new List <ReceiptsCard>();
                    foreach (DataRow dr in dt.Rows)
                    {
                        ReceiptsCard rc = new ReceiptsCard();
                        rc.ReceiptId      = dr["ReceiptId"].ToString();
                        rc.CardNo         = dr["CardNo"].ToString();
                        rc.CardHolderName = dr["CardHolderName"].ToString();
                        rc.ExpiredDate    = dr["ExpiredDate"].ToString();
                        rc.CardType       = dr["CardType"].ToString();
                        rc.Bank           = dr["Bank"].ToString();
                        rc.TotalAmount    = double.Parse(dr["TotalAmount"].ToString()).ToString("0,0");
                        lst.Add(rc);
                    }
                    res.lst_card = lst;
                }

                // ReceiptInfo
                if (ds.Tables[3].Rows.Count > 0)
                {
                    DataTable   dt = ds.Tables[3];
                    DataRow     dr = dt.Rows[0];
                    ReceiptInfo rc = new ReceiptInfo();
                    rc.ReceiptId    = dr["ReceiptId"].ToString();
                    rc.CustomerName = dr["CustomerName"].ToString();
                    rc.Address      = dr["Address"].ToString();
                    rc.Phone        = dr["Phone"].ToString();
                    rc.Note         = dr["Note"].ToString();
                    res.receiptInfo = rc;
                }

                // ReceiptMember
                if (ds.Tables[4].Rows.Count > 0)
                {
                    DataTable     dt = ds.Tables[4];
                    DataRow       dr = dt.Rows[0];
                    ReceiptMember rc = new ReceiptMember();
                    rc.ReceiptId = dr["ReceiptId"].ToString();
                    rc.MemberId  = dr["MemberId"].ToString();
                    rc.CreatedBy = dr["CreatedBy"].ToString();
                    DataTable dte = GetMemberInfo(dr["MemberId"].ToString());
                    if (dte != null)
                    {
                        DataRow drr = dte.Rows[0];
                        rc.MemberCode      = drr["MemberCode"].ToString();
                        rc.ObjectId        = drr["ObjectId"].ToString();
                        rc.NumberOfVissits = drr["NumberOfVissits"].ToString();
                        rc.LastestDate     = drr["LastestDate"].ToString();
                        rc.MemberType      = drr["MemberType"].ToString();

                        rc.MemberScore = drr["MemberScore"].ToString();
                        rc.ObjectGroup = drr["ObjectGroup"].ToString();
                        rc.ObjectType  = drr["ObjectType"].ToString();
                        rc.Tel         = drr["Tel"].ToString();
                        rc.Email       = drr["Email"].ToString();
                        rc.MemberCode  = drr["Gender"].ToString();
                        rc.FullName    = drr["FullName"].ToString();
                        rc.TemAdd      = drr["TemAdd"].ToString();
                    }
                    res.receiptMember = rc;
                }
            }
            else
            {
                res = null;
            }

            return(res);
        }
예제 #11
0
 public IEnumerable <Receipt> Create(IEnumerable <Receipt> items)
 {
     return(Receipts.Create(items));
 }
예제 #12
0
파일: Customers.cs 프로젝트: xyyhqq/eXpand
 public decimal GetPaymentSum()
 {
     return(Receipts.Sum(reciept => reciept.Payment));
 }
예제 #13
0
 public async Task <IEnumerable <Receipt> > UpdateAsync(IEnumerable <Receipt> items)
 {
     return(await Receipts.UpdateAsync(items));
 }
예제 #14
0
 public void AddReceipt(Receipt newReceipt)
 {
     Balance += newReceipt.Value;
     Receipts.Add(newReceipt);
 }
예제 #15
0
 public Task <IEnumerable <Receipt> > CreateAsync(IEnumerable <Receipt> items)
 {
     return(Receipts.CreateAsync(items));
 }
예제 #16
0
        public async Task Refresh()
        {
            // NEED TO REWORK FOR THE NEW VIEW - OUTDATED

            IsLoading = true;

            #region Receipts
            Receipts.Clear();
            List <AlbumItem> receipts = await _azure.GetAllImages(CurrentTransaction.ID, true);

            foreach (AlbumItem t in receipts)
            {
                Receipts.Add(t);
            }

            receipts.Add(new AlbumItem {
                IsAddButton = true, IsReceipt = true
            });
            int            i       = 0;
            ImageListItems tempILI = new ImageListItems();

            //ClearItems before applying new items
            ReceiptItems.Clear();
            foreach (AlbumItem t in receipts)
            {
                //RESET temp class for next ListEntry
                if (tempILI == null)
                {
                    tempILI = new ImageListItems();
                }

                //Add Image
                tempILI.ItemImages.Add(t);

                //Add ListEntry content and reset for next Entry
                if (i >= 3)
                {
                    ReceiptItems.Add(tempILI);
                    tempILI = null;
                    i       = 0;
                }
                i++;
            }

            //Fill aditional spaces with filler image
            if (tempILI != null)
            {
                for (int j = tempILI.ItemImages.Count; j < 3; j++)
                {
                    tempILI.ItemImages.Add(new AlbumItem());
                }
                ReceiptItems.Add(tempILI);
            }
            #endregion

            //Reset Values to refresh Goods
            tempILI = null;
            i       = 0;

            #region Goods
            Goods.Clear();
            List <AlbumItem> goods = await _azure.GetAllImages(CurrentTransaction.ID, false);

            foreach (AlbumItem t in goods)
            {
                Goods.Add(t);
            }

            goods.Add(new AlbumItem {
                IsAddButton = true, IsReceipt = false
            });
            //ClearItems before applying new items
            GoodsItems.Clear();
            foreach (AlbumItem t in goods)
            {
                if (tempILI == null)
                {
                    tempILI = new ImageListItems();
                }

                tempILI.ItemImages.Add(t);
                if (i >= 3)
                {
                    GoodsItems.Add(tempILI);
                    tempILI = null;
                    i       = 0;
                }
                i++;
            }

            //Fill aditional spaces with filler image
            if (tempILI != null)
            {
                for (int j = tempILI.ItemImages.Count; j < 3; j++)
                {
                    tempILI.ItemImages.Add(new AlbumItem());
                }
                GoodsItems.Add(tempILI);
            }
            #endregion

            List <AlbumItem> images = await _azure.GetAllImages(CurrentTransaction.ID);

            foreach (AlbumItem image in images)
            {
                Images.Add(image);
            }

            if (!IsUnitTesting)
            {
                HockeyApp.MetricsManager.TrackEvent("Images Page Loaded");
            }

            IsLoading = false;
        }
예제 #17
0
        public IHttpActionResult Post(Receipts baseRequest)
        {
            var response = service.SaveReceipts(baseRequest);

            return(Ok(response));
        }
예제 #18
0
 public Task <DataDeliveryReceiptDetails?> GetAsync(Keccak id)
 {
     return(Receipts.Find(c => c.Id == id).FirstOrDefaultAsync <DataDeliveryReceiptDetails>() !);
 }
예제 #19
0
 public void AddReceipt(object receipt)
 {
     Receipts.Add((ReceiptAttachment)receipt);
 }
예제 #20
0
        private void SearchReceipts(int page)
        {
            CurPage = page;
            receSea = new Receipts();
            // receipt = new Receipts();
            string tuNgay  = dtpTuNgay.Value.ToString("yyyy-MM-dd");
            string denNgay = dtpDenNgay.Value.ToString("yyyy-MM-dd");

            // lọc theo không chọn- chỉ ngày tháng
            if (cboLoc.SelectedIndex == 0)
            {
                int       total         = 0;
                DataTable dt            = receBLL.SearchReceipts0(receSea, tuNgay, denNgay, page, out total);
                double    RecordPerPage = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                int       RecPerPage    = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                double    tem           = (total / RecordPerPage);
                totalPage = Math.Ceiling(tem);

                dgvRecept.Rows.Clear();
                dgvReceipDetail.Rows.Clear();
                dvgCard.Rows.Clear();
                lblThongTinKhachHang.Text = "";
                lblTB.Text = "...";
                if (dt != null && dt.Rows.Count > 0)
                {
                    int i   = 0;
                    int stt = (page - 1) * RecPerPage;
                    foreach (DataRow dr in dt.Rows)
                    {
                        dgvRecept.Rows.Add();
                        dgvRecept.Rows[i].Cells[0].Value = (stt + 1).ToString();
                        dgvRecept.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        dgvRecept.Rows[i].Cells[2].Value = string.Format("{0:0,0}", dr["TotalAmountBeforeTax"]);
                        dgvRecept.Rows[i].Cells[3].Value = string.Format("{0:0,0}", dr["TotalTax"]);
                        dgvRecept.Rows[i].Cells[4].Value = string.Format("{0:0,0}", dr["TotalAmount"]);
                        dgvRecept.Rows[i].Cells[5].Value = string.Format("{0:0,0}", dr["DiscountAmount"]);
                        dgvRecept.Rows[i].Cells[6].Value = string.Format("{0:0,0}", dr["TotalMoney"]);
                        dgvRecept.Rows[i].Cells[7].Value = dr["CreatedBy"].ToString();
                        dgvRecept.Rows[i].Cells[8].Value = dr["CreatedDate"].ToString();
                        i++;
                        stt++;
                    }
                }
                linkNumber.Text = CurPage.ToString() + "/" + totalPage.ToString();
                lblTB.Text      = Common.clsLanguages.GetResource("Found") + " " + total.ToString() + " " + Common.clsLanguages.GetResource("Records");
            }

            // lọc theo mã hóa đơn
            if (cboLoc.SelectedIndex == 1)
            {
                receSea.ReceiptId = txtLoc.Text;
                int       total         = 0;
                DataTable dt            = receBLL.SearchReceipts0(receSea, tuNgay, denNgay, page, out total);
                double    RecordPerPage = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                int       RecPerPage    = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                double    tem           = (total / RecordPerPage);
                totalPage = Math.Ceiling(tem);

                dgvRecept.Rows.Clear();
                dgvReceipDetail.Rows.Clear();
                dvgCard.Rows.Clear();
                lblThongTinKhachHang.Text = "";
                lblTB.Text = "...";
                if (dt != null && dt.Rows.Count > 0)
                {
                    int i   = 0;
                    int stt = (page - 1) * RecPerPage;
                    foreach (DataRow dr in dt.Rows)
                    {
                        dgvRecept.Rows.Add();
                        dgvRecept.Rows[i].Cells[0].Value = (stt + 1).ToString();
                        dgvRecept.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        dgvRecept.Rows[i].Cells[2].Value = string.Format("{0:0,0}", dr["TotalAmountBeforeTax"]);
                        dgvRecept.Rows[i].Cells[3].Value = string.Format("{0:0,0}", dr["TotalTax"]);
                        dgvRecept.Rows[i].Cells[4].Value = string.Format("{0:0,0}", dr["TotalAmount"]);
                        dgvRecept.Rows[i].Cells[5].Value = string.Format("{0:0,0}", dr["DiscountAmount"]);
                        dgvRecept.Rows[i].Cells[6].Value = string.Format("{0:0,0}", dr["TotalMoney"]);
                        dgvRecept.Rows[i].Cells[7].Value = dr["CreatedBy"].ToString();
                        dgvRecept.Rows[i].Cells[8].Value = dr["CreatedDate"].ToString();

                        i++;
                        stt++;
                    }
                }
                linkNumber.Text = CurPage.ToString() + "/" + totalPage.ToString();
                lblTB.Text      = Common.clsLanguages.GetResource("Found") + " " + total.ToString() + " " + Common.clsLanguages.GetResource("Records");
            }

            //tổng số tiền
            if (cboLoc.SelectedIndex == 2)
            {
                //    double d;

                //bool isNum = double.TryParse(txtLoc.Text, out d);
                //if (!isNum)
                //{
                //    CustomMessageBox.MessageBox.ShowCustomMessageBox(Common.clsLanguages.GetResource("ABCNumberA"),
                //                                 Common.clsLanguages.GetResource("Information"),
                //                                 Common.Config.CUSTOM_MESSAGEBOX_ICON.Information,
                //                                 Common.Config.CUSTOM_MESSAGEBOX_BUTTON.OK);
                //    txtLoc.Focus();
                //}
                //else
                //{

                receSea.TotalAmount = txtLoc.Text;
                int       total         = 0;
                DataTable dt            = receBLL.SearchReceipts0(receSea, tuNgay, denNgay, page, out total);
                double    RecordPerPage = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                int       RecPerPage    = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                double    tem           = (total / RecordPerPage);
                totalPage = Math.Ceiling(tem);

                dgvRecept.Rows.Clear();
                dgvReceipDetail.Rows.Clear();
                dvgCard.Rows.Clear();
                lblThongTinKhachHang.Text = "";
                lblTB.Text = "...";
                if (dt != null && dt.Rows.Count > 0)
                {
                    int i   = 0;
                    int stt = (page - 1) * RecPerPage;
                    foreach (DataRow dr in dt.Rows)
                    {
                        dgvRecept.Rows.Add();
                        dgvRecept.Rows[i].Cells[0].Value = (stt + 1).ToString();
                        dgvRecept.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        dgvRecept.Rows[i].Cells[2].Value = string.Format("{0:0,0}", dr["TotalAmountBeforeTax"]);
                        dgvRecept.Rows[i].Cells[3].Value = string.Format("{0:0,0}", dr["TotalTax"]);
                        dgvRecept.Rows[i].Cells[4].Value = string.Format("{0:0,0}", dr["TotalAmount"]);
                        dgvRecept.Rows[i].Cells[5].Value = string.Format("{0:0,0}", dr["DiscountAmount"]);
                        dgvRecept.Rows[i].Cells[6].Value = string.Format("{0:0,0}", dr["TotalMoney"]);
                        dgvRecept.Rows[i].Cells[7].Value = dr["CreatedBy"].ToString();
                        dgvRecept.Rows[i].Cells[8].Value = dr["CreatedDate"].ToString();

                        i++;
                        stt++;
                    }
                }
                linkNumber.Text = CurPage.ToString() + "/" + totalPage.ToString();
                lblTB.Text      = Common.clsLanguages.GetResource("Found") + " " + total.ToString() + " " + Common.clsLanguages.GetResource("Records");
            }
            //}

            // lọc theo mã thành viên
            if (cboLoc.SelectedIndex == 3)
            {
                string id = txtLoc.Text;

                //  DataTable tb1 = receBLL.GetReceiptIdInCard(id);


                //if (tb1 != null && tb1.Rows.Count > 0)
                //{
                int total = 0;
                int i     = 0;

                dgvRecept.Rows.Clear();
                dgvReceipDetail.Rows.Clear();
                dvgCard.Rows.Clear();
                lblThongTinKhachHang.Text = "";
                lblTB.Text = "...";

                DataTable dt = receBLL.SearchReceipts1(id, tuNgay, denNgay, page, out total);
                if (dt != null && dt.Rows.Count > 0)
                {
                    double RecordPerPage = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                    int    RecPerPage    = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                    double tem           = (total / RecordPerPage);
                    totalPage = Math.Ceiling(tem);
                    int stt = (page - 1) * RecPerPage;
                    foreach (DataRow dr in dt.Rows)
                    {
                        dgvRecept.Rows.Add();
                        dgvRecept.Rows[i].Cells[0].Value = (stt + 1).ToString();
                        dgvRecept.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        dgvRecept.Rows[i].Cells[2].Value = string.Format("{0:0,0}", dr["TotalAmountBeforeTax"]);
                        dgvRecept.Rows[i].Cells[3].Value = string.Format("{0:0,0}", dr["TotalTax"]);
                        dgvRecept.Rows[i].Cells[4].Value = string.Format("{0:0,0}", dr["TotalAmount"]);
                        dgvRecept.Rows[i].Cells[5].Value = string.Format("{0:0,0}", dr["DiscountAmount"]);
                        dgvRecept.Rows[i].Cells[6].Value = string.Format("{0:0,0}", dr["TotalMoney"]);
                        dgvRecept.Rows[i].Cells[7].Value = dr["CreatedBy"].ToString();
                        dgvRecept.Rows[i].Cells[8].Value = dr["CreatedDate"].ToString();

                        i++;
                        stt++;
                    }
                }
                linkNumber.Text = CurPage.ToString() + "/" + totalPage.ToString();
                lblTB.Text      = Common.clsLanguages.GetResource("Found") + " " + total.ToString() + " " + Common.clsLanguages.GetResource("Records");
                //  }
            }

            // lọc theo mã thẻ
            if (cboLoc.SelectedIndex == 4)
            {
                string id = txtLoc.Text;

                //  DataTable tb1 = receBLL.GetReceiptIdInCard(id);


                //if (tb1 != null && tb1.Rows.Count > 0)
                //{
                int total = 0;
                int i     = 0;

                dgvRecept.Rows.Clear();
                dgvReceipDetail.Rows.Clear();
                dvgCard.Rows.Clear();
                lblThongTinKhachHang.Text = "";
                lblTB.Text = "...";

                DataTable dt = receBLL.SearchReceipts2(id, tuNgay, denNgay, page, out total);
                if (dt != null && dt.Rows.Count > 0)
                {
                    double RecordPerPage = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                    int    RecPerPage    = int.Parse(ConfigurationManager.AppSettings["MaxRecordDesk"]);
                    double tem           = (total / RecordPerPage);
                    totalPage = Math.Ceiling(tem);
                    int stt = (page - 1) * RecPerPage;
                    foreach (DataRow dr in dt.Rows)
                    {
                        dgvRecept.Rows.Add();
                        dgvRecept.Rows[i].Cells[0].Value = (stt + 1).ToString();
                        dgvRecept.Rows[i].Cells[1].Value = dr["ReceiptId"].ToString();
                        dgvRecept.Rows[i].Cells[2].Value = string.Format("{0:0,0}", dr["TotalAmountBeforeTax"]);
                        dgvRecept.Rows[i].Cells[3].Value = string.Format("{0:0,0}", dr["TotalTax"]);
                        dgvRecept.Rows[i].Cells[4].Value = string.Format("{0:0,0}", dr["TotalAmount"]);
                        dgvRecept.Rows[i].Cells[5].Value = string.Format("{0:0,0}", dr["DiscountAmount"]);
                        dgvRecept.Rows[i].Cells[6].Value = string.Format("{0:0,0}", dr["TotalMoney"]);
                        dgvRecept.Rows[i].Cells[7].Value = dr["CreatedBy"].ToString();
                        dgvRecept.Rows[i].Cells[8].Value = dr["CreatedDate"].ToString();

                        i++;
                        stt++;
                    }
                }
                linkNumber.Text = CurPage.ToString() + "/" + totalPage.ToString();
                lblTB.Text      = Common.clsLanguages.GetResource("Found") + " " + total.ToString() + " " + Common.clsLanguages.GetResource("Records");
                //  }
            }
        }
        public async Task Refresh()
        {
            _receiptItems.Clear();
            _goodsItems.Clear();

            List <AlbumItem> receipts = await _azure.GetAllImages(CurrentTransaction.ID, true);

            foreach (AlbumItem t in receipts)
            {
                Receipts.Add(t);
            }

            receipts.Add(new AlbumItem {
                IsAddButton = true, IsReceipt = true
            });
            int            i       = 0;
            ImageListItems tempILI = new ImageListItems();

            foreach (AlbumItem t in receipts)
            {
                //RESET temp class for next ListEntry
                if (tempILI == null)
                {
                    tempILI = new ImageListItems();
                }

                //Add Image
                tempILI.ItemImages.Add(t);

                //Add ListEntry content and reset for next Entry
                if (i >= 3)
                {
                    ReceiptItems.Add(tempILI);
                    tempILI = null;
                    i       = 0;
                }
                i++;
            }

            //Fill aditional spaces with filler image
            if (tempILI != null)
            {
                for (int j = tempILI.ItemImages.Count; j < 3; j++)
                {
                    tempILI.ItemImages.Add(new AlbumItem());
                }
                ReceiptItems.Add(tempILI);
            }

            //Reset Values to refresh Goods
            tempILI = null;
            i       = 0;


            List <AlbumItem> goods = await _azure.GetAllImages(CurrentTransaction.ID, false);

            foreach (AlbumItem t in goods)
            {
                Goods.Add(t);
            }

            goods.Add(new AlbumItem {
                IsAddButton = true, IsReceipt = false
            });
            foreach (AlbumItem t in goods)
            {
                if (tempILI == null)
                {
                    tempILI = new ImageListItems();
                }

                tempILI.ItemImages.Add(t);
                if (i >= 3)
                {
                    GoodsItems.Add(tempILI);
                    tempILI = null;
                    i       = 0;
                }
                i++;
            }

            //Fill aditional spaces with filler image
            if (tempILI != null)
            {
                for (int j = tempILI.ItemImages.Count; j < 3; j++)
                {
                    tempILI.ItemImages.Add(new AlbumItem());
                }
                GoodsItems.Add(tempILI);
            }
            HockeyApp.MetricsManager.TrackEvent("Images Page Loaded");
        }
예제 #22
0
 public Task <DataDeliveryReceiptDetails> GetAsync(Keccak id)
 => Receipts.Find(c => c.Id == id).FirstOrDefaultAsync();
예제 #23
0
 public async Task <Receipt> UpdateAsync(Receipt item)
 {
     return(await Receipts.UpdateAsync(item));
 }
예제 #24
0
 public Task AddAsync(DataDeliveryReceiptDetails receipt)
 => Receipts.InsertOneAsync(receipt);
예제 #25
0
        public async Task <ActionResult> GetMerchantFeeSetupAsync(int merchantAccountId, int paymentCardId)
        {
            var model = await Receipts.GetMerchantFeeSetupAsync(this.Tenant, merchantAccountId, paymentCardId).ConfigureAwait(true);

            return(this.Ok(model));
        }
예제 #26
0
 public Task UpdateAsync(DataDeliveryReceiptDetails receipt)
 => Receipts.ReplaceOneAsync(r => r.DepositId == receipt.DepositId && r.Number == receipt.Number, receipt);
예제 #27
0
 public IEnumerable <Receipt> Update(IEnumerable <Receipt> items)
 {
     return(Receipts.Update(items));
 }
예제 #28
0
파일: PayForm.cs 프로젝트: luan-cs/API
        private int InsertNewReceipt()
        {
            // 0 : Thất bại
            // 1 : thành công
            int res = 0;
            ////
            Receipts rcp = new Receipts();

            rcp.ReceiptId            = "";
            rcp.Note                 = ""; // click nút info sẽ thêm vào
            rcp.NoOfCustumers        = ""; // click nút info sẽ thêm vào
            rcp.Status               = "1";
            rcp.TotalAmountBeforeTax = lblAmt_TotalAmtBeforeTax.Text;
            rcp.TotalTax             = lblAmt_TotalTax.Text;
            rcp.TotalAmount          = lblAmt_TotalAfterTax.Text;
            rcp.DiscountAmount       = Discount.ToString();
            rcp.TotalMoney           = lblAmt_TotalAmount.Text;
            rcp.CashPayAmt           = txtCustomer.Text;
            rcp.CardPayAmt           = lblAmt_Card.Text;
            rcp.ReturnAmt            = lblAmt_ReturnAmt.Text;
            rcp.CreatedBy            = Program.Username;
            rcp.CreatedDate          = "";
            rcp.ModifiedBy           = "";
            rcp.ModifiedDate         = "";

            rcp.ServiceCostAmount = lblServiceChargeVal.Text;

            /////////////
            List <ReceiptDetails> lst_rd = new List <ReceiptDetails>();

            //for (int i = 0; i < dataGridViewReceiptDetail.RowCount; i++)
            //{
            //    ReceiptDetails rd = new ReceiptDetails();
            //    rd.ReceiptId = "";
            //    rd.RefOrderId = dataGridViewReceiptDetail.Rows[i].Cells[1].Value.ToString();
            //    rd.ProductId = dataGridViewReceiptDetail.Rows[i].Cells[2].Value.ToString();
            //    rd.PromotionId = "";
            //    rd.Qty = dataGridViewReceiptDetail.Rows[i].Cells[5].Value.ToString();
            //    rd.Price = dataGridViewReceiptDetail.Rows[i].Cells[6].Value.ToString();
            //    rd.TotalAmountBeforeTax = dataGridViewReceiptDetail.Rows[i].Cells[7].Value.ToString();
            //    rd.TaxAmount = dataGridViewReceiptDetail.Rows[i].Cells[8].Value.ToString();
            //    rd.TotalAmount = dataGridViewReceiptDetail.Rows[i].Cells[9].Value.ToString();
            //    rd.CreatedBy = Program.Username;
            //    rd.DeskId = dataGridViewReceiptDetail.Rows[i].Cells["colDeskId"].Value.ToString();
            //    lst_rd.Add(rd);
            //}

            if (string.IsNullOrWhiteSpace(tempOrder))
            {
                foreach (OrderDetails odds in Program.lstTempOrder.ListOrederDetail)
                {
                    ReceiptDetails rd = new ReceiptDetails();
                    rd.ReceiptId            = "";
                    rd.RefOrderId           = odds.OrderId;
                    rd.ProductId            = odds.ProductId;
                    rd.PromotionId          = "";
                    rd.Qty                  = odds.Qty;
                    rd.Price                = odds.Price;
                    rd.TotalAmountBeforeTax = odds.AmmountBeforeTax;
                    rd.TaxAmount            = odds.TaxAmmount;
                    rd.TotalAmount          = odds.TotalAmount;
                    rd.CreatedBy            = Program.Username;
                    rd.DeskId               = "";
                    lst_rd.Add(rd);
                }
            }
            else
            {
                foreach (OrderDetails odds in orAll.lst_Detail)
                {
                    ReceiptDetails rd = new ReceiptDetails();
                    rd.ReceiptId            = "";
                    rd.RefOrderId           = odds.OrderId;
                    rd.ProductId            = odds.ProductId;
                    rd.PromotionId          = "";
                    rd.Qty                  = odds.Qty;
                    rd.Price                = odds.Price;
                    rd.TotalAmountBeforeTax = odds.AmmountBeforeTax;
                    rd.TaxAmount            = odds.TaxAmmount;
                    rd.TotalAmount          = odds.TotalAmount;
                    rd.CreatedBy            = Program.Username;
                    rd.DeskId               = "";

                    lst_rd.Add(rd);
                }
            }
            if (Program.lstCard != null && Program.lstCard.Count > 0)
            {
                foreach (ReceiptsCard card in Program.lstCard)
                {
                    card.CreatedBy = Program.Username;
                }
            }
            else
            {
                Program.lstCard = null;
            }

            //////////////////
            if (Program.rep_mb != null && !string.IsNullOrEmpty(Program.rep_mb.MemberId))
            {
                Program.rep_mb.CreatedBy = Program.Username;
            }
            else
            {
                Program.rep_mb = null;
            }


            //////////////
            if (Program.rep_info != null && !string.IsNullOrEmpty(Program.rep_info.Note))
            {
            }
            else
            {
                Program.rep_info = null;
            }

            RptsBLL.AddNew(rcp, lst_rd, Program.lstCard, Program.rep_info, Program.rep_mb, ref ReceiptID_Success);
            if (string.IsNullOrEmpty(RptsBLL.ErrorString))
            {
                res = 1;
            }
            else
            {
                res = 0;
            }

            return(res);
        }
예제 #29
0
 public Receipt Update(Receipt item)
 {
     return(Receipts.Update(item));
 }
예제 #30
0
        public ActionResult Save(Receipts obj)
        {
            var re = ReceiptsBLL.SaveOrUpdate(obj, Request.Files);

            return(Content(re.ToJson()));
        }