Example #1
0
        public void FillLists()
        {
            PTSProject.clsScheduler cTransfer = Container.Resolve <clsScheduler>();
            DbCommand          oCmd           = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            ADORecordSetHelper oRec           = null;
            string             strName        = "";

            ViewModel.cboPriority.Items.Clear();
            if (cTransfer.GetTransferPriorityCodeList() != 0)
            {
                while (!cTransfer.TransferPriorityCode.EOF)
                {
                    ViewModel.cboPriority.AddItem(modGlobal.Clean(cTransfer.TransferPriorityCode["description"]));
                    //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                    ViewModel.cboPriority.SetItemData(ViewModel.cboPriority.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(cTransfer.TransferPriorityCode["priority_code"])));
                    cTransfer.TransferPriorityCode.MoveNext();
                }
                ;
            }

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

            //Fill Employee Name Lists
            ViewModel.cboReqNameList.Items.Clear();
            ViewModel.cboNameList.Items.Clear();

            if (modGlobal.Shared.gSecurity != "RO")
            {
                oCmd.CommandText = "spOpNameList";
                oRec             = ADORecordSetHelper.Open(oCmd, "");


                while (!oRec.EOF)
                {
                    strName = Convert.ToString(oRec["name_full"]).Trim() + "  :" + Convert.ToString(oRec["employee_id"]);
                    ViewModel.cboNameList.AddItem(strName);
                    ViewModel.cboReqNameList.AddItem(strName);
                    oRec.MoveNext();
                }
                ;
                ViewModel.cboNameList.SelectedIndex    = -1;
                ViewModel.cboReqNameList.SelectedIndex = -1;
            }
            ViewModel.cboReqPositionList.Items.Clear();
            ViewModel.cboPositionList.Items.Clear();
            ViewModel.cboShiftList.Items.Clear();
            ViewModel.cboUnitList.Items.Clear();
            oCmd.CommandText = "spUnitList";
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboUnitList.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboUnitList.AddItem(Convert.ToString(oRec["unit_code"]));
                oRec.MoveNext();
            }
            ;
        }
        public void LoadLists()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            PTSProject.clsUnit UnitCL = Container.Resolve <clsUnit>();
            oCmd.Connection = modGlobal.oConn;

            oCmd.CommandType = CommandType.Text;

            //Fill Assignment Type List box
            oCmd.CommandText = "spSelect_AssignmentTypeList ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboAssignmentCode.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboAssignmentCode.AddItem(modGlobal.Clean(oRec["assignment_type_code"]));
                oRec.MoveNext();
            }
            ;
            ViewModel.cboAssignmentCode.SelectedIndex = -1;
            ViewModel.cboAssignmentCode.Text          = "";

            //Fill Unit List box
            ViewModel.cboUnit.Clear();
            oCmd.CommandText = "spUnitList ";
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboUnit.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboUnit.AddItem((string)oRec["unit_code"]);
                oRec.MoveNext();
            }
            ;
            ViewModel.cboUnit.ListIndex = -1;
            ViewModel.cboUnit.Text      = "";

            //Fill Immunization List box
            oCmd.CommandText = "spSelect_EMSImmunizationTypeList ";
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboType.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboType.AddItem(oRec["immunize_type"]);
                //UPGRADE_ISSUE: (2064) LpADOLib.fpComboAdo property cboType.NewIndex was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                //UPGRADE_WARNING: (1068) GetVal(oRec(immunize_id)) of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                //UPGRADE_ISSUE: (2064) LpADOLib.fpComboAdo property cboType.ItemData was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboType.setItemData(Convert.ToInt32(modGlobal.GetVal(oRec["immunize_id"])), ViewModel.cboType.getNewIndex());
                oRec.MoveNext();
            }
            ;
            ViewModel.cboType.ListIndex = -1;
            ViewModel.cboType.Text      = "";
        }
        public void FillGridLists()
        {
            //Retrieve & fill Grid lists
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            int       i    = 0;

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            string strSQL = "spSelect_UniformRepairerList ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //fill Repairer for all Uniform Repairers
            int tempForVar = ViewModel.sprPPEList.MaxRows;

            for (int x = 1; x <= tempForVar; x++)
            {
                ViewModel.sprPPEList.Row = x;
                ViewModel.sprPPEList.Col = 2;
                i = 0;

                while (!oRec.EOF)
                {
                    ViewModel.sprPPEList.TypeComboBoxIndex  = i;
                    ViewModel.sprPPEList.TypeComboBoxString = modGlobal.Clean(oRec["repairer_name"]);
                    i++;
                    oRec.MoveNext();
                }
                ;
                oRec.MoveFirst();
            }

            //fill Repairer for all Uniform Types
            strSQL           = "sp_GetEmployeeCurrentItemList '" + modGlobal.Shared.gAssignID + "' ";
            oCmd.CommandText = strSQL;
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            int tempForVar2 = ViewModel.sprPPEList.MaxRows;

            for (int x = 1; x <= tempForVar2; x++)
            {
                ViewModel.sprPPEList.Row = x;
                ViewModel.sprPPEList.Col = 1;
                i = 0;

                while (!oRec.EOF)
                {
                    ViewModel.sprPPEList.TypeComboBoxIndex  = i;
                    ViewModel.sprPPEList.TypeComboBoxString = modGlobal.Clean(oRec["UniformType"]) + ": " + modGlobal.Clean(oRec["tracking_number"]);
                    i++;
                    oRec.MoveNext();
                }
                ;
                oRec.MoveFirst();
            }
        }
        public void FillLists()
        {
            //Retrieve & fill Grid lists for Manuactures & Sizes & Color (Helmet only)
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            //fill dropdown list for Uniform Types (Coat, Pants, Boots, etc.)
            string strSQL = "spSelect_UniformTypeList ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboItemType.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboItemType.AddItem(modGlobal.Clean(oRec["description"]));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboItemType.SetItemData(ViewModel.cboItemType.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["uniform_type"])));

                oRec.MoveNext();
            }
            ;

            //fill dropdown list for Uniform Inventory Stations
            strSQL = "spSelect_UniformInventoryStationList ";

            oCmd.CommandText = strSQL;
            oRec             = ADORecordSetHelper.Open(oCmd, "");


            //fill dropdown list for Uniform Retirement Reason
            strSQL = "spSelect_UniformRetirementReasonList ";

            oCmd.CommandText = strSQL;
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboReason.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboReason.AddItem(modGlobal.Clean(oRec["reason_description"]));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboReason.SetItemData(ViewModel.cboReason.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["reason_id"])));
                oRec.MoveNext();
            }
            ;

            //these dropdowns are filled after an PPE Item Type is selected...
            ViewModel.cboItemBrand.Items.Clear();
            ViewModel.cboColorSize.Items.Clear();
        }
Example #5
0
        internal void cboUnitList_SelectionChangeCommitted(Object eventSender, System.EventArgs eventArgs)
        {
            //Load Position List with valid Positions
            //for selected Unit
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            if (ViewModel.cboUnitList.SelectedIndex == -1)
            {
                return;
            }

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            oCmd.CommandText = "spPositionList '" + ViewModel.cboUnitList.Text + "'";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboPositionList.Items.Clear();


            while (!oRec.EOF)
            {
                ViewModel.cboPositionList.AddItem(modGlobal.Clean(oRec["position_code"]));
                oRec.MoveNext();
            }
            ;
            if (ViewModel.cboPositionList.Items.Count == 1)
            {
                ViewModel.cboPositionList.SelectedIndex = 0;
            }

            oCmd.CommandText = "spSelect_ShiftListByUnit '" + ViewModel.cboUnitList.Text + "'";
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboShiftList.Items.Clear();


            while (!oRec.EOF)
            {
                ViewModel.cboShiftList.AddItem(modGlobal.Clean(oRec["shift_code"]));
                oRec.MoveNext();
            }
            ;
            if (ViewModel.cboShiftList.Items.Count == 1)
            {
                ViewModel.cboShiftList.SelectedIndex = 0;
            }


            EnableButton();
        }
Example #6
0
        //**************************************
        //  Employee Working Hours By Cycle  ***
        //**************************************

        public void LoadLists()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            string strSQL = "spSelect_AssignmentGroupList ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboGroup.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboGroup.AddItem(modGlobal.Clean(oRec["group_code"]));
                oRec.MoveNext();
            }
            ;

            strSQL           = "spSelect_CycleYearList ";
            oCmd.CommandText = strSQL;
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboYear.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboYear.AddItem(modGlobal.Clean(oRec["cycle_year"]));
                oRec.MoveNext();
            }
            ;
            ViewModel.cboYear.Text = DateTime.Now.Year.ToString();
            ViewModel.CurrYear     = Convert.ToInt32(Double.Parse(modGlobal.Clean(ViewModel.cboYear.Text)));

            strSQL           = "spSelect_CalendarCycleShiftStartByYear " + ViewModel.CurrYear.ToString();
            oCmd.CommandText = strSQL;
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cboCycleDate.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboCycleDate.AddItem(Convert.ToDateTime(oRec["start_date"]).ToString("MM/dd/yyyy") + " - " + Convert.ToDateTime(oRec["end_date"]).AddDays(-1).ToString("MM/dd/yyyy"));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboCycleDate.SetItemData(ViewModel.cboCycleDate.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["cycle_id"])));
                oRec.MoveNext();
            }
            ;
        }
Example #7
0
        public void FillList()
        {
            //Retrieve & fill Grid lists for Manuactures & Sizes & Color (Helmet only)
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            //fill dropdown list for Uniform Types (Coat, Pants, Boots, etc.)
            string strSQL = "spSelect_TrainingSpecificSearchList ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboSpecificCodes.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboSpecificCodes.AddItem(modGlobal.Clean(oRec["SpecificCode"]) + "   (" + modGlobal.Clean(oRec["ParentCodes"]) + ")");
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboSpecificCodes.SetItemData(ViewModel.cboSpecificCodes.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["trn_specific_code"])));
                oRec.MoveNext();
            }
            ;
        }
Example #8
0
        internal void cboJobCode_SelectionChangeCommitted(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            if (ViewModel.cboJobCode.SelectedIndex == -1)
            {
                return;
            }
            ViewModel.cboStep.Items.Clear();
            ViewModel.cboStep.SelectedIndex = -1;
            ViewModel.cboStep.Text          = "";

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

            oCmd.CommandText = "sp_GetStepListByJobCode '" + modGlobal.Clean(ViewModel.cboJobCode.Text) + "' ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //Load Job Code lists

            while (!oRec.EOF)
            {
                ViewModel.cboStep.AddItem(Convert.ToString(oRec["step"]));
                oRec.MoveNext();
            }
            ;
        }
Example #9
0
        public void RefreshEmployeeList()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            ViewModel.EmployeeRow = 1;

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

            oCmd.CommandText = "spOpNameList";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");



            while (!oRec.EOF)
            {
                ViewModel.sprEmployeeList.Row  = ViewModel.EmployeeRow;
                ViewModel.sprEmployeeList.Col  = 1;
                ViewModel.sprEmployeeList.Text = modGlobal.Clean(oRec["name_full"]);
                ViewModel.sprEmployeeList.Col  = 2;
                ViewModel.sprEmployeeList.Text = modGlobal.Clean(oRec["employee_id"]);
                ViewModel.sprEmployeeList.Col  = 3;
                ViewModel.sprEmployeeList.Text = modGlobal.Clean(oRec["per_sys_id"]);
                (ViewModel.EmployeeRow)++;
                oRec.MoveNext();
            }
            ;
            ViewModel.sprEmployeeList.MaxRows = ViewModel.EmployeeRow;
            ViewModel.EmployeeRow             = 0;
        }
        internal static OrderedDictionary GetPOSSystems()
        {
            DbConnection conn = OpenConnection();

            DbCommand command = null;

            command            = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            command.Connection = conn;
            UpgradeHelpers.DB.DbConnectionHelper.ResetCommandTimeOut(command);
            command.CommandText = "Select * from POS";
            UpgradeHelpers.DB.TransactionManager.SetCommandTransaction(command);
            ADORecordSetHelper rs   = ADORecordSetHelper.Open(command, "");
            OrderedDictionary  coll = new OrderedDictionary(System.StringComparer.OrdinalIgnoreCase);
            POSSystems         POS  = null;

            if (rs.RecordCount > 0)
            {
                while (!rs.EOF)
                {
                    POS          = new POSSystems();
                    POS.POSID    = Convert.ToInt32(rs["POSID"]);
                    POS.Branch   = Convert.ToString(rs["Branch"]);
                    POS.Location = Convert.ToString(rs["Location"]);
                    POS.Phone    = Convert.ToString(rs["Phone"]);
                    POS.POSName  = Convert.ToString(rs["POSName"]);
                    coll.Add(Guid.NewGuid().ToString(), POS);
                    rs.MoveNext();
                }
            }
            return(coll);
        }
Example #11
0
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            //int i = 0, x = 0;
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            oCmd.CommandText = "sp_GetYearList ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //Initialize Year Combobox
            ViewModel.cboYear.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboYear.AddItem(Convert.ToString(oRec["cal_year"]).Trim());
                oRec.MoveNext();
            }
            ;
            ViewModel.cboYear.Text = Conversion.Str(DateTime.Now.Year);
            ViewModel.ReportYear   = Convert.ToInt32(Double.Parse(modGlobal.Clean(ViewModel.cboYear.Text)));

            FormatReport();
        }
Example #12
0
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            ViewModel.cboRepairer.Items.Clear();
            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            string strSQL = "spSelect_UniformRepairerList ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");


            while (!oRec.EOF)
            {
                ViewModel.cboRepairer.AddItem(modGlobal.Clean(oRec["repairer_name"]));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboRepairer.SetItemData(ViewModel.cboRepairer.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["repairer_id"])));

                oRec.MoveNext();
            }
            ;
            ViewModel.txtTrackingNumber.Text = "";
            GetUniformDetail();

            ClearDetail();
            ViewModel.cmdEdit.Text    = "Add";
            ViewModel.cmdEdit.Enabled = false;
            ViewModel.cmdEdit.Tag     = "1";
        }
Example #13
0
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            DbCommand oCmd    = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            string    strName = "";

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            oCmd.CommandText = "spFullNameList";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");


            while (!oRec.EOF)
            {
                strName = Convert.ToString(oRec["name_full"]).Trim() + "  :" + Convert.ToString(oRec["employee_id"]);
                this.ViewModel.cboNameList.AddItem(strName);
                oRec.MoveNext();
            }
            ;

            if (modGlobal.Shared.gReportUser != "")
            {
                for (int i = 0; i <= ViewModel.cboNameList.Items.Count - 1; i++)
                {
                    //Come Here - for employee id change
                    if (ViewModel.cboNameList.GetListItem(i).Substring(Math.Max(ViewModel.cboNameList.GetListItem(i).Length - 5, 0)) == modGlobal.Shared.gReportUser)
                    {
                        ViewModel.CurrEmpID = modGlobal.Shared.gReportUser;
                        ViewModel.cboNameList.SelectedIndex = i;
                        break;
                    }
                }
            }
        }
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            oCmd.CommandText = "sp_GetYearList ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //Initialize Year Combobox
            ViewModel.cboYear.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboYear.AddItem(Convert.ToString(oRec["cal_year"]).Trim());
                oRec.MoveNext();
            }
            ;
            ViewModel.cboYear.Text = DateTime.Now.Year.ToString();

            //Determine if form called from Daily Staffing
            //If so open form with same month
            //Otherwise Initialize Year Combobox
            for (int i = 0; i <= ViewManager.OpenFormsCount - 1; i++)
            {
                if (ViewManager.GetOpenFormAt(i).ViewModel.Name == "frmDailyStaffing")
                {
                    ViewModel.cboYear.Text           = frmDailyStaffing.DefInstance.ViewModel.cboYear.Text;
                    ViewModel.cboMonth.SelectedIndex = frmDailyStaffing.DefInstance.ViewModel.cboMonth.SelectedIndex;
                    return;
                }
            }
        }
Example #15
0
        internal void cboShift_SelectionChangeCommitted(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            if (ViewModel.FirstTime)
            {
                return;
            }
            if (modGlobal.Clean(ViewModel.cboShift.Text) == "")
            {
                return;
            }

            //add logic to the cboDebitGroup list with appropriate groups...
            ViewModel.cboDebitGroup.Items.Clear();
            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            oCmd.CommandText = "spSelect_DebitGroupListByShift '" + modGlobal.Clean(ViewModel.cboShift.Text) + "' ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            if (oRec.EOF)
            {
                return;
            }


            while (!oRec.EOF)
            {
                ViewModel.cboDebitGroup.AddItem(modGlobal.Clean(oRec["debit_group_code"]));
                oRec.MoveNext();
            }
            ;
        }
        //**********************************************************
        //Dual usage Dialog for requesting Type of Leave
        //Or Scheduling Type of Time
        //**********************************************************
        //ADODB

        public void FindNotes()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();


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

            string SQLScript = "Select * from PersonnelScheduleNotes Where employee_id = '";

            SQLScript = SQLScript + modGlobal.Shared.gReportUser + "' and datediff(day,'";
            System.DateTime TempDate = DateTime.FromOADate(0);
            SQLScript = SQLScript + ((DateTime.TryParse(modGlobal.Shared.gStartTrans, out TempDate)) ? TempDate.ToString("MM/dd/yyyy") : modGlobal.Shared.gStartTrans);
            SQLScript = SQLScript + "',shift_start) >= 0 and datediff(day,'";
            System.DateTime TempDate2 = DateTime.FromOADate(0);
            SQLScript = SQLScript + ((DateTime.TryParse(modGlobal.Shared.gEndTrans, out TempDate2)) ? TempDate2.ToString("MM/dd/yyyy") : modGlobal.Shared.gEndTrans);
            SQLScript = SQLScript + "',shift_start) <= 0";

            oCmd.CommandText = SQLScript;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            if (!oRec.EOF)
            {
                ViewModel.txtLeaveNotes.Text = "";

                while (!oRec.EOF)
                {
                    ViewModel.txtLeaveNotes.Text = modGlobal.Clean(ViewModel.txtLeaveNotes.Text) + modGlobal.Clean(oRec["note"]).Trim() + ";  ";
                    oRec.MoveNext();
                }
                ;
            }
        }
Example #17
0
        internal void cboYear_SelectionChangeCommitted(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            // int i = 0;
            ViewModel.CurrYear = Convert.ToInt32(Double.Parse(modGlobal.Clean(ViewModel.cboYear.Text)));

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

            string strSQL = "spSelect_CalendarCycleShiftStartByYear " + ViewModel.CurrYear.ToString();

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboCycleDate.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboCycleDate.AddItem(Convert.ToDateTime(oRec["start_date"]).ToString("MM/dd/yyyy") + " - " + Convert.ToDateTime(oRec["end_date"]).AddDays(-1).ToString("MM/dd/yyyy"));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboCycleDate.SetItemData(ViewModel.cboCycleDate.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["cycle_id"])));
                oRec.MoveNext();
            }
            ;
        }
        public void LoadList()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            ViewModel.cboEmployee.Text = "";
            ViewModel.cboEmployee.Items.Clear();

            //Load Employee Name combobox
            oCmd.Connection = modGlobal.oConn;

            if (modGlobal.Shared.gSecurity == "RO")
            {
                ViewModel.cboEmployee.AddItem(modGlobal.Shared.gUserName + "  :" + modGlobal.Shared.gUser);
                return;
            }

            oCmd.CommandText = "spOpNameList ";

            oCmd.CommandType = CommandType.Text;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            while (!oRec.EOF)
            {
                ViewModel.cboEmployee.AddItem(Convert.ToString(oRec["name_full"]).Trim() + " - " + Convert.ToString(oRec["employee_id"]));
                oRec.MoveNext();
            }
        }
Example #19
0
        public void SearchCustomer(string customerInfo)
        {
            ADORecordSetHelper rs = MainModule.FindCustomers(customerInfo);

            fgCustomers.RowsCount = rs.RecordCount + 1;
            int index = 1;

            while (!rs.EOF)
            {
                //Custo No
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1049
                fgCustomers[index, 0].Value = (Convert.IsDBNull(rs["CustomerID"])) ? "" : Convert.ToString(rs["CustomerID"]);
                //First Name
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1049
                fgCustomers[index, 1].Value = (Convert.IsDBNull(rs["FirstName"])) ? "" : Convert.ToString(rs["FirstName"]);
                //Last Name
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1049
                fgCustomers[index, 2].Value = (Convert.IsDBNull(rs["LastName"])) ? "" : Convert.ToString(rs["LastName"]);
                //Email
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1049
                fgCustomers[index, 3].Value = (Convert.IsDBNull(rs["Email"])) ? "" : Convert.ToString(rs["Email"]);
                //Street1
                //UPGRADE_WARNING: (1049) Use of Null/IsNull() detected. More Information: https://www.mobilize.net/vbtonet/ewis/ewi1049
                fgCustomers[index, 4].Value = (Convert.IsDBNull(rs["StreetAddress1"])) ? "" : Convert.ToString(rs["StreetAddress1"]);
                index++;
                rs.MoveNext();
            }
        }
        internal void cboYear_SelectionChangeCommitted(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            if (UpgradeHelpers.Helpers.StringsHelper.ToDoubleSafe(ViewModel.cboYear.Text) == modGlobal.Shared.gPayrollYear)
            {
                return;
            }

            modGlobal.Shared.gPayrollYear = Convert.ToInt32(Double.Parse(ViewModel.cboYear.Text));
            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            ViewModel.cboPayPeriod.Items.Clear();
            oCmd.CommandText = "sp_GetPayRollPeriods " + modGlobal.Shared.gPayrollYear.ToString();
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            while (!oRec.EOF)
            {
                ViewModel.cboPayPeriod.AddItem(Convert.ToString(oRec["start_date"]) + " - " + Convert.ToString(oRec["end_date"]));
                ViewModel.cboPayPeriod.SetItemData(ViewModel.cboPayPeriod.GetNewIndex(), Convert.ToInt32(oRec["pay_period"]));
                oRec.MoveNext();
            }
            ;

            modGlobal.Shared.gPayPeriod = 0;
        }
Example #21
0
        public void LoadList()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            ViewModel.cboNameList.Text = "";
            ViewModel.cboNameList.Items.Clear();

            //Load Employee Name combobox
            oCmd.Connection = modGlobal.oConn;

            if (ViewModel.chkInactive.CheckState == UpgradeHelpers.Helpers.CheckState.Checked)
            {
                oCmd.CommandText = "spArchiveNameList";
            }
            else
            {
                oCmd.CommandText = "spOpNameList";
            }

            oCmd.CommandType = CommandType.Text;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            while (!oRec.EOF)
            {
                ViewModel.cboNameList.AddItem(Convert.ToString(oRec["name_full"]).Trim() + " - " + Convert.ToString(oRec["employee_id"]));
                oRec.MoveNext();
            }
        }
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            DbCommand oCmd    = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            string    strName = "";

            ViewModel.CurrEmpID = "";
            ViewModel.cboEmpList.Items.Clear();

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            string strSQL = "";

            strSQL           = "spFullNameList ";
            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");


            while (!oRec.EOF)
            {
                strName = Convert.ToString(oRec["name_full"]).Trim() + "  :" + Convert.ToString(oRec["employee_id"]);
                ViewModel.cboEmpList.AddItem(strName);
                oRec.MoveNext();
            }
            ;

            FillDropDowns();
            FillBunkerGrid();
            FillUniformGrid();

            ClearFields();
            if (modGlobal.Shared.gAssignID != "")
            {
                FindEmployee();
            }
        }
Example #23
0
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            //Load Promotion List box with Promotion Lists

            DbCommand          oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            ADORecordSetHelper oRec = null;

            //string strSQL = "";

            try
            {
                oCmd.Connection  = modGlobal.oConn;
                oCmd.CommandType = CommandType.Text;
                oCmd.CommandText = "Select * from Promotion_Code";
                oRec             = ADORecordSetHelper.Open(oCmd, "");
                ViewModel.cboPromotion.Items.Clear();


                while (!oRec.EOF)
                {
                    ViewModel.cboPromotion.AddItem(Convert.ToString(oRec["description"]));
                    ViewModel.cboPromotion.SetItemData(ViewModel.cboPromotion.GetNewIndex(), Convert.ToInt32(Conversion.Val(Convert.ToString(oRec["promotion_code_id"]))));
                    oRec.MoveNext();
                }
                ;
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
        public void LoadLists()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            //fill dropdown list for Stations
            string strSQL = "spSelect_WatchDutyStationList ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            ViewModel.cboLocation.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboLocation.AddItem(modGlobal.Clean(oRec["facility_name"]));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboLocation.SetItemData(ViewModel.cboLocation.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["facility"])));

                oRec.MoveNext();
            }
            ;
        }
Example #25
0
        internal void cmdTrade_Click(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            string sMessage = "";

            System.DateTime TempDate   = DateTime.FromOADate(0);
            System.DateTime dBeginDate = DateTime.Parse((DateTime.TryParse(ViewModel.StartDate, out TempDate)) ? TempDate.ToString("MM/dd/yyyy") : ViewModel.StartDate);

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            oCmd.CommandText = "sp_GetTradeDetail '" + ViewModel.Empid + "','" + UpgradeHelpers.Helpers.DateTimeHelper.ToString(dBeginDate) + "'";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");


            while (!oRec.EOF)
            {
                sMessage = sMessage + ("\r") + ("\n") + Convert.ToString(oRec["WorkingEmployee"]).Trim() + " is working for " + Convert.ToString(oRec["ScheduledEmployee"]).Trim() + " - " + Convert.ToString(oRec["ShiftTime"]).Trim();
                sMessage = sMessage + ("\r") + ("\n") + "(Updated By: " + Convert.ToString(oRec["UpdatedBy"]).Trim() + " on " + Convert.ToString(oRec["UpdatedOn"]).Trim() + ")";
                sMessage = sMessage + ("\r") + ("\n");
                oRec.MoveNext();
            }
            ;
            ViewManager.ShowMessage(sMessage, "Trade Detail", UpgradeHelpers.Helpers.BoxButtons.OK);
        }
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            //Load Name list box with Operations Staff

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

            try
            {
                frmSenority.DefInstance.ViewModel.cboName.Items.Clear();

                oCmd.Connection  = modGlobal.oConn;
                oCmd.CommandType = CommandType.Text;
                oCmd.CommandText = "spOpNameList";
                oRec             = ADORecordSetHelper.Open(oCmd, "");

                while (!oRec.EOF)
                {
                    strName = Convert.ToString(oRec["name_full"]).Trim() + "  :" + Convert.ToString(oRec["employee_id"]);
                    frmSenority.DefInstance.ViewModel.cboName.AddItem(strName);
                    oRec.MoveNext();
                }
                ;
                ViewModel.TotalNames       = 0;
                ViewModel.cmdPrint.Visible = false;
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            DbCommand          oCmd       = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            ADORecordSetHelper oRec       = null;
            string             SQLScript  = "";
            string             strComment = "";

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

                SQLScript = "Select * from PersonnelScheduleNotes Where employee_id = '";
                SQLScript = SQLScript + modGlobal.Shared.gReportUser + "' and datediff(day,'";
                System.DateTime TempDate = DateTime.FromOADate(0);
                SQLScript = SQLScript + ((DateTime.TryParse(modGlobal.Shared.gStartTrans, out TempDate)) ? TempDate.ToString("MM/dd/yyyy") : modGlobal.Shared.gStartTrans);
                SQLScript = SQLScript + "',shift_start) >= 0 and datediff(day,'";
                System.DateTime TempDate2 = DateTime.FromOADate(0);
                SQLScript = SQLScript + ((DateTime.TryParse(modGlobal.Shared.gEndTrans, out TempDate2)) ? TempDate2.ToString("MM/dd/yyyy") : modGlobal.Shared.gEndTrans);
                SQLScript = SQLScript + "',shift_start) <= 0";

                oCmd.CommandText = SQLScript;
                oRec             = ADORecordSetHelper.Open(oCmd, "");

                if (!oRec.EOF)
                {
                    strComment = "";

                    while (!oRec.EOF)
                    {
                        strComment = modGlobal.Clean(strComment) + modGlobal.Clean(oRec["note"]).Trim() + ";  ";
                        oRec.MoveNext();
                    }
                    ;
                }

                if (modGlobal.Clean(strComment) != "")
                {
                    ViewModel.txtNote.Text = modGlobal.Clean(strComment);
                }
                else
                {
                    ViewModel.txtNote.Text = "No Schedule Notes exist";
                }

                if (modGlobal.Shared.gSecurity == "RO")
                {
                    ViewModel.cmdOK.Enabled   = false;
                    ViewModel.txtNote.Enabled = false;
                }
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }
Example #28
0
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            oCmd.Connection  = modGlobal.oConn;
            oCmd.CommandType = CommandType.Text;
            oCmd.CommandText = "sp_GetYearList ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //Initialize Year Combobox
            ViewModel.cboYear.Items.Clear();

            while (!oRec.EOF)
            {
                ViewModel.cboYear.AddItem(Convert.ToString(oRec["cal_year"]).Trim());
                oRec.MoveNext();
            }
            ;
            ViewModel.ThisYear     = DateTime.Now.Year;
            ViewModel.cboYear.Text = DateTime.Now.Year.ToString();
            ViewModel.ThisMonth    = DateTime.Now.Month;

            //load Month list
            ViewModel.cboMonth.AddItem("January");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 1);
            ViewModel.cboMonth.AddItem("February");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 2);
            ViewModel.cboMonth.AddItem("March");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 3);
            ViewModel.cboMonth.AddItem("April");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 4);
            ViewModel.cboMonth.AddItem("May");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 5);
            ViewModel.cboMonth.AddItem("June");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 6);
            ViewModel.cboMonth.AddItem("July");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 7);
            ViewModel.cboMonth.AddItem("August");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 8);
            ViewModel.cboMonth.AddItem("September");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 9);
            ViewModel.cboMonth.AddItem("October");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 10);
            ViewModel.cboMonth.AddItem("November");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 11);
            ViewModel.cboMonth.AddItem("December");
            ViewModel.cboMonth.SetItemData(ViewModel.cboMonth.GetNewIndex(), 12);

            for (int x = 0; x <= ViewModel.cboMonth.Items.Count - 1; x++)
            {
                if (ViewModel.cboMonth.GetItemData(x) == ViewModel.ThisMonth)
                {
                    ViewModel.cboMonth.SelectedIndex = x;
                    break;
                }
            }

            FormatReport2();
        }
Example #29
0
        public void LoadLists()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            ViewModel.cboJobCode.Items.Clear();
            ViewModel.cboJobCode.SelectedIndex = -1;
            ViewModel.cboJobCode.Text          = "";
            ViewModel.cboStep.Items.Clear();
            ViewModel.cboStep.SelectedIndex = -1;
            ViewModel.cboStep.Text          = "";
            ViewModel.cboRemoveCode.Items.Clear();
            ViewModel.cboRemoveCode.SelectedIndex = -1;
            ViewModel.cboRemoveCode.Text          = "";
            ViewModel.txtComment.Text             = "";

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


            oCmd.CommandText = "spJobCodeList";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //Load Job Code list

            while (!oRec.EOF)
            {
                ViewModel.cboJobCode.AddItem(Convert.ToString(oRec["job_code_id"]));
                oRec.MoveNext();
            }
            ;

            oCmd.CommandText = "spSelect_RemoveCodeList";
            oRec             = ADORecordSetHelper.Open(oCmd, "");

            //Load Remove Code list

            while (!oRec.EOF)
            {
                ViewModel.cboRemoveCode.AddItem(modGlobal.Clean(oRec["remove_description"]));
                //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to int. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
                ViewModel.cboRemoveCode.SetItemData(ViewModel.cboRemoveCode.GetNewIndex(), Convert.ToInt32(modGlobal.GetVal(oRec["remove_id"])));
                oRec.MoveNext();
            }
            ;
        }
Example #30
0
        //UPGRADE_WARNING: (2080) Form_Load event was upgraded to Form_Load method and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx

        private void Form_Load()
        {
            //Load Employee Listbox

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

            try
            {
                oCmd.Connection  = modGlobal.oConn;
                oCmd.CommandType = CommandType.Text;
                oCmd.CommandText = "spFullNameList";
                oRec             = ADORecordSetHelper.Open(oCmd, "");
                ViewModel.cboEmpList.Items.Clear();

                while (!oRec.EOF)
                {
                    strName = Convert.ToString(oRec["name_full"]).Trim() + " - " + Convert.ToString(oRec["employee_id"]);
                    ViewModel.cboEmpList.AddItem(strName);
                    oRec.MoveNext();
                }
                ;

                oCmd.CommandText = "sp_GetSecurityCodes";
                oRec             = ADORecordSetHelper.Open(oCmd, "");
                ViewModel.cboSecurity.Items.Clear();

                while (!oRec.EOF)
                {
                    strName = Convert.ToString(oRec["security_description"]).Trim() + " - " + Convert.ToString(oRec["security_code"]);
                    ViewModel.cboSecurity.AddItem(strName);
                    oRec.MoveNext();
                }
                ;
            }
            catch
            {
                if (modGlobal.ErrorControl() == modGlobal.eFATALERROR)
                {
                    return;
                }
            }
        }