public static DataTable SelectXeQuaTram_TienPhong(string strCon) { DataTable dataTable = new DataTable(); string[] parameterNames = new string[] { "" }; string[] parameterValues = new string[] { "" }; return(CSDL.TruyXuatCSDLByProcedure(strCon, "SeXeQuaTramTienPhong", parameterNames, parameterValues, 0)); }
public static bool TimBienSoTuVeThang(string strCon, string SoVe, ref string BienSo, ref string NgayHetHan) { DataTable dataTable = new DataTable(); string[] parameterNames = new string[] { "@SoVe" }; string[] parameterValues = new string[] { SoVe }; dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SeVeBienSoTuSoVe", parameterNames, parameterValues, 1); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); while (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; byte loaiVe = Conversions.ToByte(dataRow["LoaiVe"]); int thangQui = Conversions.ToInteger(dataRow["ThangQui"]); int nam = Conversions.ToInteger(dataRow["Nam"]); if (CSDL.KiemTraVeThangQui((int)loaiVe, nam, thangQui, ref NgayHetHan)) { BienSo = Conversions.ToString(dataRow["BienSo"]); return(true); } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_D7) { ProjectData.SetProjectError(expr_D7); Exception ex = expr_D7; ModuleKhac.SaveError(ex.Message, "TimBienSoTuVeThang"); ProjectData.ClearProjectError(); } return(false); }
public static bool SelectMenhGiaVe(string strCon, string LoaiXe, ref long Phi, ref long PhiThang, ref long PhiQui) { DataTable dataTable = new DataTable(); string[] parameterNames = new string[] { "@LoaiXe" }; string[] parameterValues = new string[] { LoaiXe }; dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SePhi", parameterNames, parameterValues, 1); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); if (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; Phi = Conversions.ToLong(dataRow["Phi"]); PhiThang = Conversions.ToLong(dataRow["PhiThang"]); PhiQui = Conversions.ToLong(dataRow["PhiQui"]); return(true); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_B7) { ProjectData.SetProjectError(expr_B7); Exception ex = expr_B7; ModuleKhac.SaveError(ex.Message, "SelectMenhGiaVe"); ProjectData.ClearProjectError(); } return(false); }
public static bool SelectNhanVienDangTruc(string strCon, ref string MSNV, ref byte Catruc, ref string ThoiGianLuu) { string[] parameterNames = new string[] { "" }; string[] parameterValues = new string[] { "" }; DataTable dataTable = new DataTable(); dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SeNhanVienDangTruc", parameterNames, parameterValues, 0); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); if (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; MSNV = Conversions.ToString(dataRow["MSNV"]); Catruc = Conversions.ToByte(dataRow["CaTruc"]); ThoiGianLuu = Conversions.ToString(dataRow["ThoiGianLuu"]); return(true); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_BA) { ProjectData.SetProjectError(expr_BA); Exception ex = expr_BA; ModuleKhac.SaveError(ex.Message, "SelectNhanVienDangTruc"); ProjectData.ClearProjectError(); } return(false); }
public static bool SelectThoiGianCatruc(string strCon, string CaTruc, ref string GioBD, ref string GioKT) { DataTable dataTable = new DataTable(); string[] parameterNames = new string[] { "@CaTruc" }; string[] parameterValues = new string[] { CaTruc }; dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SeCaTruc", parameterNames, parameterValues, 1); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); if (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; GioBD = Conversions.ToString(dataRow["GioBD"]); GioKT = Conversions.ToString(dataRow["GioKT"]); return(true); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_A3) { ProjectData.SetProjectError(expr_A3); Exception ex = expr_A3; ModuleKhac.SaveError(ex.Message, "SelectThoiGianCaTRuc"); ProjectData.ClearProjectError(); } return(false); }
public static bool SelectNhanVien(string strCon, string MSNV, ref string HoTen) { DataTable dataTable = new DataTable(); string[] parameterNames = new string[] { "@MSNV" }; string[] parameterValues = new string[] { MSNV }; dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SeNhanVien", parameterNames, parameterValues, 1); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); if (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; HoTen = Conversions.ToString(dataRow["HoTen"]); return(true); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_90) { ProjectData.SetProjectError(expr_90); Exception ex = expr_90; ModuleKhac.SaveError(ex.Message, "SelectNhanVien"); ProjectData.ClearProjectError(); } return(false); }
public static bool SelectVali(string strCon, string MSNV, string SoVe, int LanXe, int TramId) { if (CSDL.Ve_Test(strCon, SoVe)) { return(true); } DataTable dataTable = new DataTable(); string[] parameterNames = new string[] { "@MSNV" }; string[] parameterValues = new string[] { MSNV }; dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SeValiData", parameterNames, parameterValues, 1); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); while (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; string maVali = Conversions.ToString(dataRow["MSVali"]); string right = Conversions.ToString(dataRow["SoVeBD"]); string right2 = Conversions.ToString(dataRow["SoVeKT"]); if (Operators.CompareString(SoVe, right, false) >= 0 & Operators.CompareString(SoVe, right2, false) <= 0 & (int)VeXe.CabinInMaVali(maVali) == LanXe) { string left = Strings.Format(DateAndTime.Now, "yyMMdd"); string left2 = Strings.Format(DateAndTime.DateAdd(DateInterval.Day, -1.0, DateAndTime.Now), "yyMMdd"); string left3 = Strings.Format(DateAndTime.Now, "HH"); string right3 = "12"; switch (ModuleKhaiBaoConst.CaTrucMain) { case 1: case 2: if ((int)VeXe.CatrucInMaVali(maVali) == ModuleKhaiBaoConst.CaTrucMain & Operators.CompareString(left, VeXe.NgayInMaValiString(maVali), false) == 0) { bool result = true; return(result); } break; case 3: if ((int)VeXe.CatrucInMaVali(maVali) == ModuleKhaiBaoConst.CaTrucMain & ((Operators.CompareString(left, VeXe.NgayInMaValiString(maVali), false) == 0 & Operators.CompareString(left3, right3, false) > 0) | (Operators.CompareString(left2, VeXe.NgayInMaValiString(maVali), false) == 0 & Operators.CompareString(left3, right3, false) < 0))) { bool result = true; return(result); } break; } } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_1F4) { ProjectData.SetProjectError(expr_1F4); Exception ex = expr_1F4; ModuleKhac.SaveError(ex.Message, "SelectVali"); ProjectData.ClearProjectError(); } return(false); }
public static bool TimDLXeMauTuBienSo(string strCon, string BienSo, ref byte PLTruoc, ref bool XeUuTien) { DataTable dataTable = new DataTable(); DateTime t = DateTime.Parse(Strings.Format(DateAndTime.Now, "MM/dd/yyyy")); string[] parameterNames = new string[] { "@BienSo" }; string[] parameterValues = new string[] { BienSo }; dataTable = CSDL.TruyXuatCSDLByProcedure(strCon, "SeDLXeMau", parameterNames, parameterValues, 1); try { IEnumerator enumerator = null; try { enumerator = dataTable.Rows.GetEnumerator(); if (enumerator.MoveNext()) { DataRow dataRow = (DataRow)enumerator.Current; PLTruoc = Conversions.ToByte(dataRow["PLXe"]); XeUuTien = false; try { int num = Conversions.ToInteger(dataRow["TinhTrangMuaVe"]); if (num == 5) { DateTime t2 = DateTime.Parse(Conversions.ToString(dataRow["NgayApDung"])); DateTime t3 = DateTime.Parse(Conversions.ToString(dataRow["NgayHetHan"])); if (DateTime.Compare(t, t2) >= 0 & DateTime.Compare(t, t3) <= 0) { XeUuTien = true; } } } catch (Exception expr_FA) { ProjectData.SetProjectError(expr_FA); XeUuTien = false; ProjectData.ClearProjectError(); } return(true); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception expr_137) { ProjectData.SetProjectError(expr_137); Exception ex = expr_137; ModuleKhac.SaveError(ex.Message, "TimDLXeMauTuBienSo"); ProjectData.ClearProjectError(); } return(false); }