private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            List <ServiceMadeModel> newListServices = new List <ServiceMadeModel>();

            for (int i = 0; i < dgvSalary.Items.Count - 1; i++)
            {
                var item              = dgvSalary.Items[i];
                var mycheckbox        = dgvSalary.Columns[4].GetCellContent(item) as CheckBox;
                ServiceMadeModel smms = item as ServiceMadeModel;

                if (smms != null)
                {
                    if (!smms.ifPaid)
                    {
                        smms.ifPaid = false;
                        newListServices.Add(smms);
                    }
                }
            }

            compute(newListServices);

            ReportForm rf = new ReportForm(therapist, lstTherapist);

            rf.ShowDialog();
        }
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            if (checkFields())
            {
                DateTime dteFrom = DateTime.Parse(datePickerFrom.Text);
                DateTime dteTo   = DateTime.Parse(datePickerTo.Text);

                ReportForm rf = new ReportForm(getAllServicesRenderedByDate(), getAllExpenses(), lstCashAdvance, lstLoansPaid, (dteFrom.ToShortDateString() + " - " + dteTo.ToShortDateString()));
                rf.ShowDialog();
            }
        }
Exemplo n.º 3
0
        private void printWaiver()
        {
            ClientModel cm = dgvClient.SelectedItem as ClientModel;

            if (cm != null)
            {
                int id = Convert.ToInt32(cm.ID1);
                cm                     = getClientDetails(id);
                cm.ID1                 = id.ToString();
                cm.IfViewDetails       = false;
                cm.IfEditDetails       = false;
                cm.IfPrintWaiver       = true;
                cm.LstServiceTypeModel = getServiceType(getServiceMade(id));
                cm.LstTherapistModel   = getTherapistServed(id);
                conDB.writeLogFile("GENERATE REPORT: WAIVER FORM FOR CLIENT: " + cm.ID1);
                ReportForm rf = new ReportForm(this, cm);
                rf.ShowDialog();
            }
            else
            {
                System.Windows.MessageBox.Show("No record selected!");
            }
        }
Exemplo n.º 4
0
        private void btnPrintServiceReport_Click(object sender, RoutedEventArgs e)
        {
            ReportForm report = new ReportForm(getClientsForTheDay());

            report.ShowDialog();
        }
Exemplo n.º 5
0
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            List <ServiceMadeModel> serviceMade = new List <ServiceMadeModel>();
            ClientModel             cm          = dgvClient.SelectedItem as ClientModel;

            if (cm != null)
            {
                int id = Convert.ToInt32(cm.ID1);

                if (id != 0)
                {
                    string servMode = cm.ServiceMode;
                    cm               = getClientDetails(id);
                    cm.ID1           = id.ToString();
                    cm.ServiceMode   = servMode;
                    cm.IfViewDetails = false;
                    cm.IfEditDetails = false;
                    cm.IfPrintWaiver = false;

                    //cm.ServiceMode = row.Cells[3].Value.ToString();
                    serviceMade = getServiceMade(id);

                    //cm.LstServiceTypeModel = getServiceType(serviceMade);
                    //cm.LstServiceTypeModel.AddRange(getServicesFromPromo(cm));
                    serviceMade.AddRange(getServicesFromPromo(cm));
                    cm.lstProductsBought = getProductsBoughtForClient(id);

                    //DISCOUNTED LSTSERVICE TYPE
                    List <ServiceTypeModel> discountedServiceType = new List <ServiceTypeModel>();
                    ServiceTypeModel        discServiceType       = new ServiceTypeModel();

                    foreach (ServiceMadeModel smmm in serviceMade)
                    {
                        //discServiceType = stm;
                        DiscountModel dm = getDiscountedRate(Convert.ToInt32(smmm.Discounted));

                        double price           = Convert.ToDouble(smmm.Price);
                        double discount        = Convert.ToInt32(dm.Discount);
                        double discountedPrice = (price * (discount / 100));

                        price = price - discountedPrice;
                        discServiceType.Price       = price.ToString();
                        discServiceType.ServiceType = smmm.ServiceType;
                        discountedServiceType.Add(discServiceType);
                        discServiceType = new ServiceTypeModel();
                    }

                    cm.LstServiceTypeModel = discountedServiceType;

                    cm.LstTherapistModel = getTherapistServed(id);
                    conDB.writeLogFile("GENERATE REPORT: CLIENT FORM FOR: " + cm.ID1);

                    ReportForm rf = new ReportForm(this, cm);
                    rf.ShowDialog();
                }
            }
            else
            {
                System.Windows.MessageBox.Show("No record selected!");
            }
        }