Exemplo n.º 1
0
 public void ConvertLeavetoTimeOff(int nEmployeeID, int nYearID, int nQuantity)
 {
     SqlHelperUtils.ExecuteNonQuerySP("pr_tblLeave_ConvertLeavetoTimeOff",
                                      new SqlParameter("@inEmployeeID", nEmployeeID),
                                      new SqlParameter("@inYearID", (nYearID)),
                                      new SqlParameter("@nQuantity", nQuantity));
 }
Exemplo n.º 2
0
 public void ApplyPH(int nEmployeeID, DateTime dtDate, string sstrReason)
 {
     SqlHelperUtils.ExecuteNonQuerySP("dw_tblLeavePH_Insert",
                                      new SqlParameter("@inEmployeeID", nEmployeeID),
                                      new SqlParameter("@dadtDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, dtDate),
                                      new SqlParameter("@sstrReason", sstrReason));
 }
Exemplo n.º 3
0
 public DataTable ListContacts(string strBranchCode, int nstatus, string txtSearchString)
 {
     return(SqlHelperUtils.ExecuteDataTableSP("sp_tblContactsNew_SelectAllWnBranchCodeLogic",
                                              new SqlParameter("@strBranchCode", strBranchCode),
                                              new SqlParameter("@nstatus", nstatus),
                                              new SqlParameter("@strSearchString", txtSearchString), SqlHelperUtils.paramErrorCode));
 }
Exemplo n.º 4
0
 public DataTable ListOvertime(int nEmployeeID, DateTime startDate, DateTime endDate)
 {
     return(SqlHelperUtils.ExecuteDataTableSP("pr_tblOvertime_SelectAllWnEmployeeIDDateTime",
                                              new SqlParameter("@inEmployeeID", nEmployeeID),
                                              new SqlParameter("@ddtStartDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, startDate),
                                              new SqlParameter("@ddtEndDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, endDate)));
 }
Exemplo n.º 5
0
 public void UpdateNewReceipientGroup(string strMemoGroupCode, string strDescription, int nMemoGroupID)
 {
     SqlHelperUtils.ExecuteNonQuerySP("pr_tblMemoGroup_Update",
                                      new SqlParameter("@inMemoGroupID", SqlDbType.Int, 4, ParameterDirection.Input, false, 10, 0, "", DataRowVersion.Proposed, nMemoGroupID),
                                      new SqlParameter("@sstrMemoGroupCode", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, strMemoGroupCode),
                                      new SqlParameter("@sstrDescription", SqlDbType.VarChar, 50, ParameterDirection.Input, true, 0, 0, "", DataRowVersion.Proposed, strDescription));
 }
Exemplo n.º 6
0
        public DataTable GetMCBalance(int nEmployeeID)
        {
            int nYearID = GetNYearID(nEmployeeID);

            return(SqlHelperUtils.ExecuteDataTableSP("pr_GetAllMCBalanceInfo",
                                                     new SqlParameter("@inEmployeeID", nEmployeeID), new SqlParameter("@inYearID", nYearID)));
        }
Exemplo n.º 7
0
        public double GetActual_AnnualBalance(int nEmployeeID, int nYearID, DateTime startDate)
        {
            DataTable leaveTable = SqlHelperUtils.ExecuteDataTableSP("pr_SelectAnnualLeaveBalance",
                                                                     new SqlParameter("@inEmployeeID", nEmployeeID),
                                                                     new SqlParameter("@inYearID", nYearID));

            DateTime employeeStartDate = DateTime.Today;

            TimeSpan dayDifferent = startDate - (employeeStartDate.AddYears(nYearID - 1));
            double   leaveEarned  = Convert.ToDouble(leaveTable.Rows[0]["inLeaveMaxQty"]) / 365.00 * dayDifferent.Days;

            leaveEarned = Math.Round(leaveEarned, 0);

            double leaveUsed = 0;

            if (leaveTable.Rows.Count > 1)
            {
                for (int i = 1; i <= leaveTable.Rows.Count - 1; i++)
                {
                    leaveUsed = leaveUsed + (Convert.ToDouble(leaveTable.Rows[i]["NoOfDays"]) * -1);
                }
            }

            double nLeaveBalance = leaveEarned - leaveUsed +
                                   Convert.ToDouble(leaveTable.Rows[0]["NoOfDays"]);

            return(nLeaveBalance);
        }
Exemplo n.º 8
0
 public DataTable ListAppointment(string strBranchCode, DateTime startDate, DateTime endDate)
 {
     return(SqlHelperUtils.ExecuteDataTableSP("pr_tblAppointment_SelectAllWnBranchCode",
                                              new SqlParameter("@strBranchCode", strBranchCode),
                                              new SqlParameter("@ddtStartDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, startDate),
                                              new SqlParameter("@ddtEndDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, endDate)));
 }
Exemplo n.º 9
0
 public void NewReceipientGroup(string strMemoGroupCode, string strDescription, int nEmployeeID)
 {
     SqlHelperUtils.ExecuteNonQuerySP("pr_tblMemoGroup_InsertReceipientGroup",
                                      new SqlParameter("@sstrMemoGroupCode", strMemoGroupCode),
                                      new SqlParameter("@sstrDescription", strDescription),
                                      new SqlParameter("@inEmployeeID", nEmployeeID));
 }
Exemplo n.º 10
0
 public void CancelPH(int nEmployeeID, DateTime dtDate)
 {
     SqlHelperUtils.ExecuteNonQuerySP("dw_tblLeavePH_UpdateCancel",
                                      new SqlParameter("@Employee", nEmployeeID),
                                      new SqlParameter("@dtDate", dtDate),
                                      new SqlParameter("@ManagerID", 0)
                                      );
 }
Exemplo n.º 11
0
        public bool SaveCV(int nCaseID, DataSet ds)
        {
            string cmdtxt = "SELECT * FROM tblCase WHERE nCaseID = '"
                            + SqlHelperUtils.ToSingleQuoteString(nCaseID.ToString()) + "'";

            SqlHelperUtils.UpdateDataSetSingleTableWithTransaction(ds, cmdtxt);
            return(true);
        }
Exemplo n.º 12
0
        public bool SaveNewCVAction(DataSet dsTblCaseAction, int nCaseID, DataSet dsTblCase)
        {
            string cmdtxt = "SELECT * FROM tblCase WHERE nCaseID = '"
                            + SqlHelperUtils.ToSingleQuoteString(nCaseID.ToString()) + "'";

            SqlHelperUtils.UpdateDataSetTwoTableWithTransaction(dsTblCase, cmdtxt, dsTblCaseAction, cmdtxtTblCaseActionSave);
            return(true);
        }
Exemplo n.º 13
0
        public DataTable ListOneDetail(int nLeaveID)
        {
            SqlParameter paramLeaveID = new SqlParameter("@inLeaveID", SqlDbType.Int);

            paramLeaveID.Value = nLeaveID;

            return(SqlHelperUtils.ExecuteDataTableSP("pr_tblLeave_SelectBynLeaveID", paramLeaveID));
        }
Exemplo n.º 14
0
 public void ManualUpdatePreviousBal(int nEmployeeID, int nYearID, decimal TotalBal)
 {
     SqlHelperUtils.ExecuteNonQuerySP("pr_tblLeaveAdjust_InUp",
                                      new SqlParameter("@inEmployeeID", nEmployeeID),
                                      new SqlParameter("@inYearID", (nYearID)),
                                      new SqlParameter("@LeaveEarned", TotalBal),
                                      new SqlParameter("@Type", "M"));
 }
Exemplo n.º 15
0
        public void ListTimesheetDetail(int nEmployeeID, string strBranchCode, DateTime startDate, DateTime endDate)
        {
            DataSet dsTimesheeDetail = SqlHelperUtils.ExecuteDatasetSP("pr_SelectTimesheetDetail",
                                                                       new SqlParameter("@inEmployeeID", nEmployeeID),
                                                                       new SqlParameter("@dtStartDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, startDate),
                                                                       new SqlParameter("@dtEndDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, endDate));

            myDetailTable = dsTimesheeDetail.Tables[1];
            AddDetailRowChangeEvent();
        }
Exemplo n.º 16
0
        private DataTable ListBasicTimesheet(int nEmployeeID, DateTime startDate, DateTime endDate)
        {
            string cmdtxt = "SELECT * FROM Sv_StaffTimesheet "
                            + "WHERE nEmployeeID = @nEmployeeID AND dtDate >= @startDate AND dtDate < @endDate and dtDate<=getdate()";

            return(SqlHelperUtils.ExecuteDataTableText(cmdtxt,
                                                       new SqlParameter("@nEmployeeID", nEmployeeID),
                                                       new SqlParameter("@startDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, startDate),
                                                       new SqlParameter("@endDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, endDate)));
        }
Exemplo n.º 17
0
        public void ListTimesheetDetail(int nEmployeeID, DateTime startDate, DateTime endDate, out DataTable timesheetTable,
                                        out DataTable timecardTable)
        {
            DataSet dsTimesheeDetail = SqlHelperUtils.ExecuteDatasetSP("pr_SelectTimesheetDetail",
                                                                       new SqlParameter("@inEmployeeID", nEmployeeID),
                                                                       new SqlParameter("@dtStartDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, startDate),
                                                                       new SqlParameter("@dtEndDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, endDate));

            timesheetTable = dsTimesheeDetail.Tables[0];
            timecardTable  = dsTimesheeDetail.Tables[1];
        }
Exemplo n.º 18
0
        public DataSet PrintCV(int nCaseID)
        {
            DataSet myDataSet = SqlHelperUtils.ExecuteDatasetSP("pr_CVPrint", new SqlParameter("@inCaseID", nCaseID));

            myDataSet.Tables[0].TableName = PRINTCVTABLENAME;
            myDataSet.Tables[1].TableName = PRINTCVACTIONTABLENAME;

            myDataSet.Relations.Add("MemoRecipient", myDataSet.Tables[PRINTCVTABLENAME].Columns["nCaseID"],
                                    myDataSet.Tables[PRINTCVACTIONTABLENAME].Columns["nCaseID"], true);

            return(myDataSet);
        }
Exemplo n.º 19
0
        public DataTable ListLeave(int nEmployeeID, Month aMonth, int year)
        {
            SqlParameter paramEmployeeID = new SqlParameter("@inEmployeeID", SqlDbType.Int);

            paramEmployeeID.Value = nEmployeeID;
            SqlParameter paramCurrentMonth = new SqlParameter("@ddtCurrentDate", SqlDbType.DateTime);

            paramCurrentMonth.Value = new DateTime(year, ((int)aMonth + 1), 1);

            return(SqlHelperUtils.ExecuteDataTableSP("pr_tblLeave_SelectCurrentMonthBynEmployeeID", paramEmployeeID,
                                                     paramCurrentMonth));
        }
Exemplo n.º 20
0
        private DataTable ListBasicTimesheet(int nEmployeeID, string strBranchCode, DateTime startDate, DateTime endDate)
        {
            string cmdtxt = "SELECT * FROM SV_EMPLOYEE_TIMESHEET "
                                                                                                                 //			string cmdtxt = "SELECT * FROM Sv_StaffTimesheet "
                            + "WHERE nEmployeeID = @nEmployeeID and dtDate >= @startDate AND dtDate < @endDate"; //AND strBranchCode=@strBranchCode

            return(SqlHelperUtils.ExecuteDataTableText(cmdtxt,
                                                       new SqlParameter("@nEmployeeID", nEmployeeID),
                                                       new SqlParameter("@strBranchCode", strBranchCode),
                                                       new SqlParameter("@startDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, startDate),
                                                       new SqlParameter("@endDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, endDate)));
        }
Exemplo n.º 21
0
 public bool DeleteReceipientGroup(int nMemoGroupID)
 {
     try
     {
         SqlHelperUtils.ExecuteNonQuerySP("pr_tblMemoGroup_Delete", new SqlParameter("@inMemoGroupID", nMemoGroupID));
     }
     catch
     {
         throw;
     }
     return(true);
 }
Exemplo n.º 22
0
 private void LoadBranchCodeList()
 {
     _ds    = new DataSet();
     strSQL = "select null [strBranchCode],'' [strBranchName] union select strBranchCode, strBranchName from tblBranch";
     _ds    = SqlHelperUtils.ExecuteDatasetText(strSQL, null);
     //SqlHelper.FillDataset(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) );
     dt = _ds.Tables["Table"];
     DevExpress.XtraEditors.Controls.LookUpColumnInfo[] col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo[2];
     col[0]       = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strBranchCode", "Branch Code", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None);
     col[1]       = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strBranchName", "Description", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None);
     myLookUpEdit = new ACMS.XtraUtils.LookupEditBuilder.CommonLookupEditBuilder(lkedtBranch.Properties, dt, col, "strBranchName", "strBranchCode", "Branch");
 }
Exemplo n.º 23
0
 public bool DeleteAppointment(int nAppointmentId)
 {
     try
     {
         SqlHelperUtils.ExecuteNonQuerySP("sp_tblAppointment_Delete", new SqlParameter("@inAppointmentId", nAppointmentId),
                                          SqlHelperUtils.paramErrorCode);
     }
     catch
     {
         throw;
     }
     return(true);
 }
Exemplo n.º 24
0
 public bool CancelLeave(int nEmployeeID, int nLeaveID)
 {
     try
     {
         SqlHelperUtils.ExecuteNonQuerySP("pr_tblLeave_CancelLeave",
                                          new SqlParameter("@inLeaveID", nLeaveID),
                                          new SqlParameter("@inEmployeeID", nEmployeeID));
     }
     catch
     {
         throw;
     }
     return(true);
 }
Exemplo n.º 25
0
        private void RetrieveRecordFromDB()
        {
            if (!isFinishBindInit)
            {
                return;
            }
            SqlParameter[] commandParameters = new SqlParameter[7];
            commandParameters[0] = new SqlParameter("@STARTDATE1", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, dateEdit1.EditValue);
            commandParameters[1] = new SqlParameter("@ENDDATE1", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, dateEdit2.EditValue);

            int i = 2;

            if (timeEdit1.EditValue.ToString() != "")
            {
                commandParameters[i] = new SqlParameter("@CLASSTIME1", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, timeEdit1.EditValue);
                i += 1;
            }

            if (lkedtBranch.EditValue.ToString() != "")
            {
                commandParameters[i] = new SqlParameter("@BRANCHCODE1", lkedtBranch.EditValue);
                i += 1;
            }

            if (lkedtClassType.EditValue.ToString() != "")
            {
                commandParameters[i] = new SqlParameter("@CLASSTYPE1", lkedtClassType.EditValue);
                i += 1;
            }

            if (lkedtClassCode.EditValue.ToString() != "")
            {
                commandParameters[i] = new SqlParameter("@CLASSCODE1", lkedtClassCode.EditValue);
                i += 1;
            }

            if (lkedtInstructor.EditValue.ToString() != "")
            {
                commandParameters[i] = new SqlParameter("@INSTRUCTORID1", lkedtInstructor.EditValue);
                i += 1;
            }

            if (cmbDayOfWeek.Text != "")
            {
                commandParameters[i] = new SqlParameter("@DOW1", cmbDayOfWeek.Text);
                i += 1;
            }

            _dtClassSchedule = SqlHelperUtils.ExecuteDataTableSP("up_get_ClassAnalysis_Variable", commandParameters);
        }
Exemplo n.º 26
0
 public bool DeleteOvertime(int nOvertimeID, int nEmployeeID)
 {
     try
     {
         SqlHelperUtils.ExecuteNonQuerySP("pr_tblOvertime_Delete",
                                          new SqlParameter("@inOvertimeID", nOvertimeID),
                                          new SqlParameter("@inEmployeeID", nEmployeeID));
     }
     catch
     {
         throw;
     }
     return(true);
 }
Exemplo n.º 27
0
        private void GetLatenessData()
        {
            SqlParameter paramEmployeeID = new SqlParameter("@inEmployeeID", nEmployeeID);
            SqlParameter paramStartDate  = new SqlParameter("@ddtStartDate", startDate);
            SqlParameter paramEndDate    = new SqlParameter("@ddtEndDate", endDate);

            myResultDataSet = SqlHelperUtils.ExecuteDatasetSP("pr_SelectLatenessTable", paramEmployeeID, paramStartDate,
                                                              paramEndDate);
            myResultDataSet.Tables[0].TableName = ROSTERTABLE;
            myResultDataSet.Tables[1].TableName = TIMECARDTABLE;
            myResultDataSet.Tables[2].TableName = LEAVETABLE;

            myResultDataSet.Tables[TIMECARDTABLE].DefaultView.Sort = "dtDate, strBranchCode";
        }
Exemplo n.º 28
0
        public bool CheckDupMobileNo(string strMobileNo)
        {
            DataSet ContactDataSet = SqlHelperUtils.ExecuteDatasetSP("sp_tblContacts_chkDupMobileNo", new SqlParameter("@strMobileNo", strMobileNo));
            bool    nStatus        = Convert.ToBoolean(ContactDataSet.Tables[0].Rows[0]["nStatus"]);

            if (nStatus)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 29
0
 public void NewAppoinment(int nEmployeeID, DateTime dtDate, DateTime dtStartTime, DateTime dtEndTime,
                           string strOrganization, string strBranchCode, int nContactID, string strRemarks, string strMembershipID, int nServedBy)
 {
     SqlHelperUtils.ExecuteNonQuerySP("pr_tblAppointment_Insert",
                                      new SqlParameter("@inEmployeeID", nEmployeeID),
                                      new SqlParameter("@dadtDate", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, dtDate),
                                      new SqlParameter("@dadtStartTime", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, dtStartTime),
                                      new SqlParameter("@dadtEndTime", SqlDbType.DateTime, 8, ParameterDirection.Input, true, 23, 3, "", DataRowVersion.Proposed, dtEndTime),
                                      new SqlParameter("@sstrOrganization", strOrganization),
                                      new SqlParameter("@sstrBranchCode", strBranchCode),
                                      new SqlParameter("@inContactId", nContactID),
                                      new SqlParameter("@sstrRemarks", strRemarks),
                                      new SqlParameter("@sstrMembershipID", strMembershipID),
                                      new SqlParameter("@inServedBy", nServedBy));
 }
Exemplo n.º 30
0
        private void LoadInstructorList()
        {
            _ds    = new DataSet();
            strSQL = "select null [nEmployeeID],'' [strEmployeeName] union select nEmployeeID, strEmployeeName from tblEmployee where fInstructor=1 order by strEmployeeName";
            _ds.Tables.Add("Table");
            _ds = SqlHelperUtils.ExecuteDatasetText(strSQL, null);


            //(connection,CommandType.StoredProcedure,"UP_GETDATA",_ds,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) );
            dt = _ds.Tables["Table"];
            DevExpress.XtraEditors.Controls.LookUpColumnInfo[] col = new DevExpress.XtraEditors.Controls.LookUpColumnInfo[2];
            col[0]       = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("nEmployeeID", "Employee ID", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None);
            col[1]       = new DevExpress.XtraEditors.Controls.LookUpColumnInfo("strEmployeeName", "Name", 15, DevExpress.Utils.FormatType.None, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None);
            myLookUpEdit = new ACMS.XtraUtils.LookupEditBuilder.CommonLookupEditBuilder(lkedtInstructor.Properties, dt, col, "strEmployeeName", "nEmployeeID", "Instructor");
        }