コード例 #1
0
        private void DeleteLeave_Click(object sender, EventArgs e)
        {
            try
            {
                string query = "";
                if (StaffID.Text.Trim() == "")
                {
                    MessageBox.Show("Please Enter Employee ID");
                    StaffID.Focus();
                    return;
                }
                query = "DELETE FROM LeaveApply_Info WHERE StaffID = " + stfID;

                if (DbAccess.ExecuteToDB(query))
                {
                    if (stfID != 0)
                    {
                        MessageBox.Show("Delete Successfully!!!");
                    }
                    else
                    {
                        MessageBox.Show("Failed To Delete!!!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Connection Error!!!");
            }
            finally
            {
                Reset();
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: li223/PcShopApp
        private Task ResetCreateWindow()
        {
            PSUADD.IsEnabled  = true;
            CPUADD.IsEnabled  = true;
            CaseADD.IsEnabled = true;
            RAMADD.IsEnabled  = true;
            MBADD.IsEnabled   = true;
            GPUADD.IsEnabled  = true;

            PSUCombo.IsEnabled  = true;
            CPUCombo.IsEnabled  = true;
            CaseCombo.IsEnabled = true;
            RAMCombo.IsEnabled  = true;
            MBCombo.IsEnabled   = true;
            GPUCombo.IsEnabled  = true;

            PSUCombo.SelectedValue  = null;
            CPUCombo.SelectedValue  = null;
            CaseCombo.SelectedValue = null;
            RAMCombo.SelectedValue  = null;
            MBCombo.SelectedValue   = null;
            GPUCombo.SelectedValue  = null;
            HDDCombo.SelectedValue  = null;

            CustID.Clear();
            StaffID.Clear();
            _orderedItems.Clear();
            _listBoxItems.Clear();
            OrderListBox.ItemsSource = _listBoxItems;
            return(Task.CompletedTask);
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("Login1.aspx");
            }

            using (MySqlConnection sqlcon = new MySqlConnection(ConnectionString))
            {
                sqlcon.Open();
                MySqlDataAdapter sqlDa = new MySqlDataAdapter("SELECT * FROM staff", sqlcon);
                DataTable        dtb1  = new DataTable();
                sqlDa.Fill(dtb1);
                StaffID.DataSource = dtb1;
                StaffID.DataBind();
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("Login1.aspx");
            }
            UserDetails.Text = "Username : "******"username"];

            using (MySqlConnection sqlcon = new MySqlConnection(ConnectionString))
            {
                sqlcon.Open();
                MySqlDataAdapter sqlDa   = new MySqlDataAdapter("SELECT * FROM rota WHERE Hours =" + Session["hours"] + " AND StaffID != '" + Session["username"] + "'", sqlcon);
                DataSet          Choices = new DataSet();
                sqlDa.Fill(Choices, "Choices");
                StaffID.DataSource = Choices;
                StaffID.DataBind();
            }
        }
コード例 #5
0
        private void addStaff(string strStaff)
        {
            StaffID objStaff = new StaffID();

            lstStaff.Items.Add(cmbStaff.Text);
            clsDB  objDB = new clsDB(resPinnacle.liveDB);
            string SQL   = "Select ID";

            SQL = SQL + " From Staff";
            SQL = SQL + " Where Staff.FirstName || ' ' || LastName = '" + strStaff + "'";

            SQLiteDataReader objReader = objDB.returnDataReader(SQL);

            while (objReader.Read())
            {
                objStaff.ID = objReader[0].ToString();
            }
            objStaff.Name = strStaff;
            StaffIDs.Add(objStaff);
        }
コード例 #6
0
 public void FormControls(string CLR)
 {
     if (CLR == "CLR")
     {
         StaffID.Clear();
         StaffName.Clear();
         StaffType.Text = "Select";
         StaffAddress.Clear();
         StaffCity.Clear();
         StaffContact.Clear();
         StaffID.Enabled      = false;
         StaffName.Enabled    = false;
         StaffType.Enabled    = false;
         StaffAddress.Enabled = false;
         StaffCity.Enabled    = false;
         StaffContact.Enabled = false;
         btnsave.Enabled      = false;
         btnedit.Enabled      = false;
         btndelete.Enabled    = false;
         btnadd.Enabled       = true;
         btnfind.Enabled      = true;
         Left1.Enabled        = false;
         Right1.Enabled       = false;
     }
     if (CLR == "Save")
     {
         btnsave.Enabled      = true;
         btnadd.Enabled       = false;
         btnfind.Enabled      = false;
         btndelete.Enabled    = false;
         btnedit.Enabled      = false;
         StaffName.Enabled    = true;
         StaffType.Enabled    = true;
         StaffAddress.Enabled = true;
         StaffCity.Enabled    = true;
         StaffContact.Enabled = true;
         StaffName.Focus();
     }
 }
コード例 #7
0
    Int32 DisplayStaff(string StaffNameFilter)
    {
        Int32  StaffID;        //var to store the primary key
        string StaffName;      //var to store the phone type
        string StaffTelNumber; //var to store the phone number
        string StaffAddress;
        //; //create an onstance of the phone book class
        //create an instance of the phone collection class
        clsStaffCollection StaffBook = new clsStaffCollection();

        StaffBook.ReportByStaffName(StaffNameFilter);
        Int32 RecordCount;                                              // var to store the count of records
        Int32 Index = 0;                                                // var to store the index for the loop

        RecordCount = StaffBook.Count;                                  // get the count of records
        lstStaff.Items.Clear();
        while (Index < RecordCount)                                     // while there are records to process
        {
            StaffID        = StaffBook.StaffList[Index].StaffID;        // get the primary key
            StaffName      = StaffBook.StaffList[Index].StaffName;      // get the phone type
            StaffTelNumber = StaffBook.StaffList[Index].StaffTelNumber; // get the phone name
            StaffAddress   = StaffBook.StaffList[Index].StaffAddress;   // get the phone name
                                                                        //create a new entry for the list box
            ListItem NewEntry = new ListItem(StaffName + " " + StaffAddress + " " + StaffTelNumber, StaffID.ToString());
            lstStaff.Items.Add(NewEntry);                               // ADD THE STAFF TO THE LIST
            Index++;
        }
        return(RecordCount); //return the count of records found
    }
コード例 #8
0
        private void SaveLeave_Click(object sender, EventArgs e)
        {
            string query = ""; int TypeKey = ((KeyValuePair <int, string>)LeaveaTypeCombo.SelectedItem).Key;
            String TypeValue = ((KeyValuePair <int, string>)LeaveaTypeCombo.SelectedItem).Value;

            if (StaffID.Text.Trim() == "")
            {
                MessageBox.Show("Please Enter Staff ID");
                StaffID.Focus();
                return;
            }

            if (TypeKey < 1)
            {
                MessageBox.Show("Please Enter Leave Type");
                LeaveaTypeCombo.Focus();
                return;
            }
            if (DateFrom.Text == "")
            {
                MessageBox.Show("Please Enter Date From");
                DateFrom.Focus();
                return;
            }

            if (DateTo.Text.Trim() == "")
            {
                MessageBox.Show("Please Enter Date To");
                DateTo.Focus();
                return;
            }

            if (TotalLeave.Text.Trim() == "")
            {
                TotalLeave.Focus();
                return;
            }
            else
            {
                if (!IsValid(TypeKey, TypeValue, Convert.ToInt32(TotalLeave.Text)))
                {
                    MessageBox.Show("You can not apply for more than ur assigned leave!!!");
                    return;
                }
            }

            try
            {
                if (hiddenText.Text == "")
                {
                    query = "INSERT INTO LeaveApply_Info(StaffID,Type,Datefrom,DateTo,Total) VALUES(" + Convert.ToInt32(StaffID.Text) + ",  '" + TypeValue + "',  '" + DateFrom.Value.ToString("yyyy/MM/dd") + "', '" + DateTo.Value.ToString("yyyy/MM/dd") + "', '" + TotalLeave.Text + "' )";
                }

                else
                {
                    query = "UPDATE LeaveApply_Info SET Type = '" + TypeValue + "',  Datefrom= '" + DateFrom.Value.ToString("yyyy/MM/dd") + "',DateTo = '" + DateTo.Value.ToString("yyyy/MM/dd") + "', Total = '" + TotalLeave.Text + "' WHERE Id = " + Convert.ToInt32(hiddenText.Text);
                }

                if (DbAccess.ExecuteToDB(query))
                {
                    if (hiddenText.Text == "")
                    {
                        MessageBox.Show("Saved Successfully!!!");
                    }
                    else
                    {
                        MessageBox.Show("Updated Successfully!!!");
                    }
                }
                else
                {
                    MessageBox.Show("Failed To Save!!!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Connection Error!!!");
            }
            finally
            {
                Reset();
            }
        }
コード例 #9
0
        public RuntimeProperties(ServiceConfigParameters ConfigParameters)
        {
            _ServiceConfigParameters = ConfigParameters;
            //personal
            _Staff_ID = new StaffID();
            _Full_Name = new FullName();
            _Country = new Country();
            _ContractType = new ContractType();
            _ContractTypeForReports = new ContractTypeForReports();
            _Position = new Position();
            _DateOfTREnd = new DateOfTREnd();
            _DateOfTRStart = new DateOfTRStart();
            _DateOfEntrance = new DateOfEntrance();
            _CalendarName = new CalendarName();
            _TemplateFilter = new TemplateFilter();
            _ArePropReadyPersonal = new ArePropReady();
            _BusinessUnitInfo = new BusinessUnitInfo();
            _PMSA = new PMSA();
            _PMSAItem = new PMSAItem();
            _Gender = new Gender();
            _ActivityCodeInfo = new ActivityCodeInfo();
            _OfficialLS = new OfficialLS();
            _PhoneDirOnly = new PhoneDirOnly();
            //update
            _SelectedDate = new SelectedDate();
            _SelectedDateStatus = new SelectedDateStatus();
            _SelectedDateTransactionStatus = new SelectedDateTransactionStatus();
            _SelectedDateType = new SelectedDateType();
            _SelectedDateisOptional = new SelectedDateisOptional();
            _PercentPerDay = new PercentPerDay();
            _SelectedJob = new SelectedJob();
            _MaxHoursDaily = new MaxHoursDaily();
            _ArePropReadyTRUpdate = new ArePropReady();
            _TRInputListClient = new TRInputListClient();
            _LastOpenDay = new LastOpenDay();

            //submit
            _SumOfHours = new SumOfHours();
            _TRInputList = new TRInputList();
            _WorkingHoursWeekly = new WorkingHoursWeekly();
            _MinHoursDaily = new MinHoursDaily();
            _FirstSubmitableDay = new FirstSubmitableDay();
            _SelectedActivityCode = new SelectedActivityCode();
            _Description = new Description();
            _Location = new Location();
            _BusinessUnit = new BusinessUnit();
            _ReasonCode = new ReasonCode();
            _ArePropReadyTRSubmit = new ArePropReady();
            _PeriodEnd = new PeriodEnd();
            //reports

            _PeriodStarting = new PeriodStarting();
            _ArePropReadyReports = new ArePropReady();
            _ReportIntervalFrom = new ReportIntervalFrom();
            _ReportIntervalTo = new ReportIntervalTo();
            _UserIDList = new UserIDList();
            _SelectedReportTemplate = new SelectedReportTemplate();
            _SelectedReportType = new SelectedReportType();

            //külön queryk-ben/Getparameters-ben kap értéket

            _LastSubmittedDay = new LastSubmittedDay();
            _JobCh = new JobCH();
            _InsertedHour = new InstertedHour();
            _ValidationConstraint = new ValidationConstraint();
            _JobFilter = new JobFilter();
            _ActivityCodeFilter = new ActivityCodeFilter();
            _UserGroup = new UserGroup();
            _ReasonCodeFilter = new ReasonCodeFilter();
        }