Exemplo n.º 1
0
        private void UncheckApproval(DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }
            string empID    = gvRecap.Rows[e.RowIndex].Cells[0].Value.ToString();
            string fieldVal = "1";
            bool   val      = (bool)gvRecap.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;

            if (val)
            {
                fieldVal = "0";
            }
            string appField = "SupApprove";

            switch (gvRecap.Columns[e.ColumnIndex].Name)
            {
            case "OMApproved":
                appField = "OMApprove";
                break;

            case "HOApproved":
                appField = "HOApprove";
                break;
            }
            string sql = "UPDATE Timesheet SET " + appField + "= " + fieldVal;

            sql += " WHERE EmployeeID = " + empID;
            using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr))
            {
                dg.RunCommand(sql);
            }
            FillTotalsView();
        }
Exemplo n.º 2
0
        private void ApproveBySuper(DataGridViewCellEventArgs e)
        {
            string empId = gvRecap.Rows[e.RowIndex].Cells[0].Value.ToString();

            using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr))
            {
                string sql = "UPDATE Timesheet SET SupApprove = 1 WHERE EmployeeID = " + empId;
                dg.RunCommand(sql);
            }
        }
Exemplo n.º 3
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string sql = "UPDATE SiteConfig SET BannerTitle='" + tbBannerTitle.Text + "',";

            sql += "BannerSubTitle='" + tbBannerSubTitle.Text + "',";
            sql += "HotlinePh='" + tbHotlinePh.Text + "',";
            sql += "AltHotline='" + tbAltHotline.Text + "',";
            sql += "AltHotlineMsg='" + tbAltHotlineMsg.Text + "'";
            sql += " WHERE DistKey=" + Session["DistKey"].ToString();
            dg.RunCommand(sql);
        }
Exemplo n.º 4
0
        private void ApproveAll(string btnName, string val)
        {
            string appField = "SupApprove";

            if (btnName == "OM")
            {
                appField = "OMApprove";
            }
            string sql = "UPDATE Timesheet SET " + appField + "= " + val;

            using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr))
            {
                dg.RunCommand(sql);
            }
        }
Exemplo n.º 5
0
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (gvTimesheet.SelectedRows.Count < 1)
            {
                MessageBox.Show("Please select the entry before trying to delete");
                return;
            }
            string TimelineID = gvTimesheet.SelectedRows[0].Cells[0].Value.ToString();

            using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr))
            {
                string sql = "DELETE FROM Timesheet  WHERE TimesheetID=" + TimelineID;
                dg.RunCommand(sql);
            }
            FillGridView(true);
        }
Exemplo n.º 6
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            if (btn.Text == "Close")
            {
                Close();
            }
            else
            {
                using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr))
                {
                    dg.RunCommand("DELETE FROM Employee WHERE EmployeeID = " + lblEmpID.Text);
                }
                Close();
            }
        }
Exemplo n.º 7
0
        private void gvTimesheet_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (gvTimesheet.Columns[e.ColumnIndex].Name != "OTHours" && gvTimesheet.Columns[e.ColumnIndex].Name != "RegHours")
            {
                return;
            }
            string colName  = gvTimesheet.Columns[e.ColumnIndex].Name;
            string newValue = gvTimesheet.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();

            if (newValue == string.Empty)
            {
                newValue = "0.0";
            }
            string timeSheetID = gvTimesheet.Rows[e.RowIndex].Cells[0].Value.ToString();

            using (clsDataGetter dg = new clsDataGetter(CommonProcs.WCompanyConnStr))
            {
                string sql = "UPDATE Timesheet SET " + colName + " = " + newValue + " WHERE TimesheetID=" + timeSheetID;
                dg.RunCommand(sql);
            }
            FillGridView(true);
        }