Exemple #1
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();
            }
            ;
        }
Exemple #2
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;
                }
            }
        }
Exemple #3
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();
            }
        }
        //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;
                }
            }
        }
        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();
            }
            ;
        }
        internal static ADORecordSetHelper FindCustomers(string customerInfo)
        {
            string query = "select * from Customers where LastName = @keyword " +
                           "Union  " +
                           "Select * from Customers where FirstName = @keyword  " +
                           "Union " +
                           "Select * from Customers where email = @keyword  ";

            DbConnection conn       = OpenConnection();
            DbCommand    objcommand = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            objcommand.Connection = conn;
            UpgradeHelpers.DB.DbConnectionHelper.ResetCommandTimeOut(objcommand);
            objcommand.CommandText = query;
            DbParameter TempParameter = null;

            TempParameter = objcommand.CreateParameter();
            TempParameter.ParameterName = "@keyword";
            TempParameter.DbType        = DbType.String;
            TempParameter.Direction     = ParameterDirection.Input;
            TempParameter.Size          = 100;
            TempParameter.Value         = customerInfo;
            objcommand.Parameters.Add(TempParameter);

            ADORecordSetHelper rs = new ADORecordSetHelper("");

            rs.CursorLocation = CursorLocationEnum.adUseClient;
            rs.Open(objcommand);
            rs.ActiveConnection = null;
            UpgradeHelpers.DB.TransactionManager.DeEnlist(conn);
            conn.Close();
            return(rs);
        }
        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);
        }
Exemple #8
0
        public void DeleteEmployeeRecord()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            if (modGlobal.Clean(ViewModel.EmployeeID) == "")
            {
                return;
            }

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

            if (ViewModel.optFCCDispatcher.Checked)
            {
                oCmd.CommandText = "spDeletePersonnelSpecialty '" + ViewModel.EmployeeID + "', " + "2" + " ";
            }
            else if (ViewModel.OptOmitBCList.Checked)
            {
                oCmd.CommandText = "spDeletePersonnelBattCardRemove " + ViewModel.PersonnelID.ToString() + " ";
            }
            else if (ViewModel.OptParamedic.Checked)
            {
                oCmd.CommandText = "spDeletePersonnelSpecialty '" + ViewModel.EmployeeID + "', " + "1" + " ";
            }
            else if (ViewModel.OptTempUpgrade.Checked)
            {
                oCmd.CommandText = "spDeletePayrollTemporaryUpgrade " + ViewModel.PersonnelID.ToString() + " ";
            }

            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");
        }
Exemple #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;
        }
Exemple #10
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();
        }
Exemple #11
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();
            }
            ;
        }
Exemple #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";
        }
Exemple #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;
                }
            }
        }
        //**********************************************************
        //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();
                }
                ;
            }
        }
Exemple #16
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();
            }
            ;
        }
        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();
            }
        }
Exemple #18
0
        internal void cmdSaveReason_Click(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd       = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
            string    sSQLString = "";

            if (modGlobal.Clean(ViewModel.EmployeeID) == "")
            {
                return;
            }

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

            if (!ViewModel.OptOmitBCList.Checked)
            {
                return;
            }
            if (ViewModel.cboRemoveCode.SelectedIndex == -1)
            {
                ViewManager.ShowMessage("Please Select A Reason to Remove Employee From the Battalion Payroll List.", "Remove Employee From Battalion Payroll List", UpgradeHelpers.Helpers.BoxButtons.OK);
                return;
            }
            ViewModel.cmdSaveReason.Enabled = false;

            int    ReasonCode = ViewModel.cboRemoveCode.GetItemData(ViewModel.cboRemoveCode.SelectedIndex);
            string sComment   = modGlobal.Clean(ViewModel.txtComment.Text);

            oCmd.CommandText = "spSelect_PersonnelBattCardRemoveListByID " + ViewModel.PersonnelID.ToString() + " ";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            if (oRec.EOF)
            {
                sSQLString = "spInsertPersonnelBattCardRemove " + ViewModel.PersonnelID.ToString() + ", " + ReasonCode.ToString();
                if (sComment == "")
                {
                    sSQLString = sSQLString + ", NULL ";
                }
                else
                {
                    sSQLString = sSQLString + ",'" + sComment + "' ";
                }
            }
            else
            {
                sSQLString = "spUpdatePersonnelBattCardRemove " + ViewModel.PersonnelID.ToString() + ", " + ReasonCode.ToString();
                if (sComment == "")
                {
                    sSQLString = sSQLString + ", NULL ";
                }
                else
                {
                    sSQLString = sSQLString + ",'" + sComment + "' ";
                }
            }
            oCmd.CommandText = sSQLString;
            oRec             = ADORecordSetHelper.Open(oCmd, "");
            ViewModel.cmdSaveReason.Enabled = true;
            RefreshGroupList();
            ClearScreen();
        }
        // Gets a Customer Description to show when a customer is chosen
        internal static string GetCustomerInfo(int CustomerID)
        {
            string       query      = "select * from Customers where CustomerID = @CustomerID";
            DbConnection conn       = OpenConnection();
            DbCommand    objcommand = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            objcommand.Connection = conn;
            UpgradeHelpers.DB.DbConnectionHelper.ResetCommandTimeOut(objcommand);
            objcommand.CommandText = query;
            DbParameter TempParameter = null;

            TempParameter = objcommand.CreateParameter();
            TempParameter.ParameterName = "@CustomerID";
            TempParameter.DbType        = DbType.Decimal;
            TempParameter.Direction     = ParameterDirection.Input;
            TempParameter.Size          = 0;
            TempParameter.Value         = CustomerID;
            objcommand.Parameters.Add(TempParameter);

            ADORecordSetHelper rs = new ADORecordSetHelper("");

            rs.CursorLocation = CursorLocationEnum.adUseClient;
            rs.Open(objcommand);
            rs.ActiveConnection = null;
            UpgradeHelpers.DB.TransactionManager.DeEnlist(conn);
            conn.Close();
            if (rs.RecordCount > 0)
            {
                return(Convert.ToString(rs["FirstName"]) + " " + Convert.ToString(rs["LastName"]) + Environment.NewLine + Convert.ToString(rs["Email"]));
            }
            else
            {
                return("Customer Info could not be loaded");
            }
        }
        public void ChangeMAXHolidayTotals()
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            string SqlString = "Delete PersonnelHOLMAXOverride Where employee_id  = '";

            SqlString        = SqlString + modGlobal.Shared.gReportUser + "' and year_applied = '";
            SqlString        = SqlString + modGlobal.Shared.gReportYear.ToString() + "' ";
            oCmd.CommandText = SqlString;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            //spInsert_PersonnelHOLMAXOverride
            //UPGRADE_WARNING: (1068) GetVal(txtTotal.Text) of type Variant is being forced to double. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
            if (Convert.ToDouble(modGlobal.GetVal(ViewModel.txtTotal.Text)) > 0)
            {
                SqlString        = "spInsert_PersonnelHOLMAXOverride '";
                SqlString        = SqlString + modGlobal.Shared.gReportUser + "', '";
                SqlString        = SqlString + modGlobal.Shared.gReportYear.ToString() + "', ";
                SqlString        = SqlString + UpgradeHelpers.Helpers.StringsHelper.Format(ViewModel.txtTotal.Text, "##.#") + " ";
                oCmd.CommandText = SqlString;
            }
            else
            {
                SqlString        = "spInsert_PersonnelHOLMAXOverride '";
                SqlString        = SqlString + modGlobal.Shared.gReportUser + "', '";
                SqlString        = SqlString + modGlobal.Shared.gReportYear.ToString() + "', ";
                SqlString        = SqlString + "0" + " ";
                oCmd.CommandText = SqlString;
            }
            oRec = ADORecordSetHelper.Open(oCmd, "");
        }
Exemple #21
0
        public static object Deserialize(BinaryReader binaryReader, ISurrogateContext context)
        {
            DbConnection conn = null;

            if (context.DependencyCount > 0)
            {
                conn = context.Dependencies[0] as DbConnection;
            }
            var    hasSource = binaryReader.ReadBoolean();
            string source    = "";

            if (hasSource)
            {
                source = binaryReader.ReadString();
            }
            BinaryFormatter    bFormat = new BinaryFormatter();
            ADORecordSetHelper rs      = (ADORecordSetHelper)bFormat.Deserialize(binaryReader.BaseStream);

            rs.ProviderFactory  = AdoFactoryManager.GetFactory("");
            rs.ActiveConnection = conn;
            if (hasSource)
            {
                rs.Source = source;
            }
            return(rs);
        }
Exemple #22
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();
            }
            ;
        }
Exemple #23
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);
        }
		public int DeleteEMSPersonnelImmunizations(int lRecordID)
		{
			//Delete Record from EMSPersonnelImmunizations table
			int result = 0;
			DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
			ADORecordSetHelper oRec = null;
			string SqlString = "";

			try
			{
				result = -1;

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

				SqlString = "spDelete_EMSPersonnelImmunizations " + lRecordID.ToString() + " ";

				oCmd.CommandText = SqlString;
				oRec = ADORecordSetHelper.Open(oCmd, "");
			}
			catch
			{

				result = 0;
				//UPGRADE_TODO: (1065) Error handling statement (Resume Next) could not be converted. More Information: http://www.vbtonet.com/ewis/ewi1065.aspx
				UpgradeHelpers.Helpers.NotUpgradedHelper.NotifyNotUpgradedElement("Resume Next Statement");
			}

			return result;
		}
Exemple #25
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();
            }
        }
		public int GetAdminONLYSecurity(string sEmpID)
		{
			// Get Employee Information for EMSPersonnelImmunizations
			// Record View/Edit Security
			int result = 0;
			DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();
			ADORecordSetHelper oRec = null;

			try
			{

				result = -1;

				oCmd.Connection = modGlobal.oConn;
				oCmd.CommandType = CommandType.Text;
				oCmd.CommandText = "spSelect_AdminONLYSecurity '" + sEmpID + "' ";
				oRec = ADORecordSetHelper.Open(oCmd, "");
				if (!oRec.EOF)
				{
					cEMSPersonnelImmunizations = oRec;
				}
				else
				{
					result = 0;
				}
			}
			catch
			{

				result = 0;
				//UPGRADE_TODO: (1065) Error handling statement (Resume Next) could not be converted. More Information: http://www.vbtonet.com/ewis/ewi1065.aspx
				UpgradeHelpers.Helpers.NotUpgradedHelper.NotifyNotUpgradedElement("Resume Next Statement");
			}
			return result;
		}
        //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();
            }
        }
Exemple #28
0
        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;

            //fill list for all Uniform Types assigned to current employee
            string strSQL = "sp_GetEmployeeCurrentItemList '" + modGlobal.Shared.gAssignID + "' ";

            oCmd.CommandText = strSQL;
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");
            int tempForVar          = ViewModel.sprPPEList.MaxRows;

            for (int x = 1; x <= tempForVar; 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();
            }
        }
Exemple #29
0
        internal void cmdFind_Click(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

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

            ClearDetail();
            //UPGRADE_ISSUE: (2064) FPSpreadADO.fpSpread method sprLaunderGrid.ClearRange was not upgraded. More Information: http://www.vbtonet.com/ewis/ewi2064.aspx
            ViewModel.sprLaunderGrid.ClearRange(1, 1, ViewModel.sprLaunderGrid.MaxCols, ViewModel.sprLaunderGrid.MaxRows, false);
            ViewModel.iCurrRow = 0;

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

            string strSQL = "spSelect_UniformByTrackingNumber '" + modGlobal.Clean(ViewModel.txtTrackingNumber.Text) + "' ";

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

            if (oRec.EOF)
            {
                ViewManager.ShowMessage("Item could not be found.", "Search on Tracking/Barcode Number", UpgradeHelpers.Helpers.BoxButtons.OK);
                return;
            }

            //UPGRADE_WARNING: (1068) GetVal() of type Variant is being forced to string. More Information: http://www.vbtonet.com/ewis/ewi1068.aspx
            ViewModel.lbUniformID.Text  = Convert.ToString(modGlobal.GetVal(oRec["uniform_id"]));
            modGlobal.Shared.gUniformID = Convert.ToInt32(Double.Parse(ViewModel.lbUniformID.Text));

            GetUniformDetail();
        }
Exemple #30
0
        internal void dtReportDate_Click(Object eventSender, System.EventArgs eventArgs)
        {
            DbCommand oCmd = UpgradeHelpers.DB.AdoFactoryManager.GetFactory().CreateCommand();

            if (!Information.IsDate(ViewModel.dtReportDate.Text))
            {
                return;
            }
            if (ViewModel.FirstTime != 0)
            {
                return;
            }
            ViewModel.ShiftDate = DateTime.Parse(ViewModel.dtReportDate.Text).ToString("M/d/yyyy") + " 7:00AM";
            ViewModel.CurrDate  = DateTime.Parse(ViewModel.dtReportDate.Text).ToString("M/d/yyyy");

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

            //Get Shift for this Date
            oCmd.CommandText = "sp_GetShift '" + ViewModel.ShiftDate + "'";
            ADORecordSetHelper oRec = ADORecordSetHelper.Open(oCmd, "");

            if (!oRec.EOF)
            {
                ViewModel.sprReport.Row  = 2;
                ViewModel.sprReport.Col  = 1;
                ViewModel.sprReport.Text = "Battalion " + ViewModel.CurrBatt + " Daily Worksheet for " + ViewModel.CurrDate;
                ViewModel.sprReport.Col  = 11;
                ViewModel.sprReport.Text = "Shift " + Convert.ToString(oRec["shift_code"]).Trim();
                ViewModel.sprReport.Col  = 16;
                ViewModel.sprReport.Text = "Debit Group " + Convert.ToString(oRec["debit_group_code"]).Trim();
            }
            FillSpread();
        }