public void initForm(Client clsClientIn, bool ModeIn, bool isApptIn, int TrxIndexIn, int hhMemID) { clsClient = clsClientIn; clsTrxLog = clsClient.clsHHSvcTrans; isNewTrx = ModeIn; isAppt = isApptIn; if (isNewTrx == false) { chkManualEntry.Checked = true; chkEnterNonFoodManually.Checked = true; } else { chkManualEntry.Checked = false; chkEnterNonFoodManually.Checked = false; } SetDisplayMode(); //cboClientType. for (int i = 0; i < cboClientType.Items.Count; i++) { if (clsClient.clsHH.ClientType == Convert.ToInt16(clsParmClientType.DSet.Tables[0].Rows[i]["ID"])) { cboClientType.SelectedIndex = i; break; } } if (TrxIndexIn < 0) { clsTrxItem = new TrxLogItem(clsTrxLog.DSet.Tables[0].NewRow(), clsClient.clsHH, hhMemID); if (isAppt == true) { BackColor = CCFBGlobal.bkColorApptEdit; trxDateIn = CCFBGlobal.DefalutApptDate; lblService.Text = "New Appointment"; clsTrxItem.TrxStatus = CCFBGlobal.statusTrxLog_NewAppt; } else { BackColor = CCFBGlobal.bkColorBaseEdit; trxDateIn = CCFBGlobal.DefaultServiceDate; lblService.Text = "New Service Transaction"; clsTrxItem.TrxStatus = CCFBGlobal.statusTrxLog_Service; } clsTrxItem.TrxDate = Convert.ToDateTime(trxDateIn); clsDaysOpen.openTopTwentyWithinDate(clsTrxItem.TrxDate); clsDaysOpen.FindDate(clsTrxItem.TrxDate); CCFBGlobal.clsDailyItems.SetServiceDate(trxDateIn, clsDaysOpen.IsCommodity, clsDaysOpen.SpecialItems); CCFBGlobal.clsDailyItems.InitClientData(clsClient); MarkNewServiceItems(); } else { if (clsTrxLog.TrxId != TrxIndexIn) { clsTrxLog.find(TrxIndexIn); } 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); } loadingControls = true; CCFBGlobal.clsDailyItems.fillListViewItems(lvwFoodSvcItems, lvwNonFoodSvcItems, lvwBabyServices); if (lvwNonFoodSvcItems.Items.Count == 0) { lvwNonFoodSvcItems.Visible = false; chkEnterNonFoodManually.Checked = true; } fillForm(); }
private void CalendarDayClick(Pabo.Calendar.PBCalendar sender, Pabo.Calendar.DayClickEventArgs e) { Pabo.Calendar.DateItem[] dItems; Int32 dtIndex = -1; DateTime dateWork = Convert.ToDateTime(e.Date); int newImageListIndex = 0; String newDateText = ""; dtIndex = pbCalendar1.Dates.IndexOf(dateWork); if (dtIndex == -1) { AddDateToCalendar(dateWork, false, ""); clsDaysOpen.AddDate(dateWork, false, ""); } else if (mClickMode == 2) { dItems = pbCalendar1.Dates.DateInfo(dateWork); if (dItems[0].ImageListIndex == 0) { newImageListIndex = -1; } else { newImageListIndex = 0; } dItems[0].ImageListIndex = newImageListIndex; dItems = pbCalendar2.Dates.DateInfo(dateWork); dItems[0].ImageListIndex = newImageListIndex; dItems = pbCalendar3.Dates.DateInfo(dateWork); dItems[0].ImageListIndex = newImageListIndex; dItems = pbCalendar4.Dates.DateInfo(dateWork); dItems[0].ImageListIndex = newImageListIndex; clsDaysOpen.FindDate(dateWork); clsDaysOpen.IsCommodity = (newImageListIndex == 0); } else if (mClickMode == 3) { dItems = pbCalendar1.Dates.DateInfo(dateWork); if (dItems[0].Text == "") { newDateText = "Spcl"; } else { newDateText = ""; } dItems[0].Text = newDateText; dItems = pbCalendar2.Dates.DateInfo(dateWork); dItems[0].Text = newDateText; dItems = pbCalendar3.Dates.DateInfo(dateWork); dItems[0].Text = newDateText; dItems = pbCalendar4.Dates.DateInfo(dateWork); dItems[0].Text = newDateText; clsDaysOpen.FindDate(dateWork); if (newDateText == "") { clsDaysOpen.SpecialItems = ""; } else { clsDaysOpen.SpecialItems = SpecialFoodList(); } } clsDaysOpen.update(); }