internal void cmdCancel_Click(Object eventSender, System.EventArgs eventArgs)
        {
            modGlobal.Shared.gLeaveType = "";
            modGlobal.Shared.gPayType   = "";
            modGlobal.Shared.gSCKFlag   = 0;
            modGlobal.Shared.gVacBank   = 0;

            if (ViewModel.txtLeaveNotes.Visible)
            {
                modGlobal.Shared.gLeaveNotes = Strings.Replace(ViewModel.txtLeaveNotes.Text, "'", "''", 1, -1, CompareMethod.Binary).Trim();
            }
            if (ViewModel.NotesRequired && modGlobal.Shared.gLeaveNotes == "")
            {
                FindNotes();
                if (modGlobal.Clean(ViewModel.txtLeaveNotes.Text) == "")
                {
                    ViewManager.ShowMessage("Notes are required for this schedule change", this.ViewModel.Text, UpgradeHelpers.Helpers.BoxButtons.OK);
                    ViewManager.SetCurrent(ViewModel.txtLeaveNotes);
                    return;
                }
            }
            ViewManager.DisposeView(

                dlgTime.DefInstance);
        }
        internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
        {
            //Closes form
            if (ViewModel.chkAMPM.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
            {
                modGlobal.Shared.gFullShift = -1;
            }
            if (modGlobal.Shared.gExtendLeave != 0)
            {
                modGlobal.Shared.gStartTrans = ViewModel.calStartLeave.Value.Date.ToString("M/d/yyyy");
                if (ViewModel.calEndLeave.Value.Date.AddDays(1).ToString("M/d/yyyy") != modGlobal.Shared.gEndTrans)
                {
                    modGlobal.Shared.gEndTrans = ViewModel.calEndLeave.Value.Date.AddDays(1).ToString("M/d/yyyy");
                }
            }

            if (ViewModel.txtLeaveNotes.Visible)
            {
                modGlobal.Shared.gLeaveNotes = Strings.Replace(ViewModel.txtLeaveNotes.Text, "'", "''", 1, -1, CompareMethod.Binary).Trim();
            }
            if (ViewModel.NotesRequired && modGlobal.Shared.gLeaveNotes == "")
            {
                FindNotes();
                if (modGlobal.Clean(ViewModel.txtLeaveNotes.Text) == "")
                {
                    ViewManager.ShowMessage("Notes are required for this schedule change", this.ViewModel.Text, UpgradeHelpers.Helpers.BoxButtons.OK);
                    ViewManager.SetCurrent(ViewModel.txtLeaveNotes);
                    return;
                }
            }
            ViewManager.HideView(this);
            ViewManager.DisposeView(

                dlgTime.DefInstance);
        }
Exemplo n.º 3
0
 internal void cmdClose_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //Transfer Canceled
     modGlobal
     .Shared.gTransCancel = -1;
     ViewManager.DisposeView(this);
 }
Exemplo n.º 4
0
 internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //OK Transfer
     modGlobal
     .Shared.gTransCancel = 0;
     ViewManager.DisposeView(this);
 }
Exemplo n.º 5
0
        internal void OKButton_Click(Object eventSender, System.EventArgs eventArgs)
        {
            bool ADDItem = false;

            //Add logic to Insert rows to the Uniform & PersonnelUniform tables
            for (int i = 1; i <= 8; i++)
            {
                ViewModel.sprPPEList.Row = i;
                ADDItem = false;
                for (int x = 1; x <= 5; x++)
                {
                    ViewModel.sprPPEList.Col = x;
                    if (modGlobal.Clean(ViewModel.sprPPEList.Text) != "")
                    {
                        ADDItem = true;
                    }
                }
                if (ADDItem)
                {
                    ViewModel.CurrRow = i;
                    AddPPEUniform();
                }
            }
            ViewManager.DisposeView(this);
        }
Exemplo n.º 6
0
        internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
        {
            //Check state of check box/calendar controls and
            //Update global start/end variables
            //Unload form

            if (ViewModel.chkBothShifts.Visible)
            {
                if (ViewModel.chkBothShifts.CheckState == UpgradeHelpers.Helpers.CheckState.Unchecked)
                {
                    if (modGlobal.Shared.gStartTrans.Substring(Math.Max(modGlobal.Shared.gStartTrans.Length - 2, 0)) == "AM")
                    {
                        modGlobal.Shared.gEndTrans = modGlobal.Shared.gStartTrans.Substring(0, Math.Min(Strings.Len(modGlobal.Shared.gStartTrans) - 2, modGlobal.Shared.gStartTrans.Length)) + "PM";
                    }
                    modGlobal.Shared.gFullShift = 0;
                }
                else
                {
                    if (modGlobal.Shared.gStartTrans.Substring(Math.Max(modGlobal.Shared.gStartTrans.Length - 2, 0)) == "PM")
                    {
                        modGlobal.Shared.gStartTrans = modGlobal.Shared.gStartTrans.Substring(0, Math.Min(Strings.Len(modGlobal.Shared.gStartTrans) - 2, modGlobal.Shared.gStartTrans.Length)) + "AM";
                    }
                    modGlobal.Shared.gFullShift = -1;
                }
            }
            else if (ViewModel.lbStart.Visible)
            {
                modGlobal.Shared.gStartTrans = ViewModel.calStart.Value.Date.ToString("M/d/yyyy") + modGlobal.Shared.gStartTrans.Substring(Math.Max(modGlobal.Shared.gStartTrans.Length - 7, 0));
                modGlobal.Shared.gEndTrans   = ViewModel.calEnd.Value.Date.AddDays(1).ToString("M/d/yyyy") + " 7:00AM";
            }
            ViewManager.DisposeView(this);
        }
        internal void cmdAvailDone_Click(Object eventSender, System.EventArgs eventArgs)
        {
            ViewModel.cmdAvailDone.Enabled = false;

            AddAvailableShift();
            ViewModel.txtAvailComment.Text = "";
            ViewManager.DisposeView(this);
        }
Exemplo n.º 8
0
        internal void OKButton_Click(Object eventSender, System.EventArgs eventArgs)
        {
            using (var async1 = this.Async(true))
            {
                //Store filename & path in global variable gExcelPath
                UpgradeHelpers.Helpers.DialogResult Response = (UpgradeHelpers.Helpers.DialogResult) 0;

                string FilePath = modGlobal.Clean(ViewModel.txtFileName.Text);
                if (FilePath == "" || FilePath == "*.xls")
                {
                    ViewManager.ShowMessage("Please indicate FileName", "Error Message", UpgradeHelpers.Helpers.BoxButtons.OK, UpgradeHelpers.Helpers.BoxIcons.Error);
                    ViewManager.SetCurrent(ViewModel.txtFileName);
                    this.Return();
                    return;
                }

                //Load File Path
                if (ViewModel.Dir1.Path.Substring(Math.Max(ViewModel.Dir1.Path.Length - 1, 0)) == "\\")
                {
                    FilePath = ViewModel.Dir1.Path + FilePath;
                }
                else
                {
                    FilePath = ViewModel.Dir1.Path + "\\" + FilePath;
                }

                //Check for existing file with selected name
                Object FSO = new System.Object();
                if (File.Exists(FilePath))
                {
                    async1.Append <UpgradeHelpers.Helpers.DialogResult>(() => ViewManager.ShowMessage("File exists - Overwrite?", "TFD Stats - Excel Export", UpgradeHelpers.Helpers.BoxButtons.YesNo));
                    async1.Append <UpgradeHelpers.Helpers.DialogResult, UpgradeHelpers.Helpers.DialogResult>(tempNormalized0 => tempNormalized0);
                    async1.Append <UpgradeHelpers.Helpers.DialogResult>(tempNormalized1 =>
                    {
                        Response = tempNormalized1;
                    });
                    async1.Append(() =>
                    {
                        if (Response == UpgradeHelpers.Helpers.DialogResult.No)
                        {
                            this.Return();
                            return;
                        }
                        else
                        {
                            File.Delete(FilePath);
                            FSO = null;
                        }
                    });
                }
                async1.Append(() =>
                {
                    modGlobal.Shared.gExcelPath = FilePath;
                    ViewManager.DisposeView(this);
                });
            }
        }
Exemplo n.º 9
0
 internal void cmdCancel_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //Re-initialize global variables
     modGlobal
     .Shared.gTradeEmp           = "";
     modGlobal.Shared.gFullShift = 0;
     modGlobal.Shared.gSType     = "";
     ViewManager.DisposeView(this);
 }
 internal void cmdCancel_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //Cancel Archive Actions
     modGlobal
     .Shared.gTransCancel         = -1;
     modGlobal.Shared.gStartTrans = "";
     modGlobal.Shared.gAssignID   = "";
     modGlobal.Shared.gDetailEmp  = "";
     ViewManager.DisposeView(this);
 }
Exemplo n.º 11
0
 internal void cmdCancel_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //Clear global variables set by this dialog
     //Unload form
     modGlobal
     .Shared.gLeaveType           = "";
     modGlobal.Shared.gStartTrans = "";
     modGlobal.Shared.gEndTrans   = "";
     modGlobal.Shared.gAssignment = 0;
     ViewManager.DisposeView(this);
 }
Exemplo n.º 12
0
 internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
 {
     if (ViewModel.chkAMPM.CheckState == UpgradeHelpers.Helpers.CheckState.Unchecked)
     {
         modGlobal.Shared.gFullShift = 0;
     }
     else
     {
         modGlobal.Shared.gFullShift = -1;
     }
     modGlobal.Shared.gSType = "";
     ViewManager.DisposeView(this);
 }
Exemplo n.º 13
0
        internal void cmdDone_Click(Object eventSender, System.EventArgs eventArgs)
        {
            PTSProject.clsScheduler cScheduler = Container.Resolve <clsScheduler>();
            //Check for Date Selection
            //exit sub

            int iYear = DateTime.Now.AddYears(1).Year;

            //Get the maximum shift_start year from Schedule... just incase
            if (cScheduler.GetScheduleMaxYear() != 0)
            {
                if (!cScheduler.ScheduleRecord.EOF)
                {
                    //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                    iYear = Convert.ToInt32(modGlobal.GetVal(cScheduler.ScheduleRecord["MaxYear"]));
                }
            }

            if (!ViewModel.lbEndDate.Visible)
            {
                //TRANSFER END DATE CHANGE
                System
                .DateTime TempDate = DateTime.FromOADate(0);
                modGlobal.Shared.gEndTrans = (DateTime.TryParse("2/1/" + iYear.ToString(), out TempDate)) ? TempDate.ToString("MM/dd/yyyy") : "2/1/" + iYear.ToString();
            }
            else if (modGlobal.Shared.gEndTrans == "")
            {
                modGlobal.Shared.gEndTrans = ViewModel.calEndDate.Value.Date.ToString("MM/dd/yyyy");
            }
            else
            {
                modGlobal.Shared.gEndTrans = ViewModel.calEndDate.Value.Date.ToString("MM/dd/yyyy");
            }


            modGlobal.Shared.gStartTrans = ViewModel.calStartDate.Value.Date.ToString("MM/dd/yyyy");


            modGlobal.Shared.gTransCancel = 0;
            ViewManager.DisposeView(this);
        }
        internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
        {
            //Save Note or Create new Note record and Exit

            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            //ADORecordSetHelper oRec = null;
            //string strSQL = "";
            string strNote = "";

            //string str1 = "", str2 = "";
            //int i = 0;

            if (ViewModel.txtEdit.Text == "")
            {
                return;
            }

            try
            {
                oCmd.Connection  = modGlobal.oConn;
                oCmd.CommandType = CommandType.Text;

                strNote = Strings.Replace(ViewModel.txtEdit.Text, "'", "''", 1, -1, CompareMethod.Binary).Trim();

                oCmd.CommandText = "spInsertPersonnelScheduleNotes '" + modGlobal.Shared.gReportUser + "','" + modGlobal.Shared.gStartTrans + "','" + strNote + "','" + modGlobal.Shared.gUser + "' ";
                oCmd.CommandType = CommandType.Text;
                oCmd.ExecuteNonQuery();
                ViewManager.DisposeView(this);
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
Exemplo n.º 15
0
        internal void cmdClose_Click(Object eventSender, System.EventArgs eventArgs)
        {
            using (var async1 = this.Async(true))
            {
                UpgradeHelpers.Helpers.DialogResult Response = (UpgradeHelpers.Helpers.DialogResult) 0;

                if (ViewModel.UpdateFlag != 0)
                {
                    //Update Fields
                }

                if (UpgradeHelpers.Helpers.StringsHelper.ToDoubleSafe(Convert.ToString(ViewModel.cmdNotes.Tag)) == 1 && ViewModel.txtNote.Text != "")
                {
                    async1.Append <UpgradeHelpers.Helpers.DialogResult>(() => ViewManager
                                                                        .ShowMessage("The Schedule Notes have not been saved." + "\n" + "\n" + "Did you want to exit now?", "Add Employee Schedule Notes", UpgradeHelpers.Helpers.BoxButtons.YesNo));
                    async1.Append <UpgradeHelpers.Helpers.DialogResult, UpgradeHelpers.Helpers.DialogResult>(tempNormalized0 => tempNormalized0);
                    async1.Append <UpgradeHelpers.Helpers.DialogResult>(tempNormalized1 =>
                    {
                        Response = tempNormalized1;
                    });
                    async1.Append(() =>
                    {
                        if (Response == UpgradeHelpers.Helpers.DialogResult.No)
                        {
                            ViewManager.SetCurrent(ViewModel.cmdNotes);
                            this.Return();
                            return;
                        }
                    });
                }
                async1.Append(() =>
                {
                    ViewManager.DisposeView(this);
                });
            }
        }
Exemplo n.º 16
0
 internal void cmdClose_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //Close Add New Employee form
     ViewManager.DisposeView(this);
 }
 internal void CancelButton_Renamed_Click(Object eventSender, System.EventArgs eventArgs)
 {
     ViewManager.DisposeView(this);
 }
Exemplo n.º 18
0
        internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
        {
            //Save Note or Create new Note record and Exit

            DbCommand          oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            ADORecordSetHelper oRec = null;
            //string strSQL = "";
            string strNote = "";

            //string str1 = "", str2 = "";
            //int i = 0;

            try
            {
                oCmd.Connection  = modGlobal.oConn;
                oCmd.CommandType = CommandType.Text;


                //    If Len(Trim$(txtNote.Text)) > 254 Then
                //        MsgBox "Note field contains too many characters. Please edit comments", vbInformation, "Battalion Scheduler"
                //        txtNote.Text = Left$(Trim$(txtNote.Text), 254)
                //        Exit Sub
                //    End If
                //
                //     strNote = Left$(Trim$(txtNote.Text), 254)
                strNote = Strings.Replace(ViewModel.txtNote.Text, "'", "''", 1, -1, CompareMethod.Binary).Trim();
                //    Do Until InStr(1, strNote, "'") = 0
                //        I = InStr(1, strNote, "'")
                //        str1 = Left$(strNote, I - 1)
                //        str2 = Right$(strNote, Len(strNote) - I)
                //        strNote = str1 & "-" & str2
                //    Loop
                ViewModel.txtNote.Text = strNote;

                if (ViewModel.NoteID == 0)
                {
                    //New note for this shift
                    if (strNote != "")
                    {
                        //Add new Note record
                        oCmd.CommandText = "select next_note = MAX(note_id) + 1 From Schedule_Notes";
                        oRec             = ADORecordSetHelper.Open(oCmd, "");
                        //Test for existing notes
                        //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: http://www.vbtonet.com/ewis/ewi1049.aspx
                        if (!Convert.IsDBNull(oRec["next_note"]))
                        {
                            ViewModel.NoteID = Convert.ToInt32(oRec["next_note"]);
                        }
                        else
                        {
                            ViewModel.NoteID = 1;
                        }

                        oCmd.CommandType = CommandType.StoredProcedure;
                        oCmd.CommandText = "spInsertNote";
                        oCmd.ExecuteNonQuery(new object[] { ViewModel.NoteID, modGlobal.Shared.gNoteDate + " 12:00AM", "3", strNote });
                    }
                }
                else
                {
                    //Update current note
                    oCmd.CommandType = CommandType.Text;
                    oCmd.CommandText = "spUpdateNote " + ViewModel.NoteID.ToString() + ",'" + strNote + "'";
                    oCmd.ExecuteNonQuery();
                }
                ViewManager.DisposeView(this);
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
Exemplo n.º 19
0
 internal void cmdCancel_Click(Object eventSender, System.EventArgs eventArgs)
 {
     //Exit with out creating or saving note
     ViewManager.DisposeView(this);
 }
Exemplo n.º 20
0
        internal void cmdAddPromo_Click(Object eventSender, System.EventArgs eventArgs)
        {
            //Find Next System Promotion key
            //Validate data entry fields
            //Insert New Promotion Record

            int                NewKey        = 0;
            int                ExclusionDays = 0;
            string             PromoType     = "";
            byte               PromoStatus   = 0;
            string             PromoDate     = "";
            DbCommand          oCmd          = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            DbCommand          oCmdInsert    = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            ADORecordSetHelper oRec          = null;
            int                OldPromos     = 0;

            try
            {
                //Edit new Promotion record fields
                if (Information.IsDate(ViewModel.txtPromotionDate.Text))
                {
                    //Valid date
                    PromoDate = ViewModel.txtPromotionDate.Text;
                }
                else
                {
                    ViewManager.ShowMessage("Promotion Date is invalid", "Add New Promotion Error", UpgradeHelpers.Helpers.BoxButtons.OK);
                    ViewManager.SetCurrent(ViewModel.txtPromotionDate);
                    ViewModel.txtPromotionDate.SelectionStart  = 0;
                    ViewModel.txtPromotionDate.SelectionLength = Strings.Len(ViewModel.txtPromotionDate.Text);
                    return;
                }

                double dbNumericTemp = 0;
                if (!Double.TryParse(ViewModel.txtEDays.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out dbNumericTemp))
                {
                    //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: http://www.vbtonet.com/ewis/ewi1049.aspx
                    if (Convert.IsDBNull(ViewModel.txtEDays.Text) || ViewModel.txtEDays.Text == "")
                    {
                        //no exclusion days entered
                        ViewModel.txtEDays.Text = "0";
                        ExclusionDays           = 0;
                    }
                    else
                    {
                        ViewManager.ShowMessage("Exclusion Days must be numeric", "Add New Promotion Error", UpgradeHelpers.Helpers.BoxButtons.OK);
                        ViewManager.SetCurrent(ViewModel.txtEDays);
                        ViewModel.txtEDays.SelectionStart  = 0;
                        ViewModel.txtEDays.SelectionLength = Strings.Len(ViewModel.txtEDays.Text);
                        return;
                    }
                }
                else
                {
                    ExclusionDays = Convert.ToInt32(Conversion.Val(ViewModel.txtEDays.Text));
                }
                PromoType        = Conversion.Str(ViewModel.cboPromotion.GetItemData(ViewModel.cboPromotion.SelectedIndex)).Trim();
                oCmd.Connection  = modGlobal.oConn;
                oCmd.CommandType = CommandType.Text;
                oCmd.CommandText = "SELECT next_id = MAX(promotion_id) + 1 From Promotion";
                oRec             = ADORecordSetHelper.Open(oCmd, "");

                NewKey = Convert.ToInt32(oRec["next_id"]);

                oCmd.CommandType = CommandType.StoredProcedure;

                //If new promotion to be active
                //Determine if older promotions exist and mark them as inactive
                if (ViewModel.chkStatus.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
                {
                    oCmd.CommandText = "spUpdatePromotionStatus";
                    oCmd.ExecuteNonQuery(new object[] { modGlobal.Shared.gAssignID, 0 });
                    OldPromos   = 1;
                    PromoStatus = 1;
                }
                else
                {
                    OldPromos   = -1;
                    PromoStatus = 0;
                }

                //Add New Promotion Record
                oCmdInsert.Connection  = modGlobal.oConn;
                oCmdInsert.CommandType = CommandType.Text;

                oCmdInsert.CommandText = "spInsertPromotion " + NewKey.ToString() + ", '" + modGlobal.Shared.gAssignID + "','" + PromoType +
                                         "','" + PromoDate + "'," + ExclusionDays.ToString() + "," + PromoStatus.ToString() + ",'" + ViewModel.txtComments.Text.Trim() + "'";
                oCmdInsert.ExecuteNonQuery();

                //Display Add New Promotion Results
                if (OldPromos > 0)
                {
                    ViewManager.ShowMessage("New Active Promotion Record successfully added, " + "older promotions marked as inactive", "Add New Promotion", UpgradeHelpers.Helpers.BoxButtons.OK);
                }
                else if (OldPromos == 0)
                {
                    ViewManager.ShowMessage("New Active Promotion Record successfully added", "Add New Promotion", UpgradeHelpers.Helpers.BoxButtons.OK);
                }
                else if (OldPromos == -1)
                {
                    ViewManager.ShowMessage("New Inactive Promotion Record successfully added,", "Add New Promotion", UpgradeHelpers.Helpers.BoxButtons.OK);
                }
                ViewManager.DisposeView(this);
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
Exemplo n.º 21
0
        internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
        {
            //Check for valid choices
            //Set values for global variables
            //Unload form

            if (ViewModel.chkRover.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
            {
                if (modGlobal.Shared.gLeaveType == "")
                {
                    modGlobal.Shared.gLeaveType = "REG";
                }
                if (modGlobal.Shared.gGoToBatt == "2")
                {
                    modGlobal.Shared.gAssignment = modGlobal.ASGN182ROV;
                }
                else if (modGlobal.Shared.gGoToBatt == "1")
                {
                    modGlobal.Shared.gAssignment = modGlobal.ASGN181ROV;
                }
                else
                {
                    //gGoToBatt = "3"
                    modGlobal
                    .Shared.gAssignment = modGlobal.ASGN183ROV;
                }
            }
            else if (ViewModel.chkDebit.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
            {
                //        gLeaveType = "DDF"
                if (modGlobal.Shared.gGoToBatt == "2")
                {
                    modGlobal.Shared.gAssignment = modGlobal.ASGN182DBT;
                }
                else if (modGlobal.Shared.gGoToBatt == "1")
                {
                    modGlobal.Shared.gAssignment = modGlobal.ASGN181DBT;
                }
                else
                {
                    //gGoToBatt = "3"
                    modGlobal
                    .Shared.gAssignment = modGlobal.ASGN183DBT;
                }
            }
            else
            {
                ViewManager.ShowMessage("You must select either Rover or Debit", "Error: Send to Other Battalion", UpgradeHelpers.Helpers.BoxButtons.OK);
                return;
            }

            if (ViewModel.chkAM.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
            {
                modGlobal.Shared.gEndTrans = modGlobal.Shared.gStartTrans.Substring(0, Math.Min(Strings.Len(modGlobal.Shared.gStartTrans) - 2, modGlobal.Shared.gStartTrans.Length)) + "PM";
            }
            else if (ViewModel.chkPM.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
            {
                modGlobal.Shared.gStartTrans = modGlobal.Shared.gStartTrans.Substring(0, Math.Min(Strings.Len(modGlobal.Shared.gStartTrans) - 2, modGlobal.Shared.gStartTrans.Length)) + "PM";
            }
            else if (ViewModel.chkBoth.CheckState != UpgradeHelpers.Helpers.CheckState.Unchecked)
            {
                //Do nothing dates stay as defaulted
            }
            else
            {
                //no shifts selected
                ViewManager.ShowMessage("You must select a shift", "Error: Send to Other Battalion", UpgradeHelpers.Helpers.BoxButtons.OK);
                return;
            }
            ViewManager.DisposeView(this);
        }
 internal void OKButton_Click(Object eventSender, System.EventArgs eventArgs)
 {
     ChangeMAXHolidayTotals();
     ViewManager.DisposeView(this);
 }
Exemplo n.º 23
0
        internal void OKButton_Click(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            //ADORecordSetHelper oRec = null;
            //string strSQL = "";

            //process one row at a time in the sprPPEList
            int tempForVar = ViewModel.sprPPEList.MaxRows;

            for (int i = 1; i <= tempForVar; i++)
            {
                ViewModel.sprPPEList.Row = i;
                ViewModel.sprPPEList.Col = 1;
                if (modGlobal.Clean(ViewModel.sprPPEList.Text) != "")
                {                 //item selected...
                    ViewModel.sprPPEList.Col = 7;
                    //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: http://www.vbtonet.com/ewis/ewi1049.aspx
                    if (Convert.IsDBNull(ViewModel.sprPPEList.Text) || modGlobal.Clean(ViewModel.sprPPEList.Text) == "")
                    {
                        ViewModel.sprPPEList.Text = "0";
                    }
                    ViewModel.iUniformID = Convert.ToInt32(Double.Parse(ViewModel.sprPPEList.Text));

                    //UPGRADE_WARNING: (1068) GetVal(iUniformID) of type Variant is being forced to double. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                    if (Convert.ToDouble(modGlobal.GetVal(ViewModel.iUniformID)) != 0)
                    {                     //item identified...
                        ViewModel.sprPPEList.Col = 6;
                        //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: http://www.vbtonet.com/ewis/ewi1049.aspx
                        if (Convert.IsDBNull(ViewModel.sprPPEList.Text) || modGlobal.Clean(ViewModel.sprPPEList.Text) == "")
                        {
                            ViewModel.sprPPEList.Text = "0";
                        }
                        ViewModel.iLaunderID = Convert.ToInt32(Double.Parse(ViewModel.sprPPEList.Text));

                        //UPGRADE_WARNING: (1068) GetVal(iLaunderID) of type Variant is being forced to double. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                        if (Convert.ToDouble(modGlobal.GetVal(ViewModel.iLaunderID)) != 0)
                        {                         //Update
                            ViewModel.sprPPEList.Col = 4;
                            if (ViewModel.sprPPEList.Lock)
                            {
                                //nothing...
                            }
                            else
                            {
                                ViewModel.sComment       = modGlobal.Clean(ViewModel.sprPPEList.Text);
                                ViewModel.sprPPEList.Col = 3;
                                if (UpgradeHelpers.Helpers.StringsHelper.ToDoubleSafe(Convert.ToString(ViewModel.sprPPEList.Value)) == 1)
                                {
                                    //UPGRADE_ISSUE: (2064) FPSpreadADO.fpSpread property sprPPEList.TypeCheckText was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                                    if (ViewModel.sprPPEList.getTypeCheckText() == DateTime.Now.ToString("M/d/yyyy"))
                                    {
                                        ViewModel.sDateApproved = DateTime.Now.ToString("M/d/yyyy HH:mm:ss");
                                        UpdateLaunderRecord();
                                    }
                                }
                            }
                        }
                        else
                        {
                            //Add new record
                            ViewModel.sDateFlagged   = DateTime.Now.ToString("M/d/yyyy HH:mm:ss");
                            ViewModel.sprPPEList.Col = 3;
                            ViewModel.sDateApproved  = "";
                            if (UpgradeHelpers.Helpers.StringsHelper.ToDoubleSafe(Convert.ToString(ViewModel.sprPPEList.Value)) == 1)
                            {
                                ViewModel.sDateApproved = DateTime.Now.ToString("M/d/yyyy HH:mm:ss");
                            }
                            ViewModel.sprPPEList.Col = 4;
                            ViewModel.sComment       = modGlobal.Clean(ViewModel.sprPPEList.Text);

                            AddLaunderRecord();
                        }
                    }
                }
            }
            ViewManager.DisposeView(this);
        }
Exemplo n.º 24
0
 internal void cmdCancel_Click(Object eventSender, System.EventArgs eventArgs)
 {
     modGlobal.Shared.gStartTrans = "";
     modGlobal.Shared.gEndTrans   = "";
     ViewManager.DisposeView(this);
 }
        internal void cmdOK_Click(Object eventSender, System.EventArgs eventArgs)
        {
            string str1 = "";
            string str2 = "";
            int    i    = 0;

            if (ViewModel.FirstTime != 0)
            {
                ViewModel.lbInstruct1.Visible = false;
                ViewModel.lbInstruct2.Visible = true;
                ViewModel.lbExit.Visible      = true;
                ViewModel.txtExit.Visible     = true;
                ViewModel.lbExitType.Visible  = true;
                ViewModel.cboExitType.Visible = true;
                ViewModel.txtComments.Visible = true;
                ViewModel.FirstTime           = 0;
                return;
            }

            if (Information.IsDate(ViewModel.txtExit.Text))
            {
                //Exit Date OK
                modGlobal
                .Shared.gStartTrans = ViewModel.txtExit.Text;
            }
            else
            {
                ViewManager.ShowMessage("Exit date is Invalid", "Archive Personnel", UpgradeHelpers.Helpers.BoxButtons.OK, UpgradeHelpers.Helpers.BoxIcons.Error);
                ViewManager.SetCurrent(ViewModel.txtExit);
                ViewModel.txtExit.SelectionStart  = 0;
                ViewModel.txtExit.SelectionLength = Strings.Len(ViewModel.txtExit.Text);
                return;
            }

            switch (ViewModel.cboExitType.Text)
            {
            case "Retirement":
                modGlobal.Shared.gAssignID = "RT";
                break;

            case "Transfer":
                modGlobal.Shared.gAssignID = "TR";
                break;

            case "Resignation":
                modGlobal.Shared.gAssignID = "QT";
                break;

            case "Termination":
                modGlobal.Shared.gAssignID = "TM";
                break;

            default:
                ViewManager.ShowMessage("Please select a Reason for Leaving", "Archive Personnel", UpgradeHelpers.Helpers.BoxButtons.OK, UpgradeHelpers.Helpers.BoxIcons.Error);
                ViewManager.SetCurrent(ViewModel.cboExitType);
                return;
            }

            modGlobal.Shared.gDetailEmp = ViewModel.txtComments.Text.Trim();

            while ((modGlobal.Shared.gDetailEmp.IndexOf('\'') + 1) != 0)
            {
                i    = (modGlobal.Shared.gDetailEmp.IndexOf('\'') + 1);
                str1 = modGlobal.Shared.gDetailEmp.Substring(0, Math.Min(i - 1, modGlobal.Shared.gDetailEmp.Length));
                str2 = modGlobal.Shared.gDetailEmp.Substring(Math.Max(modGlobal.Shared.gDetailEmp.Length - (Strings.Len(modGlobal.Shared.gDetailEmp) - i), 0));
                modGlobal.Shared.gDetailEmp = str1 + "-" + str2;
            }
            ;
            modGlobal.Shared.gDetailEmp = modGlobal.Shared.gDetailEmp.Substring(0, Math.Min(255, modGlobal.Shared.gDetailEmp.Length));

            modGlobal.Shared.gTransCancel = 0;
            ViewManager.DisposeView(this);
        }
        internal void OKButton_Click(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand          oCmd   = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            ADORecordSetHelper oRec   = null;
            string             strSQL = "";

            //process one row at a time in the sprPPEList
            int tempForVar = ViewModel.sprPPEList.MaxRows;

            for (int i = 1; i <= tempForVar; i++)
            {
                ViewModel.CreateLaunderRecord = false;
                ViewModel.sprPPEList.Row      = i;
                ViewModel.sprPPEList.Col      = 2;
                if (modGlobal.Clean(ViewModel.sprPPEList.Text) != "")
                {
                    oCmd.Connection  = modGlobal.oConn;
                    oCmd.CommandType = CommandType.Text;
                    strSQL           = "spSelect_UniformRepairerByName '" + modGlobal.Clean(ViewModel.sprPPEList.Text) + "' ";
                    oCmd.CommandText = strSQL;
                    oRec             = ADORecordSetHelper.Open(oCmd, "");

                    if (oRec.EOF)
                    {
                        ViewModel.iRepairerID = 0;
                    }
                    else
                    {
                        ViewModel.iRepairerID = Convert.ToInt32(oRec["repairer_id"]);
                    }
                }
                else
                {
                    ViewModel.iRepairerID = 0;
                }
                ViewModel.sprPPEList.Col = 3;
                ViewModel.sDateIn        = modGlobal.Clean(ViewModel.sprPPEList.Text);
                ViewModel.sprPPEList.Col = 4;
                ViewModel.sDateOut       = modGlobal.Clean(ViewModel.sprPPEList.Text);
                ViewModel.sprPPEList.Col = 5;
                ViewModel.sComment       = modGlobal.Clean(ViewModel.sprPPEList.Text);
                ViewModel.sprPPEList.Col = 6;
                if (UpgradeHelpers.Helpers.StringsHelper.ToDoubleSafe(Convert.ToString(ViewModel.sprPPEList.Value)) == 1)
                {
                    DetermineSecurity();
                    if (ViewModel.NoLimitUpdate)
                    {
                        ViewModel.CreateLaunderRecord = true;
                    }
                    else
                    {
                        ViewManager.ShowMessage("You do not have the authority to create a Vendor Cleaning record.", "Insert UniformLaunderInfo Record", UpgradeHelpers.Helpers.BoxButtons.OK);
                    }
                }
                ViewModel.sprPPEList.Col = 7;
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: http://www.vbtonet.com/ewis/ewi1049.aspx
                if (Convert.IsDBNull(ViewModel.sprPPEList.Text) || modGlobal.Clean(ViewModel.sprPPEList.Text) == "")
                {
                    ViewModel.sprPPEList.Text = "0";
                }
                ViewModel.iRepairID      = Convert.ToInt32(Double.Parse(ViewModel.sprPPEList.Text));
                ViewModel.sprPPEList.Col = 8;
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: http://www.vbtonet.com/ewis/ewi1049.aspx
                if (Convert.IsDBNull(ViewModel.sprPPEList.Text) || modGlobal.Clean(ViewModel.sprPPEList.Text) == "")
                {
                    ViewModel.sprPPEList.Text = "0";
                }
                ViewModel.iUniformID = Convert.ToInt32(Double.Parse(ViewModel.sprPPEList.Text));

                //UPGRADE_WARNING: (1068) GetVal(iUniformID) of type Variant is being forced to double. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                if (Convert.ToDouble(modGlobal.GetVal(ViewModel.iUniformID)) != 0)
                {
                    AddRepairRecord();
                }
            }
            ViewManager.DisposeView(this);
        }
Exemplo n.º 27
0
 internal void CancelButton_Renamed_Click(Object eventSender, System.EventArgs eventArgs)
 {
     modGlobal.Shared.gExcelPath = "";
     ViewManager.DisposeView(this);
 }
        internal void cmdEditItem_Click(Object eventSender, System.EventArgs eventArgs)
        {
            PTSProject.clsUniform cUniform = Container.Resolve <clsUniform>();

            //    MsgBox "This feature is under construction!", vbOKOnly, "Updating Return Date / Inserting Retired Record"

            try
            {
                //if there is no UniformID or EmployeeID... should not be here...
                if (modGlobal.Clean(ViewModel.lbUniformID.Text) == "")
                {
                    return;
                }

                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                cUniform.UniformID = Convert.ToInt32(modGlobal.GetVal(ViewModel.lbUniformID.Text));

                //Edit Information & gather variables
                if (cUniform.GetUniformByID(cUniform.UniformID) != 0)
                {
                    cUniform.UniformReasonRetiredUniformID   = cUniform.UniformID;
                    cUniform.UniformReasonRetiredCreatedBy   = modGlobal.Shared.gUser;
                    cUniform.UniformReasonRetiredCreatedDate = UpgradeHelpers.Helpers.DateTimeHelper.ToString(DateTime.Now);
                    //Get Rid of any UniformInventory record
                    if (cUniform.DeleteUniformInventory(cUniform.UniformID) != 0)
                    {
                        //all is well either way
                    }
                }
                else
                {
                    ViewManager.ShowMessage("Could not find the Uniform in the Database.", "Find Uniform", UpgradeHelpers.Helpers.BoxButtons.OK);
                    return;
                }

                cUniform.UniformRetiredDate           = DateTime.Parse(ViewModel.dteRetired.Text).ToString("MM/dd/yyyy");
                cUniform.UniformReasonRetiredReasonID = 0;
                if (ViewModel.cboReason.SelectedIndex != -1)
                {
                    cUniform.UniformReasonRetiredReasonID = ViewModel.cboReason.GetItemData(ViewModel.cboReason.SelectedIndex);
                }
                cUniform.UniformReasonRetiredComment = modGlobal.Clean(ViewModel.txtComment.Text);

                if (ViewModel.cboItemType.GetItemData(ViewModel.cboItemType.SelectedIndex) != cUniform.UniformType)
                {
                    ViewManager.ShowMessage("You can not change the PPE type.", "Update PPE Item", UpgradeHelpers.Helpers.BoxButtons.OK);
                    for (int i = 0; i <= ViewModel.cboItemType.Items.Count - 1; i++)
                    {
                        if (ViewModel.cboItemType.GetItemData(i) == cUniform.UniformType)
                        {
                            ViewModel.cboItemType.SelectedIndex = i;
                            break;
                        }
                    }
                }

                cUniform.UniformTrackingNumber = modGlobal.Clean(ViewModel.txtTrackingNumber.Text);

                cUniform.UniformColorType = 0;
                cUniform.UniformSizeType  = 0;
                if (ViewModel.cboColorSize.Visible)
                {
                    if (ViewModel.cboColorSize.SelectedIndex == -1)
                    {
                        //continue
                    }
                    else
                    {
                        if (ViewModel.lbItemColorSize.Text == "Color")
                        {
                            cUniform.UniformColorType = ViewModel.cboColorSize.GetItemData(ViewModel.cboColorSize.SelectedIndex);
                        }
                        else
                        {
                            cUniform.UniformSizeType = ViewModel.cboColorSize.GetItemData(ViewModel.cboColorSize.SelectedIndex);
                        }
                    }
                }

                cUniform.UniformManufacturerID = 0;
                if (ViewModel.cboItemBrand.Visible)
                {
                    if (ViewModel.cboItemBrand.SelectedIndex == -1)
                    {
                        //continue
                    }
                    else
                    {
                        cUniform.UniformManufacturerID = ViewModel.cboItemBrand.GetItemData(ViewModel.cboItemBrand.SelectedIndex);
                    }
                }

                if (ViewModel.chkManufDate.CheckState == UpgradeHelpers.Helpers.CheckState.Unchecked)
                {
                    cUniform.UniformManufacturedDate = "";
                }
                else if (((int)DateAndTime.DateDiff("d", DateTime.Now, DateTime.Parse(DateTime.Parse(ViewModel.dteManufDate.Text).ToString("MM/dd/yyyy")), FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1)) > 0)
                {
                    ViewManager.ShowMessage("Manufactured Date can not be in the future.", "Manufactured Date Error", UpgradeHelpers.Helpers.BoxButtons.OK);
                    return;
                }
                else
                {
                    cUniform.UniformManufacturedDate = DateTime.Parse(ViewModel.dteManufDate.Text).ToString("MM/dd/yyyy");
                }


                if (cUniform.UpdateUniform() != 0)
                {
                    if (cUniform.InsertUniformReasonRetiredInfo() != 0)
                    {
                        ViewManager.ShowMessage("PPE Item / Retired Info has been successfully updated.", "Update PPE Item Retired Info", UpgradeHelpers.Helpers.BoxButtons.OK);
                    }
                    else
                    {
                        ViewManager.ShowMessage("Ooops!  Error Updating PersonnelUniform record.  Call Debra Lewandowsky x5068.", "Error Updating PersonnelUniform", UpgradeHelpers.Helpers.BoxButtons.OK);
                    }
                }
                else
                {
                    ViewManager.ShowMessage("Ooops!  Error Updating Uniform record.  Call Debra Lewandowsky x5068.", "Error Updating Uniform", UpgradeHelpers.Helpers.BoxButtons.OK);
                }
                ViewManager.DisposeView(this);
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
Exemplo n.º 29
0
 internal void cmdClose_Click(Object eventSender, System.EventArgs eventArgs)
 {
     ViewManager.DisposeView(this);
 }
Exemplo n.º 30
0
        internal void OKButton_Click(Object eventSender, System.EventArgs eventArgs)
        {
            using (var async1 = this.Async(true))
            {
                UpgradeHelpers.Helpers.DialogResult resp = (UpgradeHelpers.Helpers.DialogResult) 0;

                string sName = "";
                //Do some editing and check for delete...
                //UPGRADE_WARNING: (1068) GetVal(lbRecordID.Caption) of type Variant is being forced to double. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                if (Convert.ToDouble(modGlobal.GetVal(ViewModel.lbRecordID.Text)) != 0 && modGlobal.Clean(ViewModel.
                                                                                                          cboShift.Text) == "" && modGlobal.Clean(ViewModel.cboNumber.Text) == "" && modGlobal.Clean(ViewModel.cboDebitGroup.Text) == "")
                {
                    async1.Append <UpgradeHelpers.Helpers.DialogResult>(() =>
                                                                        ViewManager.ShowMessage("Do you want to Delete the Callback # for this Employee?", "Delete Callback Number", UpgradeHelpers.Helpers.BoxButtons.YesNo));
                    async1.Append <UpgradeHelpers.Helpers.DialogResult, UpgradeHelpers.Helpers.DialogResult>(tempNormalized0 => tempNormalized0);
                    async1.Append <UpgradeHelpers.Helpers.DialogResult>(tempNormalized1 =>
                    {
                        resp = tempNormalized1;
                    });
                    async1.Append(() =>
                    {
                        if (resp == UpgradeHelpers.Helpers.DialogResult.No)
                        {
                            this.Return();
                            return;
                        }
                        else
                        {
                            //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                            if (cScheduler.DeletePersonnelCallBackNumber(Convert.ToInt32(modGlobal.GetVal(ViewModel.lbRecordID.Text))) != 0)
                            {
                                //success
                                ViewManager.DisposeView(this);
                                this.Return();
                                return;
                            }
                            else
                            {
                                ViewManager.ShowMessage("Oooops! There was a problem deleting CallBackNumber.", "Delete Callback Number Error", UpgradeHelpers.Helpers.BoxButtons.OK);
                                this.Return();
                                return;
                            }
                        }
                    });
                }
                async1.Append(() =>
                {
                    using (var async2 = this.Async())
                    {
                        if (modGlobal.Clean(ViewModel.cboShift.Text) == "")
                        {
                            ViewManager.ShowMessage("Please select a Shift... or Click Cancel to Exit.", "Edit Callback Number Error", UpgradeHelpers.Helpers.BoxButtons.OK);
                            this.Return();
                            return;
                        }

                        if (modGlobal.Clean(ViewModel.cboNumber.Text) == "")
                        {
                            ViewManager.ShowMessage("Please select a Number... or Click Cancel to Exit.", "Edit Callback Number Error", UpgradeHelpers.Helpers.BoxButtons.OK);
                            this.Return();
                            return;
                        }

                        //UPGRADE_WARNING: (1068) GetVal(cboNumber.Text) of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                        if (cScheduler.CheckCallBackNumberInUse(modGlobal.Clean(ViewModel.cboShift.Text), Convert.ToInt32(modGlobal.GetVal(ViewModel.cboNumber.Text)), modGlobal.Clean(ViewModel.sEmpID)) != 0)
                        {
                            if (!cScheduler.PersonnelCallBackNumber.EOF)
                            {
                                sName = modGlobal.Clean(cScheduler.PersonnelCallBackNumber["name_full"]);
                                async2.Append <UpgradeHelpers.Helpers.DialogResult>(() => ViewManager.ShowMessage("This Callback # currently belongs to " + sName + "." + "\r" +
                                                                                                                  "Do you want to continue anyway?", "Check Callback Number In Use", UpgradeHelpers.Helpers.BoxButtons.YesNo));
                                async2.Append <UpgradeHelpers.Helpers.DialogResult, UpgradeHelpers.Helpers.DialogResult>(tempNormalized2 => tempNormalized2);
                                async2.Append <UpgradeHelpers.Helpers.DialogResult>(tempNormalized3 =>
                                {
                                    resp = tempNormalized3;
                                });
                                async2.Append(() =>
                                {
                                    if (resp == UpgradeHelpers.Helpers.DialogResult.Yes)
                                    {
                                        //continue...
                                    }
                                    else
                                    {
                                        this.Return();
                                        return;
                                    }
                                });
                            }
                        }
                        async2.Append(() =>
                        {
                            ChangeCallbackNumber();
                            ViewManager.DisposeView(this);
                        });
                    }
                });
            }
        }