示例#1
0
        public string Generate()
        {
            int      index   = 1;
            XElement element = new XElement("root",
                                            new XElement("start_day", InvoiceData.StartDate.ToString("dd", CultureInfo.InvariantCulture)),
                                            new XElement("start_month", Utils.Utils.GetMonthText(InvoiceData.StartDate.Month)),
                                            new XElement("start_year", InvoiceData.StartDate.ToString("yyyy", CultureInfo.InvariantCulture) + "წ"),
                                            new XElement("end_day", InvoiceData.EndDate.ToString("dd", CultureInfo.InvariantCulture)),
                                            new XElement("end_month", Utils.Utils.GetMonthText(InvoiceData.EndDate.Month)),
                                            new XElement("end_year", InvoiceData.EndDate.ToString("yyyy", CultureInfo.InvariantCulture) + "წ"),
                                            new XElement("num", InvoiceData.Num),
                                            new XElement("abonent_code", InvoiceData.AbonentCode),
                                            new XElement("abonent_name", InvoiceData.AbonentName),
                                            new XElement("abonent_address", InvoiceData.AbonentAddress),
                                            new XElement("abonent_telephone", InvoiceData.AbonentPhone),
                                            new XElement("summ", InvoiceData.Items.Sum(i => i.Amount)),
                                            new XElement("amount_letter", NumberToString.GetNumberGeorgianString((decimal)InvoiceData.Items.Sum(i => i.Amount))),
                                            new XElement("items", InvoiceData.Items.Select(it => new XElement("item",
                                                                                                              new XElement("loop", index++),
                                                                                                              new XElement("product", it.Name),
                                                                                                              new XElement("amount", it.Amount)))));

            string file_name = GetTempFilePathWithExtension("Invoice_" + InvoiceData.AbonentCode + "_" + InvoiceData.StartDate.ToString("ddMMyyyyHHmmss"));

            try
            {
                XslCompiledTransform _transform = new XslCompiledTransform(false);
                _transform.Load(Path.Combine(HostingEnvironment.ApplicationPhysicalPath, "App_Data", "Invoice.xslt"));

                using (StringWriter sw = new StringWriter())
                {
                    _transform.Transform(new XDocument(element).CreateNavigator(), new XsltArgumentList(), sw);

                    using (PdfDocument pdf = new PdfDocument())
                    {
                        PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat()
                        {
                            IsWaiting = false
                        };
                        PdfPageSettings setting = new PdfPageSettings()
                        {
                            Size = PdfPageSize.A4
                        };

                        Thread thread = new Thread(() => { pdf.LoadFromHTML(sw.ToString(), false, setting, htmlLayoutFormat); });
                        thread.SetApartmentState(ApartmentState.STA);
                        thread.Start();
                        thread.Join();

                        pdf.SaveToFile(file_name, FileFormat.PDF);
                    }
                }
            }
            catch
            {
                file_name = string.Empty;
            }

            return(file_name);
        }
示例#2
0
 static void Main(string[] args)
 {
     WriteLine(NumberParity.IsOdd(5));
     WriteLine(NumberToString.NumberToWords(520122484548));
     WriteLine(GradingFunction.Grade(56));
     WriteLine(BaseConverter.ConvertNumber("985", 9, 16));
     ReadLine();
 }
示例#3
0
        private void mnuPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null)
                {
                    return;
                }
                var guid  = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value;
                var order = OrderBussines.Get(guid);
                if (order == null)
                {
                    return;
                }

                var reportList = new List <OrderReportBussines>();

                foreach (var item in order.DetList)
                {
                    reportList.Add(new OrderReportBussines()
                    {
                        CompanyName          = "گروه فنی و مهندسی آراد",
                        CompanyTell          = "09382420272",
                        ContractCode         = order.ContractCode,
                        CustomerAddress      = order.Customer?.Address,
                        CustomerName         = order.CustomerName,
                        CustomerSerialNumber = order.Customer?.AppSerial,
                        CustomerTell         = order.Customer?.Tell1,
                        DateSh          = order.DateSh,
                        OdrerDiscount   = order.Discount,
                        OrderSum        = order.Sum,
                        OrderTotal      = order.Total,
                        OrderUserName   = order.UserName,
                        ProductCount    = item.Count,
                        ProductDiscount = item.Discount,
                        ProductName     = item.ProductName,
                        ProductPrice    = item.Price,
                        ProductTotal    = item.Total,
                        Time            = order.Date.ToShortTimeString(),
                        OrderTotalName  = $"{NumberToString.Num2Str(order.Total.ToString().ParseToDouble().ToString())} ریال"
                    });
                }

                var cls = new ReportGenerator(StiType.DepartmentOrder, EnPrintType.Pdf_A4)
                {
                    Lst = new List <object>(reportList?.OrderBy(q => q.ProductName))
                };
                cls.PrintNew();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
        private void txtDiscount_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!string.IsNullOrEmpty(txtDiscount.Text) && int.Parse(txtDiscount.Text.Replace(",", "")) > 0)
            {
                var price = long.Parse(txtDiscount.Text.Replace(",", ""));

                lblDiscount.Content = NumberToString.NumToString(price.ToString()) + " ریال";

                txtDiscount.Text            = price.ToString("N0"); txtDiscount.SelectionStart = txtDiscount.Text.Length;
                txtDiscount.SelectionLength = 0;
            }
            else
            {
                lblDiscount.Content = "";
            }

            CalculateDiscount();
        }
        private void txtRevocationPrice_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!string.IsNullOrEmpty(txtRevocationPrice.Text))
            {
                var price = long.Parse(txtRevocationPrice.Text.Replace(",", ""));

                txtRevocationPrice.Text = price.ToString("N0");

                lblRevocationPriceText.Content = NumberToString.NumToString(price.ToString()) + " ریال";

                txtRevocationPrice.SelectionStart  = txtRevocationPrice.Text.Length;
                txtRevocationPrice.SelectionLength = 0;
            }
            else
            {
                lblRevocationPriceText.Content = "";
            }
        }
        static void Main(string[] args)
        {
            try
            {
                int    LargestPalindromeNumber = new int();
                int    TempNumber = new int();
                string NumberToString;
                string PalinCheck;


                for (int i = 100; i < 1000; i++)
                {
                    for (int j = 100; j < 1000; j++)
                    {
                        TempNumber = i * j;

                        NumberToString = TempNumber.ToString();

                        //using LINQ reverse makes it an enumerable sequence of characters so you must make it an array to use it as a string
                        PalinCheck = new string( NumberToString.Reverse().ToArray());


                        if (NumberToString.CompareTo(PalinCheck) == 0)
                        {
                            if (TempNumber > LargestPalindromeNumber)
                            {
                                LargestPalindromeNumber = TempNumber;
                            }
                        }
                    }
                }


                Console.WriteLine("The Largest Palindrome Multiple is : {0}", LargestPalindromeNumber);
                Console.ReadKey();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.ReadKey();
            }
        }
示例#7
0
        static void Main(string[] args)
        {
            var idBase      = (IdBase)Enum.Parse(typeof(IdBase), ConfigurationManager.AppSettings["IdBase"]);
            var startFrom   = int.Parse(ConfigurationManager.AppSettings["StartFrom"]);
            var idLengthMax = int.Parse(ConfigurationManager.AppSettings["IdLengthMax"]);

            var          idLength     = 0;
            var          count        = (UInt64)startFrom;
            StreamWriter streamWriter = null;

            while (idLength <= idLengthMax)
            {
                var newId = NumberToString.Convert(count, idBase);
                count += 1;

                if (idLength != newId.Length)
                {
                    if (streamWriter != null)
                    {
                        streamWriter.Flush();
                        streamWriter.Dispose();
                    }

                    idLength = newId.Length;
                    if (newId.Length > idLength)
                    {
                        Console.WriteLine("Done for id length " + idLength);
                    }

                    var fileName = string.Format("{0}_{1}.txt", idBase, idLength);
                    streamWriter = new StreamWriter(new FileStream(fileName, FileMode.Create));
                }

                if (streamWriter != null)
                {
                    streamWriter.WriteLine(newId);
                }
            }

            Console.WriteLine("Done");
        }
示例#8
0
    public void DisplayCurrentMenu()
    {
        foreach (Text x in allTextObjects)
        {
            x.text = "";
        }

        switch (currentPitStopState)
        {
        case PitStopState.Main:
            allTextObjects[0].text = "Loans";
            allTextObjects[1].text = "Investments";
            allTextObjects[2].text = "Businesses";
            allTextObjects[3].text = "Real Estate";
            allTextObjects[5].text = "Total Money: $" + NumberToString.Convert(PlayerStats.s_instance.money);
            allTextObjects[6].text = "Income: $" + NumberToString.Convert(PlayerStats.s_instance.income);

            allTextObjects[7].text = "Back to Road";
            break;

            #region LoanOptions
        case PitStopState.Loans:
            int playerLoansCount = PlayerStats.s_instance.playerLoans.Count;
            print(playerLoansCount + " Player Loan Count");
            for (int i = 0; i < playerLoansCount; i++)
            {
                allTextObjects[i].text = PlayerStats.s_instance.playerLoans[i].loanName;
            }
            allTextObjects[7].text = "Back";
            break;

        case PitStopState.SelectLoan:
            print("LIC " + lastIndexClicked);
            allTextObjects[0].text = PlayerStats.s_instance.playerLoans[lastIndexClicked].loanName;
            allTextObjects[1].text = "Interest Rate: " + (PlayerStats.s_instance.playerLoans[lastIndexClicked].loanAmount == 0 ? 0 : PlayerStats.s_instance.playerLoans[lastIndexClicked].interestRate).ToString();
            allTextObjects[2].text = "Amount Left: " + (PlayerStats.s_instance.playerLoans[lastIndexClicked].loanAmount);
            string append2 = (PlayerStats.s_instance.playerLoans[lastIndexClicked].loanAmount == 0f) ? "0" : PlayerStats.s_instance.playerLoans[lastIndexClicked].annualPaymentPercentage * 100 + "%";
            allTextObjects[5].text = "Annual Payment: " + append2;
            allTextObjects[6].text = "Pay Off Loans";
            allTextObjects[7].text = "Back";
            break;

            #endregion
            #region InvestmentOptions
        case PitStopState.Investment:
            int playerInvestmentsCount = PlayerStats.s_instance.playerInvestments.Count;
            for (int i = 0; i < playerInvestmentsCount; i++)
            {
                allTextObjects[i].text = PlayerStats.s_instance.playerInvestments[i].investmentName;
            }
            allTextObjects[4].text = "Purchase Stocks $50K";
            allTextObjects[5].text = "Purchase Mutual Fund $5K";
            allTextObjects[6].text = "Setup IRA $100";
            allTextObjects[7].text = "Back";
            break;

        case PitStopState.SelectInvestment:
            if (PlayerStats.s_instance.playerInvestments[lastIndexClicked].thisInvestmentType == Investment.InvestmentType.IRA)
            {
                allTextObjects[2].text = "Add $100";
                allTextObjects[3].text = "Add $1K";
                allTextObjects[6].text = "Liquidate IRA";
            }
            else if (PlayerStats.s_instance.playerInvestments[lastIndexClicked].thisInvestmentType == Investment.InvestmentType.Stock)
            {
                allTextObjects[2].text = "Add $10K";
                allTextObjects[3].text = "Add $500K";
                allTextObjects[4].text = "Liquidate All Stock";
                allTextObjects[5].text = "Liquidate 50% Stock";
                allTextObjects[6].text = "Liquidate 10% Stock";
            }
            else if (PlayerStats.s_instance.playerInvestments[lastIndexClicked].thisInvestmentType == Investment.InvestmentType.Mutual)
            {
                allTextObjects[2].text = "Add $1K";
                allTextObjects[3].text = "Add $50K";
                allTextObjects[4].text = "Liquidate Mutual Fund";
                allTextObjects[5].text = "Liquidate 50% of Mutual Fund";
                allTextObjects[6].text = "Liquidate 10% of Mutual Fund";
            }
            allTextObjects[0].text = PlayerStats.s_instance.playerInvestments[lastIndexClicked].investmentName;
            allTextObjects[1].text = "$" + NumberToString.Convert(PlayerStats.s_instance.playerInvestments[lastIndexClicked].monetaryValue) +
                                     " Growing " + PlayerStats.s_instance.playerInvestments[lastIndexClicked].annualGrowthRate * 100 + "% per Year";
            allTextObjects[7].text = "Back";

            break;

            #endregion
            #region BusinessOptions
        case PitStopState.Business:
            int playerBusinessCount = PlayerStats.s_instance.playerBusinesses.Count;
            for (int i = 0; i < playerBusinessCount; i++)
            {
                print(playerBusinessCount + "player business count");
                allTextObjects[i].text = PlayerStats.s_instance.playerBusinesses[i].businessName;
            }
            allTextObjects[4].text = "Start Business for 10k";
            allTextObjects[5].text = "Start Business for 100k";
            allTextObjects[6].text = "Start Business for 1M";
            allTextObjects[7].text = "Back";

            break;

        case PitStopState.SelectBusiness:
            allTextObjects[0].text = PlayerStats.s_instance.playerBusinesses[lastIndexClicked].businessName;
            allTextObjects[1].text = "Revenue: " + PlayerStats.s_instance.playerBusinesses[lastIndexClicked].revenueStream;
            allTextObjects[2].text = "Work Overtime";
            allTextObjects[3].text = "Sell Business for " + PlayerStats.s_instance.playerBusinesses[lastIndexClicked].valuation;
            allTextObjects[7].text = "Back";

            break;

            #endregion
            #region RealEstateOptions
        case PitStopState.RealEstate:
            int playerRealEstateCount = PlayerStats.s_instance.playerRealEstate.Count;
            for (int i = 0; i < playerRealEstateCount; i++)
            {
                allTextObjects[i].text = PlayerStats.s_instance.playerRealEstate[i].realEstateName;
            }
            allTextObjects[4].text = "Buy House for 50K";
            allTextObjects[5].text = "Buy House for 500K";
            allTextObjects[6].text = "Buy House for 5M";
            allTextObjects[7].text = "Back";

            break;

        case PitStopState.SelectRealEstate:
            allTextObjects[0].text = PlayerStats.s_instance.playerRealEstate[lastIndexClicked].realEstateName;
            allTextObjects[1].text = "Liquid Value: $" + PlayerStats.s_instance.playerRealEstate[lastIndexClicked].realEstateValue;

            allTextObjects[6].text = "Sell for: $" + PlayerStats.s_instance.playerRealEstate[lastIndexClicked].realEstateValue;;
            allTextObjects[7].text = "Back";

            break;
            #endregion
        }
    }
示例#9
0
        private void ShowAllDetails()
        {
            try
            {
                if (docID == "CASHPAYMENTVOUCHER" || docID == "BANKPAYMENTVOUCHER")
                {
                    grdPRDetail.Columns["PartyCode"].Visible  = false;
                    grdPRDetail.Columns["PartyName"].Visible  = false;
                    grdPRDetail.Columns["SLType"].Visible     = false;
                    grdPRDetail.Columns["ChequeNo"].Visible   = true;
                    grdPRDetail.Columns["ChequeDate"].Visible = true;
                    paymentvoucher vh = new paymentvoucher();
                    vh.DocumentID  = docID;
                    vh.VoucherNo   = voucherNo;
                    vh.VoucherDate = voucherDate;
                    paymentvoucher pvh = PaymentVoucherDB.getVoucherHeaderForTrialBalance(vh);
                    txtTemporarryNo.Text = pvh.TemporaryNo.ToString();
                    dtTempDate.Value     = pvh.TemporaryDate;
                    txtVoucherNo.Text    = pvh.VoucherNo.ToString();
                    dtVoucherDate.Value  = pvh.VoucherDate;

                    txtvoucherType.Text            = pvh.VoucherType;
                    cmbBookType.SelectedIndex      = Structures.ComboFUnctions.getComboIndex(cmbBookType, pvh.BookType);
                    txtPayeeCode.Text              = pvh.SLCode.ToString();
                    txtPayeeName.Text              = pvh.SLName;
                    txtBillDetails.Text            = pvh.BillDetails;
                    cmbBankTransMode.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbBankTransMode, pvh.BankTransactionMode);
                    cmbOfficeID.SelectedIndex      = Structures.ComboFUnctions.getComboIndex(cmbOfficeID, pvh.OfficeID);
                    cmbProjectID.SelectedIndex     = cmbProjectID.FindString(pvh.ProjectID);
                    cmbCurrencyID.SelectedIndex    =
                        Structures.ComboFUnctions.getComboIndex(cmbCurrencyID, pvh.CurrencyID);

                    txtExchangeRate.Text  = pvh.ExchangeRate.ToString();
                    txtVoucherAmount.Text = pvh.VoucherAmount.ToString();

                    txtvoucherAmountINR.Text = pvh.VoucherAmountINR.ToString();
                    txtAmountInWords.Text    = NumberToString.convert(pvh.VoucherAmount.ToString()).Trim().Replace("INR", pvh.CurrencyID);
                    txtnarration.Text        = pvh.Narration.ToString();
                    List <paymentvoucherdetail> VDetail = PaymentVoucherDB.getVoucherDetail(pvh);
                    grdPRDetail.Rows.Clear();
                    int     i         = 0;
                    decimal totCredit = 0;
                    decimal totDebit  = 0;
                    foreach (paymentvoucherdetail vd in VDetail)
                    {
                        AddPRDetailRow();
                        grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode;
                        grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName;
                        grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit;
                        totDebit = totDebit + vd.AmountDebit;
                        grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit;
                        totCredit = totCredit + vd.AmountCredit;
                        grdPRDetail.Rows[i].Cells["ChequeNo"].Value   = vd.ChequeNo;
                        grdPRDetail.Rows[i].Cells["ChequeDate"].Value = vd.ChequeDate;
                        i++;
                    }
                    txtTotalCreditAmnt.Text = totCredit.ToString();
                    txtTotalDebitAmnt.Text  = totDebit.ToString();
                }
                else if (docID == "BANKRECEIPTVOUCHER" || docID == "CASHRECEIPTVOUCHER")
                {
                    grdPRDetail.Columns["PartyCode"].Visible  = false;
                    grdPRDetail.Columns["PartyName"].Visible  = false;
                    grdPRDetail.Columns["SLType"].Visible     = false;
                    grdPRDetail.Columns["ChequeNo"].Visible   = true;
                    grdPRDetail.Columns["ChequeDate"].Visible = true;
                    ReceiptVoucherHeader vh = new ReceiptVoucherHeader();
                    vh.DocumentID  = docID;
                    vh.VoucherNo   = voucherNo;
                    vh.VoucherDate = voucherDate;
                    ReceiptVoucherHeader rvh = ReceiptVoucherDB.getReceiptVoucherHeaderForTrailbalance(vh);
                    txtTemporarryNo.Text           = rvh.TemporaryNo.ToString();
                    dtTempDate.Value               = rvh.TemporaryDate;
                    txtVoucherNo.Text              = rvh.VoucherNo.ToString();
                    dtVoucherDate.Value            = rvh.VoucherDate;
                    txtvoucherType.Text            = rvh.VoucherType;
                    cmbBookType.SelectedIndex      = Structures.ComboFUnctions.getComboIndex(cmbBookType, rvh.BookType);
                    txtPayeeCode.Text              = rvh.SLCode.ToString();
                    txtPayeeName.Text              = rvh.SLName;
                    txtBillDetails.Text            = rvh.BillDetails;
                    cmbBankTransMode.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbBankTransMode, rvh.BankTransactionMode);
                    cmbOfficeID.SelectedIndex      = Structures.ComboFUnctions.getComboIndex(cmbOfficeID, rvh.OfficeID);
                    cmbProjectID.SelectedIndex     = cmbProjectID.FindString(rvh.ProjectID);
                    cmbCurrencyID.SelectedIndex    = Structures.ComboFUnctions.getComboIndex(cmbCurrencyID, rvh.CurrencyID);
                    txtExchangeRate.Text           = rvh.ExchangeRate.ToString();
                    txtVoucherAmount.Text          = rvh.VoucherAmount.ToString();

                    txtvoucherAmountINR.Text = rvh.VoucherAmountINR.ToString();
                    txtAmountInWords.Text    = NumberToString.convert(rvh.VoucherAmount.ToString()).Trim().Replace("INR", rvh.CurrencyID);
                    txtnarration.Text        = rvh.Narration.ToString();
                    List <ReceiptVoucherDetail> VDetail = ReceiptVoucherDB.getVoucherDetail(rvh);
                    grdPRDetail.Rows.Clear();
                    int     i         = 0;
                    decimal totCredit = 0;
                    decimal totDebit  = 0;
                    foreach (ReceiptVoucherDetail vd in VDetail)
                    {
                        AddPRDetailRow();
                        grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode;
                        grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName;
                        grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit;
                        totDebit = totDebit + vd.AmountDebit;
                        grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit;
                        totCredit = totCredit + vd.AmountCredit;
                        grdPRDetail.Rows[i].Cells["ChequeNo"].Value   = vd.ChequeNo;
                        grdPRDetail.Rows[i].Cells["ChequeDate"].Value = vd.ChequeDate;
                        i++;
                    }
                    txtTotalCreditAmnt.Text = totCredit.ToString();
                    txtTotalDebitAmnt.Text  = totDebit.ToString();
                }
                else if (docID == "JOURNALVOUCHER" || docID == "PJV" || docID == "SJV")
                {
                    grdPRDetail.Columns["PartyCode"].Visible  = true;
                    grdPRDetail.Columns["PartyName"].Visible  = true;
                    grdPRDetail.Columns["SLType"].Visible     = true;
                    grdPRDetail.Columns["ChequeNo"].Visible   = false;
                    grdPRDetail.Columns["ChequeDate"].Visible = false;
                    JournalVoucherHeader jvhTemp = new JournalVoucherHeader();
                    jvhTemp.DocumentID  = docID;
                    jvhTemp.JournalNo   = voucherNo;
                    jvhTemp.JournalDate = voucherDate;
                    JournalVoucherHeader jvh = JournalVoucherDB.getJournalHeaderForTrialBalance(jvhTemp);
                    txtTemporarryNo.Text = jvh.TemporaryNo.ToString();
                    //txtvoucherType.Text = "Journal";
                    dtTempDate.Value = jvh.TemporaryDate;
                    //txtAmountInWords.Text = NumberToString.convert(txtTotalDebitAmnt.Text);
                    txtVoucherNo.Text   = jvh.JournalNo.ToString();
                    dtVoucherDate.Value = jvh.JournalDate;
                    txtnarration.Text   = jvh.Narration.ToString();
                    decimal totDebit  = 0;
                    decimal totCredit = 0;
                    List <JournalVoucherDetail> JVDetail = JournalVoucherDB.getJournalVoucherDetail(jvh);
                    grdPRDetail.Rows.Clear();
                    int i = 0;
                    foreach (JournalVoucherDetail jvd in JVDetail)
                    {
                        AddPRDetailRow();
                        grdPRDetail.Rows[i].Cells["AccountCode"].Value  = jvd.AccountCode;
                        grdPRDetail.Rows[i].Cells["AccountName"].Value  = jvd.AccountName;
                        grdPRDetail.Rows[i].Cells["PartyCode"].Value    = jvd.SLCode;
                        grdPRDetail.Rows[i].Cells["PartyName"].Value    = jvd.SLName;
                        grdPRDetail.Rows[i].Cells["SLType"].Value       = jvd.SLType;
                        grdPRDetail.Rows[i].Cells["AmountDebit"].Value  = jvd.AmountDebit;
                        grdPRDetail.Rows[i].Cells["AmountCredit"].Value = jvd.AmountCredit;
                        totDebit  = totDebit + jvd.AmountDebit;
                        totCredit = totCredit + jvd.AmountCredit;
                        i++;
                    }
                    txtTotalCreditAmnt.Text = totCredit.ToString();
                    txtTotalDebitAmnt.Text  = totDebit.ToString();
                    txtAmountInWords.Text   = NumberToString.convert(txtTotalDebitAmnt.Text);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in showing details");
            }
        }
示例#10
0
 void Update()
 {
     moneyText.text     = "$" + NumberToString.Convert(PlayerStats.s_instance.money);
     incomeText.text    = "$" + Mathf.CeilToInt(PlayerStats.s_instance.income).ToString() + "/year";
     happinessBar.value = PlayerStats.s_instance.happiness * 100f;
 }
示例#11
0
 public void DisplayPauseMenu()
 {
     pauseMenuAnimator.SetTrigger("pitstop");
     pauseMenuTexts.transform.GetChild(0).GetComponent <Text> ().text = "Age: " + PlayerStats.s_instance.age;
     pauseMenuTexts.transform.GetChild(1).GetComponent <Text> ().text = "Total Money: $" + NumberToString.Convert(PlayerStats.s_instance.money);
     pauseMenuTexts.transform.GetChild(2).GetComponent <Text> ().text = "Income: $" + NumberToString.Convert(PlayerStats.s_instance.income);
     pauseMenuTexts.transform.GetChild(3).GetComponent <Text> ().text = "Happiness: " + Mathf.CeilToInt(PlayerStats.s_instance.happiness * 100) + "/100";
 }
示例#12
0
        private async void mnuPrintList_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGrid.RowCount <= 0)
                {
                    return;
                }
                if (DGrid.CurrentRow == null)
                {
                    return;
                }

                var frm = new frmSetPrintSize(false);
                if (frm.ShowDialog(this) != DialogResult.OK)
                {
                    return;
                }
                _token?.Cancel();
                _token = new CancellationTokenSource();
                var pardakht = await PardakhtBussines.GetAllAsync(_token.Token);

                var list = new List <OperationListPrintViewModel>();
                foreach (var item in pardakht)
                {
                    var totalSum = pardakht.Sum(q => q.SumCheckMoshtari) + pardakht.Sum(q => q.SumHavale) +
                                   pardakht.Sum(q => q.SumNaqd) + pardakht.Sum(q => q.SumCheckShakhsi);
                    list.Add(new OperationListPrintViewModel()
                    {
                        PrintDateSh = Calendar.MiladiToShamsi(DateTime.Now),
                        PrintTime   = DateTime.Now.ToShortTimeString(),
                        DateM       = item.DateM,
                        Count       = pardakht.Count,
                        Description = item.Description,
                        Number      = item.Number,
                        Check       = 0,
                        DateSh      = item.DateSh,
                        TafsilName  = item.TafsilName,
                        Havale      = 0,
                        Naqd        = 0,
                        TotalRow    = item.Sum,
                        TotalSum    = totalSum,
                        TotalHorouf = $"{NumberToString.Num2Str(totalSum.ToString())} ریال"
                    });
                }

                list = list?.OrderBy(q => q.DateM)?.ToList();

                if (frm._PrintType == EnPrintType.Excel)
                {
                    return;
                }
                var cls = new ReportGenerator(StiType.Pardakht_List, frm._PrintType)
                {
                    Lst = new List <object>(list)
                };
                cls.PrintNew();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
示例#13
0
        private void ShowAllDetails()
        {
            try
            {
                if (JVdocID == "PJV")
                {
                    invoiceinheader iih = new invoiceinheader();
                    iih.DocumentID    = InvDociD;
                    iih.TemporaryNo   = InvTemporaryNo;
                    iih.TemporaryDate = InvTemporaryDate;

                    PJVHeader pjvh = PJVDB.getPJVHeaderPerInvoiceIN(iih);
                    if (pjvh.TemporaryNo == 0)
                    {
                        MessageBox.Show("PJV Not prepared");
                        return;
                    }
                    txtTemporarryNo.Text = pjvh.TemporaryNo.ToString();
                    dtTempDate.Value     = pjvh.TemporaryDate;
                    txtJournalNo.Text    = pjvh.JournalNo.ToString();
                    dtJournalDate.Value  = pjvh.JournalDate;
                    txtINVTempNo.Text    = pjvh.InvTempNo.ToString();
                    dtINVTempDate.Value  = pjvh.InvTempDate;
                    txtnarration.Text    = pjvh.Narration.ToString();

                    List <PJVDetail> PJVDetail = PJVDB.getPJVDetail(pjvh);
                    grdPRDetail.Rows.Clear();
                    int     i         = 0;
                    decimal totCredit = 0;
                    decimal totDebit  = 0;
                    foreach (PJVDetail vd in PJVDetail)
                    {
                        AddPRDetailRow();
                        grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode;
                        grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName;
                        grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit;
                        totDebit = totDebit + vd.AmountDebit;
                        grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit;
                        totCredit = totCredit + vd.AmountCredit;

                        grdPRDetail.Rows[i].Cells["PartyCode"].Value = vd.SLCode;
                        grdPRDetail.Rows[i].Cells["PartyName"].Value = vd.SLName;
                        grdPRDetail.Rows[i].Cells["gSLType"].Value   = vd.SLType;
                        i++;
                    }
                    txtTotalCreditAmnt.Text = totCredit.ToString();
                    txtTotalDebitAmnt.Text  = totDebit.ToString();
                    txtAmountInWords.Text   = NumberToString.convert(txtTotalDebitAmnt.Text);
                }
                else if (JVdocID == "SJV")
                {
                    invoiceoutheader ioh = new invoiceoutheader();
                    ioh.DocumentID    = InvDociD;
                    ioh.TemporaryNo   = InvTemporaryNo;
                    ioh.TemporaryDate = InvTemporaryDate;

                    SJVHeader sjvh = SJVDB.getSJVHeaderPerInvoiceOut(ioh);
                    if (sjvh.TemporaryNo == 0)
                    {
                        MessageBox.Show("SJV Not prepared");
                        return;
                    }
                    txtTemporarryNo.Text = sjvh.TemporaryNo.ToString();
                    dtTempDate.Value     = sjvh.TemporaryDate;
                    txtJournalNo.Text    = sjvh.JournalNo.ToString();
                    dtJournalDate.Value  = sjvh.JournalDate;
                    txtINVTempNo.Text    = sjvh.InvTempNo.ToString();
                    dtINVTempDate.Value  = sjvh.InvTempDate;
                    txtnarration.Text    = sjvh.Narration.ToString();

                    List <SJVDetail> SJVdetail = SJVDB.getSJVDetail(sjvh);
                    grdPRDetail.Rows.Clear();
                    int     i         = 0;
                    decimal totCredit = 0;
                    decimal totDebit  = 0;
                    foreach (SJVDetail vd in SJVdetail)
                    {
                        AddPRDetailRow();
                        grdPRDetail.Rows[i].Cells["AccountCode"].Value = vd.AccountCode;
                        grdPRDetail.Rows[i].Cells["AccountName"].Value = vd.AccountName;
                        grdPRDetail.Rows[i].Cells["AmountDebit"].Value = vd.AmountDebit;
                        totDebit = totDebit + vd.AmountDebit;
                        grdPRDetail.Rows[i].Cells["AmountCredit"].Value = vd.AmountCredit;
                        totCredit = totCredit + vd.AmountCredit;

                        grdPRDetail.Rows[i].Cells["PartyCode"].Value = vd.SLCode;
                        grdPRDetail.Rows[i].Cells["PartyName"].Value = vd.SLName;
                        grdPRDetail.Rows[i].Cells["gSLType"].Value   = vd.SLType;
                        i++;
                    }
                    txtTotalCreditAmnt.Text = totCredit.ToString();
                    txtTotalDebitAmnt.Text  = totDebit.ToString();
                    txtAmountInWords.Text   = NumberToString.convert(txtTotalDebitAmnt.Text);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in showing details");
            }
        }