Beispiel #1
0
        /// <summary>
        /// Prepare
        /// </summary>
        private static void prepare()
        {
            // Prepare
            __Program.hasLogin = 0;

            // Initilization
            string exePath = System.Reflection.Assembly.GetExecutingAssembly().Location;

            Common.Initializer.init(Path.Combine(Application.StartupPath, "log.txt"), exePath);

            ///FOR TEST
            Common.BLL.Entity.GasStation.User user  = new Common.BLL.Entity.GasStation.User();
            Common.BLL.Logic.GasStation.User  luser = new Common.BLL.Logic.GasStation.User(Common.Enum.EDatabase.GasStation);
            user.id = 2;
            luser.read(user);
            Common.GlobalData.UserManager.currentUser = user;

            //Helper.GridHeaderMaker.makeHeaderOwnerUserControls();
            //Helper.GridHeaderMaker.makeHeaderCarUserControls();
            //Helper.GridHeaderMaker.makeHeaderTrafficUserControls();
            Helper.GridHeaderMaker.makeHeaderReportTraffic();


            //Helper.GridHeaderMaker.makeHeaderSearchOwner();
            //Helper.GridHeaderMaker.makeHeaderOwner();
            //Helper.GridHeaderMaker.makeHeaderCarColor();
            //Helper.GridHeaderMaker.makeHeaderCarLevel();
            //Helper.GridHeaderMaker.makeHeaderCarFuel();
            //Helper.GridHeaderMaker.makeHeaderCarSystem();
            //Helper.GridHeaderMaker.makeHeaderCarType();
            //Helper.GridHeaderMaker.makeHeaderPlateType();
            //Helper.GridHeaderMaker.makeHeaderPlateCity();
        }
Beispiel #2
0
        /// <summary>
        /// Prepare
        /// </summary>
        private void prepare()
        {
            mrs = new ManualResetEvent(true);
            makeEventLog();

            #region Get Service User
            Common.BLL.Logic.GasStation.User lUser = new Common.BLL.Logic.GasStation.User(Common.Enum.EDatabase.GasStation);
            CommandResult opResult = lUser.getServiceUser();

            serviceUser = opResult.model as Common.BLL.Entity.GasStation.User;
            #endregion
        }
Beispiel #3
0
        /// <summary>
        /// Insert tag
        /// </summary>
        /// <returns></returns>
        public CommandResult insertTagByService(Common.BLL.Entity.GasStation.Tag tag,
                                                Common.BLL.Entity.GasStation.User user, DateTime regDate, int intervalTime)
        {
            CommandResult result = null;

            if ((null != tag) && (null != user))
            {
                // Register new traffic
                result = BaseDAL.DBaseHelper.executeCommand(BaseDAL.Base.EnumExecuteType.procedureNonQuery, connection, C_spTrafficRegisterByService, true,
                                                            new KeyValuePair("@tagData", tag.tag),
                                                            new KeyValuePair("@insertedById", user.id),
                                                            new KeyValuePair("@trafficDate", regDate),
                                                            new KeyValuePair("@intervalTime", intervalTime)
                                                            );
            }
            else
            {
                result = CommandResult.makeNullDataResult();
            }

            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// save Data
        /// </summary>
        /// <param name="owner"></param>
        /// <param name="plate"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        public CommandResult saveData(Common.BLL.Entity.GasStation.Owner owner,
                                      Common.BLL.Entity.GasStation.Plate plate,
                                      Common.BLL.Entity.GasStation.User user)
        //Common.BLL.Entity.GasStation.Car car,

        //Common.BLL.Entity.GasStation.LegalOwner legalOwner)
        {
            CommandResult result;

            if (null != owner && null != user)
            {
                result = BaseDAL.DBaseHelper.executeCommand(BaseDAL.Base.EnumExecuteType.procedureReader, connection, C_spSaveData, true,
                                                            new KeyValuePair("@nationalCode", owner.nationalCode),
                                                            new KeyValuePair("@name", owner.name),
                                                            new KeyValuePair("@lastname", owner.lastname),
                                                            new KeyValuePair("@birthdate", owner.birthdate),
                                                            new KeyValuePair("@birthdatelocal", owner.birthdatelocal),
                                                            new KeyValuePair("@gen", owner.gen),
                                                            new KeyValuePair("@mobile", owner.mobile),
                                                            new KeyValuePair("@address", owner.address),
                                                            new KeyValuePair("@phone", owner.phone),


                                                            new KeyValuePair("@plate", plate.plate),
                                                            new KeyValuePair("@palteCityId", plate.plateCityId),
                                                            new KeyValuePair("@palteTypeId", plate.plateTypeId),



                                                            new KeyValuePair("@insertedById", user.id)
                                                            );
            }
            else
            {
                result = CommandResult.makeNullDataResult();
            }

            return(result);
        }