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"); }
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"); }
public DataSet LoadNewCVAction() { DataSet newCVAction = SqlHelperUtils.ExecuteDatasetText(cmdtxtTblCaseActionInit); newCVAction.Tables[0].Clear(); DataRow newRow = newCVAction.Tables[0].NewRow(); newRow.BeginEdit(); newRow["nCaseID"] = -1; newRow["nModeID"] = -1; newRow["nActionByID"] = -1; newRow.EndEdit(); newCVAction.Tables[0].Rows.Add(newRow); return(newCVAction); }
public void LoadNewCV(string strBranchCode) { newCVDataSet = SqlHelperUtils.ExecuteDatasetText(cmdtxtTblCaseInit); newCVDataSet.Tables[0].Clear(); DataRow newRow = newCVDataSet.Tables[0].NewRow(); newRow.BeginEdit(); newRow["dtDate"] = DateTime.Today; newRow["strBranchCode"] = strBranchCode; newRow["nDepartmentID"] = -1; newRow["nTypeID"] = -1; newRow["nCategoryID"] = -1; newRow["strMembershipID"] = ""; newRow["nSubmittedByID"] = -1; newRow["nEmployeeID"] = -1; newRow.EndEdit(); newCVDataSet.Tables[0].Rows.Add(newRow); }
/// <summary> /// Save Time Card /// </summary> /// <param name="ds"></param> /// <returns>true is In, false is out</returns> public bool SaveTimeCard(string strBranchCode, int nEmployeeID) { DataSet ds = SqlHelperUtils.ExecuteDatasetText(cmdtxtTblTimeCardInit); ds.Tables[0].Clear(); DataRow newRow = ds.Tables[0].NewRow(); newRow.BeginEdit(); newRow["strBranchCode"] = strBranchCode; newRow["nEmployeeID"] = nEmployeeID; newRow["dtDate"] = DateTime.Today; newRow["dtTime"] = DateTime.Now; newRow.EndEdit(); ds.Tables[0].Rows.Add(newRow); SqlHelperUtils.UpdateDataSetSingleTableWithTransaction(ds, cmdtxtTblTimeCardSave); return(IsPunchIn(nEmployeeID, strBranchCode)); }