Beispiel #1
0
        /// <summary>
        /// Hàm xử lý xe chuẩn (Thêm + Update)
        /// </summary>
        /// <param name="verNum"></param>
        public void VehicleStandardProcess(string verNum)
        {
            ConnectDb cn = new ConnectDb();

            try
            {
                if (grd_HistoryGs.RowCount == 0)
                {
                    return;
                }
                if (string.IsNullOrEmpty(verNum))
                {
                    return;
                }
                int typeId = -1;
                if (cn.CheckVerhicleNunberInTransaction(verNum, out typeId))
                {
                    if (typeId != -1)
                    {
                        cn.CheckStandardVerhicleInfo(verNum, typeId);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
            finally
            {
                cn.CloseConnection();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Hàm remove xe khỏi danh sách dữ liệu chuẩn
        /// So sánh loại xe có khớp vs xe trong dữ liệu chuẩn không, nếu khớp mới remove
        /// </summary>
        /// <param name="verNum"></param>
        public void RemoveVehicleStandard(string vehNum, int Vehtype)
        {
            ConnectDb cn = new ConnectDb();

            try
            {
                if (Vehtype == cn.SelectStandardVehicleInfo(vehNum))
                {
                    cn.DeleteStandardVehicleInfo(vehNum);
                }
            }
            catch (Exception ex)
            {
                logDb.Error(string.Format("Không thể xóa xe '{0}' khỏi dữ liệu xe chuẩn, lỗi \n{1}", vehNum, ex.ToString()));
            }
            finally
            {
                cn.CloseConnection();
            }
        }