Exemplo n.º 1
0
        public FastTrackForm(LoginForm loginform)
        {
            InitializeComponent();
            curSvcDisplayDate = DateTime.Today;
            PrefsChanged();
            //refreshTimeStart = refreshTimeLeft = CCFBPrefs.ServiceLogRefreshRate;

            frmLogIn       = loginform;
            lblFBName.Text = CCFBPrefs.FoodBankName;
            clsFT          = new TrxLog(CCFBGlobal.connectionString, false, true, false, false);

            dgvFT.Columns["colBabySvcs"].Visible = CCFBPrefs.EnableBabyServices;
            dgvFT.Columns["colLbsBaby"].Visible  = CCFBPrefs.EnableBabyServices;
            dgvFT.Columns["colLbsTEFAP"].Visible = CCFBPrefs.EnableTEFAP;
            dgvFT.Columns["colLbsSuppl"].Visible = CCFBPrefs.EnableSupplemental;

            enableScaleFeature.Visible = tbScaleWt.Visible = tbTotalScaleWt.Visible = clearTotalWt.Visible =
                btnRefresh.Visible     = addWeightButton.Visible = totalWeightText.Visible = scaleWeightText.Visible = CCFBPrefs.EnableFTscale; //Automated scale feature <7-27-2014>

            fillForm();
            StartTimer();
            initScalePort();
            dgvFT.ClearSelection();

            enableScale.Enabled = false;
            //tbTotBabyDL.Visible = false;
        }
Exemplo n.º 2
0
        private void FillSameHouseNbrGrid()
        {
            Household clsTmpHH = new Household(CCFBGlobal.connectionString);
            TrxLog    clsTmpTL = new TrxLog(CCFBGlobal.connectionString, true, true, true, true);

            string[] tmp = tbeAddress.Text.Split(' ');
            //tpgSameHouseNbr.Text = "Loading ...";
            lvwSameHouseNbr.Items.Clear();
            Application.DoEvents();
            if (tmp.Length > 0)
            {
                clsTmpHH.openWhere("Left(Address," + tmp[0].Length.ToString() + ") = '" + tmp[0] + "'", "Address, Name");
                for (int i = 0; i < clsTmpHH.RowCount; i++)
                {
                    clsTmpHH.SetRecord(i);
                    ListViewItem lvi = new ListViewItem(clsTmpHH.Name);
                    lvi.SubItems.Add(clsTmpHH.Inactive.ToString());
                    lvi.SubItems.Add(clsTmpHH.Address);
                    lvi.SubItems.Add(clsTmpHH.AptNbr);
                    lvi.SubItems.Add(clsTmpHH.City + ", " + clsTmpHH.State + " " + clsTmpHH.Zipcode);
                    lvi.SubItems.Add(clsTmpTL.GetNBrTrxByHH(clsTmpHH.ID).ToString());
                    lvi.SubItems.Add(clsTmpHH.ID.ToString());
                    lvwSameHouseNbr.Items.Add(lvi);
                }
                //tpgSameHouseNbr.Text = "[" + lvwSameHouseNbr.Items.Count.ToString() + "] " + tpgSameHouseNbr.Tag.ToString();
                lvwSameHouseNbr.Visible = true;
                //tabControl1.SelectedIndex = 1;
            }
            else
            {
                //tpgSameHouseNbr.Text = "";
                lvwSameHouseNbr.Visible = false;
            }
        }
Exemplo n.º 3
0
        public void InitClientData(Client clsClient)
        {
            DateTime StartPeriod;
            DateTime EndPeriod;

            string[] DateStuff = ServiceDate.Split('/');
            ClientStuff.NoCommodity      = clsClient.clsHH.NoCommodities;
            ClientStuff.SupplementalOnly = clsClient.clsHH.SupplOnly;
            ClientStuff.HaveCSFP         = (clsClient.clsHH.NbrCSFP > 0);
            ClientStuff.FamilySize       = clsClient.clsHH.TotalFamily;
            ClientStuff.Homeless         = clsClient.clsHH.Homeless;
            ClientStuff.Transient        = (clsClient.clsHH.ClientType == CCFBPrefs.TransientId);

            TrxLog trxLogWork = new TrxLog(CCFBGlobal.connectionString);

            //Nbr Service This Month
            StartPeriod = Convert.ToDateTime(DateStuff[0].ToString() + "/01/" + DateStuff[2].ToString());
            EndPeriod   = StartPeriod.AddMonths(1).AddDays(-1);
            trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            ClientStuff.NbrServicesThisMonth = trxLogWork.RowCount;
            //Nbr Services This Fiscal Year
            StartPeriod = CCFBGlobal.CalcFiscalStartDate(Convert.ToDateTime(ServiceDate));
            EndPeriod   = CCFBGlobal.CalcFiscalEndDate(Convert.ToDateTime(ServiceDate));
            trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            ClientStuff.NbrServicesThisFiscalYr = trxLogWork.RowCount;
            //Nbr Services This Calendar Year
            if (CCFBPrefs.FiscalYearStartMonth != 1)
            {
                StartPeriod = Convert.ToDateTime("01/01/" + DateStuff[2].ToString());
                EndPeriod   = StartPeriod.AddYears(1).AddDays(-1);
                trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            }
            ClientStuff.NbrServicesThisCalYr = trxLogWork.RowCount;
            ClearSelected();
        }
Exemplo n.º 4
0
 private void InitFoodServiceClass()
 {
     clsHHServiceTrans = new TrxLog(CCFBGlobal.connectionString
                                    , (rdoIncludeBoth.Checked || rdoIncludePosted.Checked)
                                    , (rdoIncludeBoth.Checked || rdoIncludeFT.Checked)
                                    , false, false);
 }
Exemplo n.º 5
0
 public Client()
 {
     connString            = CCFBGlobal.connectionString;
     clsHH                 = new Household(connString);
     clsHHmem              = new HHMembers(connString);
     clsHHSvcTrans         = new TrxLog(connString, true, true, true, true);
     conn                  = new SqlConnection();
     conn.ConnectionString = connString;
     dset                  = new DataSet();
     dadAdpt               = new SqlDataAdapter();
 }
Exemplo n.º 6
0
        private void tsbPost_Click(object sender, EventArgs e)
        {
            clsTrxLog = new TrxLog(CCFBGlobal.connectionString, true, false, false, false);
            Household clsHH  = new Household(CCFBGlobal.connectionString);
            HHMembers clsHHM = new HHMembers(CCFBGlobal.connectionString);
            int       rsid   = 0;

            foreach (ListViewItem item in lvwRouteStatus.Items)
            {
                if (item.Checked == true && Convert.ToInt32(item.Tag) == 2)
                {
                    item.BackColor = Color.DarkOrchid;
                    Application.DoEvents();
                    rsid = Convert.ToInt32(item.SubItems[4].Text);
                    clsHDRouteSheet.find(rsid, true);
                    for (int i = 0; i < clsHDRouteSheet.RSClients.RowCount; i++)
                    {
                        clsHDRouteSheet.RSClients.setDataRow(i);
                        clsTrxLog.openForHH(clsHDRouteSheet.RSClients.HHID);
                        clsHH.open(clsHDRouteSheet.RSClients.HHID);
                        clsHHM.openHHID(clsHDRouteSheet.RSClients.HHID);
                        clsHDItems.find(clsHDRouteSheet.RSClients.HDItem);
                        clsTrxItem                 = new TrxLogItem(clsTrxLog.DSet.Tables[0].NewRow(), clsHH, clsHHM, clsHDRouteSheet.DriverName, TrxLogItem.SvcMethod.Pickup);
                        clsTrxItem.TrxDate         = currentServiceDate;
                        clsTrxItem.LbsBabySvc      = clsHDItems.LbsBabySvc;
                        clsTrxItem.LbsCommodities  = clsHDItems.LbsCommodity;
                        clsTrxItem.LbsNonFood      = clsHDItems.LbsNonFood;
                        clsTrxItem.LbsOther        = clsHDItems.LbsOther;
                        clsTrxItem.LbsStandard     = clsHDItems.LbsStd;
                        clsTrxItem.LbsSupplemental = clsHDItems.LbsSupplemental;
                        clsTrxItem.FoodSvcList     = "HD-" + clsHDItems.Description;
                        if (clsTrxItem.LbsCommodities > 0)
                        {
                            clsTrxItem.RcvdCommodity = true;
                        }
                        if (clsTrxItem.LbsSupplemental > 0)
                        {
                            clsTrxItem.RcvdSupplemental = true;
                        }
                        clsTrxItem.Created   = DateTime.Now;
                        clsTrxItem.CreatedBy = CCFBGlobal.dbUserName;
                        clsTrxLog.DSet.Tables[0].Rows.Add(clsTrxItem.DRow);
                        clsTrxLog.update(0, "");
                        clsTrxLog.updateServiceBits(clsHH.ID, currentServiceDate);
                        clsHH.UpdateLatestServiceDates(currentServiceDate.ToShortDateString());
                    }
                    clsHDRouteSheet.updateRouteStatus(HDRouteSheet.HDRSStatus.Posted);
                }
            }
            clsHDRouteSheet.refreshDataTable();
            filllvwRouteStatus();
        }
Exemplo n.º 7
0
        //int rowIndex = 0;


        public TrxLogForm(MainForm frmMainIn, Client clsClientIn)
        {
            InitializeComponent();
            bNormalMode = false;
            frmMain     = frmMainIn;
            clsClient   = clsClientIn;
            pnlIncludeOptions.Visible = (CCFBPrefs.EnableFastTrack == true);
            InitFoodServiceClass();
            clsSvcDays.LoadDateList(0);
            lvColSorterLog       = new ListViewColumnSorter();
            lvColSorterLog.Order = SortOrder.None;

            lvColSorterAppt       = new ListViewColumnSorter();
            lvColSorterAppt.Order = SortOrder.None;
            PrefsChanged();
            if (clsSvcDays.RowCount > 0)
            {
                curSvcDisplayDate = DateTime.Parse(clsSvcDays.LastDate());
                //RefreshSvcPage();
            }

            if (CCFBPrefs.EnableAppointments == true)
            {
                clsAppointments = new TrxLog(CCFBGlobal.connectionString, false, false, true, true);
                clsAppointments.IncludeAppointments = true;
                clsApptDays = new DistinctLogDays(CCFBGlobal.connectionString);
                clsApptDays.LoadDateList(1);
                if (clsApptDays.RowCount > 0)
                {
                    curApptDisplayDate = DateTime.Parse(clsApptDays.LastDate());
                    //RefreshApptPage();
                }
                RefreshApptPage();
            }
            else
            {
                tabControl1.TabPages.RemoveByKey("tpgAppt");
            }

            refreshTimeStart = refreshTimeLeft = CCFBPrefs.ServiceLogRefreshRate;
            bNormalMode      = true;
        }
Exemplo n.º 8
0
        //int rowIndex = 0;


        public TrxLogForm(MainForm frmMainIn, Client clsClientIn)
        {
            InitializeComponent();
            frmMain   = frmMainIn;
            clsClient = clsClientIn;
            clsHHServiceTrans.ServiceTrxOnly = true;
            clsSvcDays.LoadDateList(0);
            lvColSorterLog       = new ListViewColumnSorter();
            lvColSorterLog.Order = SortOrder.None;

            lvColSorterAppt       = new ListViewColumnSorter();
            lvColSorterAppt.Order = SortOrder.None;
            PrefsChanged();
            if (clsSvcDays.RowCount > 0)
            {
                curSvcDisplayDate = DateTime.Parse(clsSvcDays.LastDate());
                RefreshSvcPage();
            }
            if (CCFBPrefs.EnableAppointments == true)
            {
                clsAppointments = new TrxLog(CCFBGlobal.connectionString);
                clsAppointments.AppointmentsOnly = true;
                clsApptDays = new DistinctLogDays(CCFBGlobal.connectionString);
                clsApptDays.LoadDateList(1);
                if (clsApptDays.RowCount > 0)
                {
                    curApptDisplayDate = DateTime.Parse(clsApptDays.LastDate());
                    RefreshApptPage();
                }
            }
            else
            {
                tabControl1.TabPages.RemoveByKey("tpgAppt");
            }

            refreshTimeStart = refreshTimeLeft = CCFBPrefs.ServiceLogRefreshRate;
            //tbTotBabyDL.Visible = false;
        }
Exemplo n.º 9
0
        public void initForm(Client clsClientIn, bool ModeIn, bool isApptIn, int TrxIndexIn, int hhMemID)
        {
            clsClient       = clsClientIn;
            clsTrxLog       = clsClient.clsHHSvcTrans;
            isNewTrx        = ModeIn;
            isAppt          = isApptIn;
            loadingControls = true;
            if (isNewTrx == false)
            {
                chkFoodLbsManualEntry.Checked = true;
                chkNonFoodManualEntry.Checked = true;
            }
            else
            {
                chkFoodLbsManualEntry.Checked = false;
                chkNonFoodManualEntry.Checked = false;
            }

            SetDisplayMode();
            cboClientType.SelectedValue = clsClient.clsHH.ClientType.ToString();
            List <parmType> ptList = new List <parmType>();

            for (int i = 0; i < clsClient.clsHHmem.RowCount; i++)
            {
                clsClient.clsHHmem.SetRecord(i);
                ptList.Add(new parmType(clsClient.clsHHmem.ID, (clsClient.clsHHmem.FirstName + " "
                                                                + clsClient.clsHHmem.LastName).Trim(), i, clsClient.clsHHmem.FirstName));
            }
            cboHHMem.DataSource    = ptList;
            cboHHMem.DisplayMember = "LongName";
            cboHHMem.ValueMember   = "UID";

            if (TrxIndexIn < 0)
            {
                clsTrxLog.openForHH(clsClient.clsHH.ID);
                clsTrxItem = new TrxLogItem(clsTrxLog.DSet.Tables[0].NewRow(), clsClient.clsHH, hhMemID);
                if (isAppt == true)
                {
                    BackColor            = CCFBGlobal.bkColorApptEdit;
                    trxDateIn            = CCFBGlobal.DefalutApptDate;
                    lblService.Text      = "Date New Appointment";
                    clsTrxItem.TrxStatus = CCFBGlobal.statusTrxLog_NewAppt;
                }
                else
                {
                    BackColor            = CCFBGlobal.bkColorBaseEdit;
                    trxDateIn            = CCFBGlobal.DefaultServiceDate;
                    lblService.Text      = "Date New Service Transaction";
                    clsTrxItem.TrxStatus = CCFBGlobal.statusTrxLog_Service;
                }
                clsTrxItem.TrxDate = Convert.ToDateTime(trxDateIn);
                clsTrxItem.HHMemID = clsClient.ServingHHMemID;
                clsDaysOpen.openTopTwentyWithinDate(clsTrxItem.TrxDate);
                clsDaysOpen.FindDate(clsTrxItem.TrxDate);
                CCFBGlobal.clsDailyItems.SetServiceDate(trxDateIn, clsDaysOpen.IsCommodity, clsDaysOpen.SpecialItems);
                CCFBGlobal.clsDailyItems.InitClientData(clsClient);
                MarkNewServiceItems();
            }
            else
            {
                clsTrxLog.openWhere("TrxId = " + TrxIndexIn.ToString());
                clsTrxItem = new TrxLogItem(clsTrxLog.DRow);
                trxDateIn  = clsTrxItem.TrxDate.ToShortDateString();
                if (clsTrxItem.TrxStatus == CCFBGlobal.statusTrxLog_Service || isAppt == false)
                {
                    lblService.Text = "Edit Service Transaction";
                    BackColor       = CCFBGlobal.bkColorBaseEdit;
                    if (isAppt == true)
                    {
                        lblService.Text      = "Convert Appointment to Service Transaction";
                        clsTrxItem.TrxStatus = CCFBGlobal.statusTrxLog_Service;
                        MarkNewServiceItems();
                    }
                    else
                    {
                        lblService.Text = "Edit Service Transaction";
                    }
                }
                else
                {
                    lblService.Text = "Edit Appointment";
                    BackColor       = CCFBGlobal.bkColorApptEdit;
                }
                clsDaysOpen.FindDate(clsTrxItem.TrxDate);
                CCFBGlobal.clsDailyItems.SetServiceDate(trxDateIn, clsDaysOpen.IsCommodity, clsDaysOpen.SpecialItems);
                CCFBGlobal.clsDailyItems.InitClientData(clsClient);
                CheckServiceItemsFromList(clsTrxItem.ConcatFoodSvcItemsList, CCFBGlobal.clsDailyItems.FoodItemsList);
                CheckServiceItemsFromList(clsTrxItem.ConcatNonFoodSvcItemsList, CCFBGlobal.clsDailyItems.NonFoodItemsList);
            }
            cboHHMem.SelectedValue = clsTrxItem.HHMemID.ToString();
            CCFBGlobal.clsDailyItems.fillListViewItems(lvwFoodSvcItems, lvwNonFoodSvcItems, lvwBabyServices);
            lvwNonFoodSvcItems.Visible    = (lvwNonFoodSvcItems.Items.Count > 0);
            chkNonFoodManualEntry.Checked = (lvwNonFoodSvcItems.Items.Count == 0);
            if (clsClient.clsHH.BabyServices == true)
            {
                lvwBabyServices.Visible       = (lvwBabyServices.Items.Count > 0);
                chkBabySvcManualEntry.Checked = (lvwBabyServices.Items.Count == 0);
            }
            else
            {
                lvwBabyServices.Visible = false;
            }
            pnlBabyServices.Visible = clsClient.clsHH.BabyServices;

            fillForm();
        }
Exemplo n.º 10
0
        public void InitClientData(Client clsClient)
        {
            DateTime StartPeriod;
            DateTime EndPeriod;
            DateTime servicedate;

            string[] DateStuff = ServiceDate.Split('/');
            servicedate                         = Convert.ToDateTime(ServiceDate);
            ClientStuff.NoCommodity             = clsClient.clsHH.NoCommodities;
            ClientStuff.SupplementalOnly        = clsClient.clsHH.SupplOnly;
            ClientStuff.HaveCSFP                = (clsClient.clsHH.NbrCSFP > 0);
            ClientStuff.FamilySize              = clsClient.clsHH.TotalFamily;
            ClientStuff.Homeless                = clsClient.clsHH.Homeless;
            ClientStuff.Transient               = (clsClient.clsHH.ClientType == CCFBPrefs.TransientId);
            ClientStuff.NbrServicesThisCalYr    = 0;
            ClientStuff.NbrServicesThisFiscalYr = 0;
            ClientStuff.NbrServicesThisMonth    = 0;
            ClientStuff.NbrServicesThisWeek     = 0;
            ClientStuff.NbrSupplThisMonth       = 0;
            ClientStuff.NbrTEFAPThisMonth       = 0;
            ClientStuff.NbrFullSvcThisMonth     = 0;
            ClientStuff.LastFullService         = clsClient.clsHH.LatestService;
            ClientStuff.LastTEFAPService        = clsClient.clsHH.LastCommodityService;
            ClientStuff.LastSupplService        = clsClient.clsHH.LastSupplService;

            TrxLog trxLogWork = new TrxLog(CCFBGlobal.connectionString, true, true, false, false);

            //Nbr Service This Month
            StartPeriod = Convert.ToDateTime(DateStuff[0].ToString() + "/01/" + DateStuff[2].ToString());
            EndPeriod   = servicedate.AddDays(-1);
            trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            ClientStuff.NbrServicesThisMonth = trxLogWork.RowCount;
            for (int i = 0; i < trxLogWork.RowCount; i++)
            {
                trxLogWork.setDataRow(i);
                if (trxLogWork.RcvdCommodity == true)
                {
                    ClientStuff.NbrTEFAPThisMonth++;
                }
                if (trxLogWork.RcvdSupplemental == true)
                {
                    ClientStuff.NbrSupplThisMonth++;
                }
                if (trxLogWork.FullService == true)
                {
                    ClientStuff.NbrFullSvcThisMonth++;
                }
            }
            //Nbr Services This Fiscal Year
            StartPeriod = CCFBGlobal.CalcFiscalStartDate(Convert.ToDateTime(ServiceDate));
            EndPeriod   = servicedate;
            trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            ClientStuff.NbrServicesThisFiscalYr = trxLogWork.RowCount;
            //Nbr Services This Calendar Year
            if (CCFBPrefs.FiscalYearStartMonth != 1)
            {
                StartPeriod = Convert.ToDateTime("01/01/" + DateStuff[2].ToString());
                EndPeriod   = servicedate;
                trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            }
            ClientStuff.NbrServicesThisCalYr = trxLogWork.RowCount;
            int dayofweek = Convert.ToInt32(servicedate.DayOfWeek);

            StartPeriod = servicedate.AddDays(-dayofweek);
            EndPeriod   = servicedate.AddDays(-1);
            trxLogWork.openUsingDateRange(clsClient.clsHH.ID, StartPeriod, EndPeriod);
            ClientStuff.NbrServicesThisWeek = trxLogWork.RowCount;
            ClearSelected();
        }
Exemplo n.º 11
0
        private void fillForm(int LogORAppt, TrxLog clsLog, ListView lvw)
        {
            bool bHaveNonFoodList = false;
            bool bHaveNotes       = false;
            int  totEntries       = 0;
            int  totStdLbs        = 0;
            int  totOtherLbs      = 0;
            int  totTEFAP         = 0;
            int  totSuppl         = 0;
            int  totBaby          = 0;

            int infants  = 0;
            int yth      = 0;
            int teens    = 0;
            int eighteen = 0;
            int adlt     = 0;
            int senr     = 0;
            int totFam   = 0;

            DataSet      dset = clsLog.DSet;
            DataRow      drow;
            ListViewItem lvItm;

            for (int i = 0; i < dset.Tables[0].Rows.Count; i++)
            {
                try
                {
                    drow = dset.Tables[0].Rows[i];
                    if (drow["NonFoodSvcList"].ToString().Trim().Length > 0)
                    {
                        bHaveNonFoodList = true;
                    }
                    if (drow["Notes"].ToString().Trim().Length > 0)
                    {
                        bHaveNotes = true;
                    }

                    infants     += int.Parse(drow["Infants"].ToString());
                    yth         += int.Parse(drow["Youth"].ToString());
                    teens       += int.Parse(drow["Teens"].ToString());
                    eighteen    += int.Parse(drow["Eighteen"].ToString());
                    adlt        += int.Parse(drow["Adults"].ToString());
                    senr        += int.Parse(drow["Seniors"].ToString());
                    totFam      += int.Parse(drow["TotalFamily"].ToString());
                    totStdLbs   += int.Parse(drow["LbsStd"].ToString());
                    totOtherLbs += int.Parse(drow["LbsOther"].ToString());
                    totTEFAP    += int.Parse(drow["LbsCommodity"].ToString());
                    totSuppl    += int.Parse(drow["LbsSupplemental"].ToString());
                    totBaby     += int.Parse(drow["LbsBabySvc"].ToString());
                    totEntries++;

                    lvItm      = new ListViewItem();
                    lvItm.Text = (i + 1).ToString();
                    lvItm.Name = drow["TrxId"].ToString();
                    foreach (ColumnHeader col in lvw.Columns)
                    {
                        switch (col.Text.ToLower())
                        {
                        case "name": lvItm.SubItems.Add(drow["Name"].ToString()); break;

                        case "address": lvItm.SubItems.Add(drow["Address"].ToString()); break;

                        case "apt#": lvItm.SubItems.Add(drow["AptNbr"].ToString()); break;

                        case "type": lvItm.SubItems.Add(clsLog.StatusNameShort); break;

                        case "<3":   lvItm.SubItems.Add(drow["Infants"].ToString()); break;

                        case "3-12": lvItm.SubItems.Add(drow["Youth"].ToString()); break;

                        case "3-17":
                            lvItm.SubItems.Add((Convert.ToInt32(drow["Youth"]) + Convert.ToInt32(drow["Teens"])).ToString());
                            break;

                        case "tns":  lvItm.SubItems.Add(drow["Teens"].ToString()); break;

                        case "18":   lvItm.SubItems.Add(drow["Eighteen"].ToString()); break;

                        case "adlt": lvItm.SubItems.Add(drow["Adults"].ToString()); break;

                        case "tot":  lvItm.SubItems.Add(drow["TotalFamily"].ToString()); break;

                        case "":     lvItm.SubItems.Add("");
                            lvItm.SubItems[lvItm.SubItems.Count - 1].BackColor = Color.Gray; break;

                        case "sen":  lvItm.SubItems.Add(drow["Seniors"].ToString()); break;

                        case "lbs":  lvItm.SubItems.Add(drow["LbsStd"].ToString()); break;

                        case "oth":  lvItm.SubItems.Add(drow["LbsOther"].ToString()); break;

                        case "cm":   lvItm.SubItems.Add(drow["LbsCommodity"].ToString()); break;

                        case "supl": lvItm.SubItems.Add(drow["LbsSupplemental"].ToString()); break;

                        case "baby": lvItm.SubItems.Add(drow["LbsBabySvc"].ToString()); break;

                        case "notes": lvItm.SubItems.Add(drow["Notes"].ToString()); break;

                        case "food svc list": lvItm.SubItems.Add(drow["FoodSvcList"].ToString()); break;

                        case "non-food svc lst": lvItm.SubItems.Add(drow["NonFoodSvcList"].ToString()); break;

                        case "baby service list": lvItm.SubItems.Add(drow["BabySvcList"].ToString()); break;

                        case "id":     lvItm.SubItems.Add(drow["HouseholdId"].ToString()); break;

                        case "fiscal": lvItm.SubItems.Add(txtNew((bool)drow["FiscalFirstTime"])); break;

                        case "status": lvItm.SubItems.Add(drow["TrxStatus"].ToString()); break;

                        case "hmless": lvItm.SubItems.Add(txtYes((bool)drow["HomeLess"])); break;

                        case "first":  lvItm.SubItems.Add(txtYes((bool)drow["FirstTimeEver"])); break;
                        }
                    }
                    switch (Convert.ToInt32(drow["TrxStatus"]))
                    {
                    case CCFBGlobal.statusTrxLog_Service:
                        lvItm.BackColor = Color.LightYellow;
                        break;

                    case CCFBGlobal.statusTrxLog_FastTrack:
                        lvItm.BackColor = Color.LightCyan;
                        break;

                    case CCFBGlobal.statusTrxLog_NewAppt:
                        lvItm.BackColor = Color.MistyRose;
                        break;

                    case CCFBGlobal.statusTrxLog_NoShow:
                        lvItm.BackColor = Color.Tan;
                        break;

                    default:
                        lvItm.BackColor = Color.LightGray;
                        break;
                    }
                    lvItm.Tag = i;
                    if (drow["TrxSigID"] != DBNull.Value)
                    {
                        lvItm.ImageIndex = 0;
                    }
                    lvw.Items.Add(lvItm);
                }
                catch (Exception ex)
                {
                    CCFBGlobal.appendErrorToErrorReport("", ex.GetBaseException().ToString());
                }
                if (rdoDescending.Checked == true)
                {
                    lvColSorterLog.Order = SortOrder.Descending;
                    this.lvDailyLog.Sort();
                }
            }
            int tmpWidth = 0;

            if (bHaveNonFoodList == true)
            {
                tmpWidth = 200;
            }
            lvDailyLog.Columns[20].Width = tmpWidth;
            tmpWidth = 50;
            if (bHaveNotes == true)
            {
                tmpWidth = 200;
            }
            lvDailyLog.Columns[18].Width = tmpWidth;

            if (LogORAppt == 0)
            {
                tbDateDL.Text = curSvcDisplayDate.ToShortDateString();
                lblDayDL.Text = curSvcDisplayDate.DayOfWeek.ToString();

                tbTotInfDL.Text = infants.ToString();
                if (tbTotTeenDL.Visible == true)
                {
                    tbTotYthDL.Text  = yth.ToString();
                    tbTotTeenDL.Text = teens.ToString();
                }
                else
                {
                    tbTotYthDL.Text = (yth + teens).ToString();
                }
                tbTotEighteenDL.Text = eighteen.ToString();
                tbTotAdltDL.Text     = adlt.ToString();
                tbTotSnrsDL.Text     = senr.ToString();
                //tbTotFamilyDL.Text = totFam.ToString();
                tbTotalFamDL.Text     = totFam.ToString();
                tbTotLbsDL.Text       = totStdLbs.ToString();
                tbTotOthDL.Text       = totOtherLbs.ToString();
                tbTotCmDL.Text        = totTEFAP.ToString();
                tbTotSuplDL.Text      = totSuppl.ToString();
                tbTotBabyDL.Text      = totBaby.ToString();
                tbTotalEntriesDL.Text = totEntries.ToString();
                tbTotSrvcLbsDL.Text   = (totStdLbs + totOtherLbs + totTEFAP + totSuppl).ToString();
            }
            else
            {
                tbDateAL.Text = curApptDisplayDate.ToShortDateString();
                lblDayAL.Text = curApptDisplayDate.DayOfWeek.ToString();

                tbTotInfAL.Text       = infants.ToString();
                tbTotYthAL.Text       = yth.ToString();
                tbTotTeenAL.Text      = teens.ToString();
                tbTotEighteenAL.Text  = teens.ToString();
                tbTotEighteenAL.Text  = adlt.ToString();
                tbTotSenAL.Text       = senr.ToString();
                tbTotFamilyAL.Text    = totFam.ToString();
                tbTotalFamAL.Text     = totFam.ToString();
                tbTotLbsAL.Text       = totStdLbs.ToString();
                tbTotOtherAL.Text     = totOtherLbs.ToString();
                tbTotCmAL.Text        = totTEFAP.ToString();
                tbTotSuplAL.Text      = totSuppl.ToString();
                tbTotalEntriesAL.Text = totEntries.ToString();
                tbTotSrvcLbsAL.Text   = (totStdLbs + totOtherLbs + totTEFAP + totSuppl).ToString();
            }
        }
Exemplo n.º 12
0
        private void fillForm(int LogORAppt, TrxLog clsLog, ListView lvw)
        {
            int totEntries  = 0;
            int totStdLbs   = 0;
            int totOtherLbs = 0;
            int totTEFAP    = 0;
            int totSuppl    = 0;
            int totBaby     = 0;

            int infants  = 0;
            int yth      = 0;
            int teens    = 0;
            int eighteen = 0;
            int adlt     = 0;
            int senr     = 0;
            int totFam   = 0;

            DataSet      dset = clsLog.DSet;
            DataRow      drow;
            ListViewItem lvItm;

            for (int i = 0; i < dset.Tables[0].Rows.Count; i++)
            {
                try
                {
                    drow         = dset.Tables[0].Rows[i];
                    infants     += int.Parse(drow["Infants"].ToString());
                    yth         += int.Parse(drow["Youth"].ToString());
                    teens       += int.Parse(drow["Teens"].ToString());
                    eighteen    += int.Parse(drow["Eighteen"].ToString());
                    adlt        += int.Parse(drow["Adults"].ToString());
                    senr        += int.Parse(drow["Seniors"].ToString());
                    totFam      += int.Parse(drow["TotalFamily"].ToString());
                    totStdLbs   += int.Parse(drow["LbsStd"].ToString());
                    totOtherLbs += int.Parse(drow["LbsOther"].ToString());
                    totTEFAP    += int.Parse(drow["LbsCommodity"].ToString());
                    totSuppl    += int.Parse(drow["LbsSupplemental"].ToString());
                    totSuppl    += int.Parse(drow["LbsBabySvc"].ToString());
                    totEntries++;

                    lvItm      = new ListViewItem();
                    lvItm.Text = (i + 1).ToString();
                    lvItm.Name = drow["TrxId"].ToString();
                    foreach (ColumnHeader col in lvw.Columns)
                    {
                        switch (col.Text.ToLower())
                        {
                        case "name": lvItm.SubItems.Add(drow["Name"].ToString()); break;

                        case "type": lvItm.SubItems.Add(clsLog.StatusNameShort); break;

                        case "<3":   lvItm.SubItems.Add(drow["Infants"].ToString()); break;

                        case "yth":  lvItm.SubItems.Add(drow["Youth"].ToString()); break;

                        case "tn":   lvItm.SubItems.Add(drow["Teens"].ToString()); break;

                        case "18": lvItm.SubItems.Add(drow["Eighteen"].ToString()); break;

                        case "adlt": lvItm.SubItems.Add(drow["Adults"].ToString()); break;

                        case "sen":  lvItm.SubItems.Add(drow["Seniors"].ToString()); break;

                        case "lbs":  lvItm.SubItems.Add(drow["LbsStd"].ToString()); break;

                        case "oth":  lvItm.SubItems.Add(drow["LbsOther"].ToString()); break;

                        case "cm":   lvItm.SubItems.Add(drow["LbsCommodity"].ToString()); break;

                        case "supl": lvItm.SubItems.Add(drow["LbsSupplemental"].ToString()); break;

                        case "baby": lvItm.SubItems.Add(drow["LbsBabySvc"].ToString()); break;

                        case "notes": lvItm.SubItems.Add(drow["Notes"].ToString()); break;

                        case "food svc list": lvItm.SubItems.Add(drow["FoodSvcList"].ToString()); break;

                        case "non-food svc lst": lvItm.SubItems.Add(drow["NonFoodSvcList"].ToString()); break;

                        case "baby service list": lvItm.SubItems.Add(drow["BabySvcList"].ToString()); break;

                        case "id": lvItm.SubItems.Add(drow["HouseholdId"].ToString()); break;

                        case "fir": lvItm.SubItems.Add(drow["FiscalFirstTime"].ToString()); break;

                        case "status": lvItm.SubItems.Add(drow["TrxStatus"].ToString()); break;

                        case "tra": lvItm.SubItems.Add(drow["HomeLess"].ToString()); break;
                        }
                    }
                    if (Int16.Parse(drow["TrxStatus"].ToString()) == 2)
                    {
                        lvItm.BackColor = Color.MistyRose;
                    }
                    else
                    {
                        lvItm.BackColor = Color.LightYellow;
                    }
                    lvItm.Tag = i;
                    lvw.Items.Add(lvItm);
                }
                catch (Exception ex)
                {
                    CCFBGlobal.appendErrorToErrorReport("", ex.GetBaseException().ToString(),
                                                        CCFBGlobal.serverName);
                }
            }
            if (LogORAppt == 0)
            {
                tbDateDL.Text = curSvcDisplayDate.ToShortDateString();
                lblDayDL.Text = curSvcDisplayDate.DayOfWeek.ToString();

                tbTotInfDL.Text       = infants.ToString();
                tbTotYthDL.Text       = yth.ToString();
                tbTotTeenDL.Text      = teens.ToString();
                tbTotEighteenDL.Text  = eighteen.ToString();
                tbTotAdltDL.Text      = adlt.ToString();
                tbTotSnrsDL.Text      = senr.ToString();
                tbTotFamilyDL.Text    = totFam.ToString();
                tbTotLbsDL.Text       = totStdLbs.ToString();
                tbTotOthDL.Text       = totOtherLbs.ToString();
                tbTotCmDL.Text        = totTEFAP.ToString();
                tbTotSuplDL.Text      = totSuppl.ToString();
                tbTotBabyDL.Text      = totBaby.ToString();
                tbTotalEntriesDL.Text = totEntries.ToString();
                tbTotSrvcLbsDL.Text   = (totStdLbs + totOtherLbs + totTEFAP + totSuppl).ToString();
            }
            else
            {
                tbDateAL.Text = curApptDisplayDate.ToShortDateString();
                lblDayAL.Text = curApptDisplayDate.DayOfWeek.ToString();

                tbTotInfAL.Text       = infants.ToString();
                tbTotYthAL.Text       = yth.ToString();
                tbTotTeenAL.Text      = teens.ToString();
                tbTotEighteenAL.Text  = teens.ToString();
                tbTotEighteenAL.Text  = adlt.ToString();
                tbTotSenAL.Text       = senr.ToString();
                tbTotFamilyAL.Text    = totFam.ToString();
                tbTotLbsAL.Text       = totStdLbs.ToString();
                tbTotOtherAL.Text     = totOtherLbs.ToString();
                tbTotCmAL.Text        = totTEFAP.ToString();
                tbTotSuplAL.Text      = totSuppl.ToString();
                tbTotalEntriesAL.Text = totEntries.ToString();
                tbTotSrvcLbsAL.Text   = (totStdLbs + totOtherLbs + totTEFAP + totSuppl).ToString();
            }
        }