public ActionResult SaveExist(Exist exist, string W_name, string U_name)
        {
            //通过key查询到要改变的exit
            //通过W_name和U_name分别获得仓库编号和用户编号
            //整合信息
            UserBusinessLayer userBusinessLayer = new UserBusinessLayer();

            if ((exist.U_id = userBusinessLayer.GetId(U_name)) == -1)
            {
                return(RedirectToAction("RedirectStorage"));
            }
            WarehouseBusinessLayer warehouseBusinessLayer = new WarehouseBusinessLayer();

            if ((exist.W_id = warehouseBusinessLayer.GetId(W_name)) == -1)
            {
                return(RedirectToAction("RedirectStorage"));
            }
            //修改信息
            ExistBusinessLayer existBusinessLayer = new ExistBusinessLayer();

            existBusinessLayer.InputExist(exist.IO_Id, exist);

            //重定向
            return(RedirectToAction("RedirectStorage"));
        }
Exemple #2
0
        protected override void Execute(NativeActivityContext context)
        {
            string Res = @path.Get(context);


            try
            {
                if (Res != null)
                {
                    switch (Ft)
                    {
                    case FileType.File:
                        Exist.Set(context, File.Exists(Res) ? true : false);
                        break;

                    case FileType.Folder:
                        Exist.Set(context, Directory.Exists(Res) ? true : false);
                        break;
                    }
                }
            }

            catch (NullReferenceException e)
            {
                Logger.Log.Logger.LogData("NullReferenceException  " + e.Message, LogLevel.Error);
            }
            catch (Exception e)
            {
                Logger.Log.Logger.LogData("Exception  " + e.Message, LogLevel.Error);
            }
        }
Exemple #3
0
 public void RefreshExistingMap()
 {
     gameList = PhotonNetwork.GetRoomList();
     Debug.Log(gameList.Length);
     ClearExistingMap();
     if (gameList.Length == 0)
     {
         Empty.SetActive(true);
         Exist.SetActive(false);
     }
     else
     {
         Empty.SetActive(false);
         Exist.SetActive(true);
         for (int i = 0; i < gameList.Length; i++)
         {
             var room = gameList[i];
             if (room.IsOpen && room.PlayerCount < 3)
             {
                 GameObject newItem = Instantiate(MapContainer) as GameObject;
                 newItem.name = room.Name;
                 newItem.GetComponentInChildren <Text>().text = "Room name : " + room.Name + " with " + room.PlayerCount.ToString() + " / 3";;
                 newItem.transform.SetParent(MapContainerParent.transform, false);
                 containerlist.Add(newItem);
             }
         }
         if (containerlist.Count == 0)
         {
             Empty.SetActive(true);
             Exist.SetActive(false);
         }
     }
 }
        public async Task <IActionResult> PutHistory(int id, History history)
        {
            if (id != history.HistoryId)
            {
                return(BadRequest());
            }

            _context.Entry(history).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                Exist checkIfExist = id => { return(_context.History.Any(e => e.HistoryId == id)); };

                if (!checkIfExist(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #5
0
 private void Change(ref Exist model, Exist exists)
 {
     model.Count    = exists.Count;
     model.Co_id    = exists.Co_id;
     model.IntoDate = exists.IntoDate;
     model.IO_Id    = exists.IO_Id;
     model.U_id     = exists.U_id;
     model.W_id     = exists.W_id;
 }
Exemple #6
0
 public CarGame()
 {
     InitializeComponent();
     Wall1.BringToFront();
     Wall2.BringToFront();
     Wall3.BringToFront();
     Restart.BringToFront();
     Exist.BringToFront();
 }
Exemple #7
0
 public ShootingGame()
 {
     InitializeComponent();
     EnemyJet1.BringToFront();
     EnemyJet2.BringToFront();
     EnemyJet3.BringToFront();
     Restart.BringToFront();
     Exist.BringToFront();
     MainJet.BringToFront();
 }
Exemple #8
0
        private static void TestExist()
        {
            Exist instance = new Exist();

            Console.WriteLine(instance.Solution(new[]
            {
                new[] { 'A', 'B', 'C', 'E' },
                new[] { 'S', 'F', 'C', 'S' },
                new[] { 'A', 'D', 'E', 'E' },
            }, "ABCCED"));
        }
Exemple #9
0
        /// <summary>
        /// 修改Exist数据
        /// </summary>
        /// <param name="name"></param>
        /// <param name="exists"></param>
        public void InputExist(string IO_Id, Exist exists)
        {
            WarehouseERPDAL dB    = new WarehouseERPDAL();
            var             model = dB.exists.Where(c => c.IO_Id == IO_Id).FirstOrDefault();

            if (model != null)
            {
                //model.U_password = user.U_password;
                Change(ref model, exists);
            }
            dB.SaveChanges();
        }
Exemple #10
0
        /// <summary>
        /// 存储仓库信息
        /// </summary>
        /// <param name="exists"></param>
        /// <returns></returns>
        public Exist InsertExist(Exist exists)
        {
            WarehouseERPDAL dB    = new WarehouseERPDAL();
            List <Exist>    model = dB.exists.Where(c => c.IO_Id == exists.IO_Id && exists.W_id == c.W_id).ToList();

            if (model != null && model.Count() > 0)
            {
                model.FirstOrDefault().Count += exists.Count;
            }
            else
            {
                dB.exists.Add(exists);
            }
            dB.SaveChanges();
            return(exists);
        }
Exemple #11
0
        //通过相应的storage表获得exist表
        public Exist GetExist(Storage storage)
        {
            Exist exist = new Exist();

            exist.IO_Id    = storage.IO_Id;
            exist.Count    = storage.Count;
            exist.IntoDate = DateTime.Now;
            exist.Co_id    = storage.Co_id;

            OutIntoWareBusinessLayer outIntoWareBusinessLayer = new OutIntoWareBusinessLayer();
            Out_Into_ware            out_Into_Ware            = outIntoWareBusinessLayer.GetOut_Into_ware(storage.IO_Id);

            exist.W_id = out_Into_Ware.Ware_id;
            exist.U_id = out_Into_Ware.User_id;
            return(exist);
        }
        protected async Task SignUpAsync()
        {
            this.IsExists     = false;
            this.IsInProgress = true;

            Exist exist = await this.userProvider.IsUserExistAsync(signUpViewModel.Email, cancellationTokenSource.Token);

            if (Exist.Yes == exist)
            {
                this.IsExists = true;
            }
            else if (Exist.Failed == exist)
            {
                this.IsSuccess = false;
            }
            else
            {
                signUpViewModel = new SignUpViewModel
                {
                    FullName = signUpViewModel.FullName.Trim(),
                    Email    = signUpViewModel.Email.ToLower().Trim(),
                    Gender   = signUpViewModel.Gender.Trim(),
                    Password = signUpViewModel.Password.Trim()
                };

                status = await this.userProvider.SignUpAsync(signUpViewModel, cancellationTokenSource.Token);

                this.IsSuccess = SignUpStatus.Success == status;

                if (this.IsSuccess)
                {
                    this.navigationManager.NavigateTo($"{LocalUrl.SignIn}", true);
                }
            }

            this.IsInProgress = false;
        }
Exemple #13
0
 public override string ToString()
 {
     return($"{Name}: {(ShouldHaveValue ? Value : Exist.ToString())}");
 }
Exemple #14
0
        static void Main(string[] args)
        {
            ReturnAnswer returnAnswer = new ReturnAnswer();

            //Initialize connection
            bool tmp = true;

            Console.WriteLine("IP:");
            Connection connection = new Connection();

            while (tmp)
            {
                var IP = Console.ReadLine();
                try
                {
                    connection.init(IP, 8001, returnAnswer);
                    tmp = false;
                }
                catch (Exception)
                {
                    Console.WriteLine("Wrong IP!");
                }
            }

            //Initailize commands
            Command create          = new Create(connection, returnAnswer);
            Command sendupdate      = new SendUpdate(connection, returnAnswer);
            Command reciveupdate    = new ReciveUpdate(connection, returnAnswer);
            Command getlastimage    = new GetLastImage(connection, returnAnswer);
            Command checktopicality = new CheckTopicality(connection, returnAnswer);
            Command getlastest      = new GetLastest(connection, returnAnswer);
            Command list            = new List(connection, returnAnswer);
            Command checkmemory     = new CheckMemory(connection, returnAnswer);
            Command exist           = new Exist(connection, returnAnswer);
            Command sendlogs        = new SendLogs(connection, returnAnswer);
            Command set             = new Set(connection, returnAnswer);
            Command checksettings   = new CheckSettings(connection, returnAnswer);
            Command recivesettings  = new ReciveSettings(connection, returnAnswer);

            //Make a one-way list
            create.SetNext(sendupdate);
            sendupdate.SetNext(reciveupdate);
            reciveupdate.SetNext(getlastimage);
            getlastimage.SetNext(checktopicality);
            checktopicality.SetNext(getlastest);
            getlastest.SetNext(list);
            list.SetNext(checkmemory);
            checkmemory.SetNext(exist);
            exist.SetNext(sendlogs);
            sendlogs.SetNext(set);
            set.SetNext(checksettings);
            checksettings.SetNext(recivesettings);

            string insert;


            do
            {
                connection.Connect();
                insert = connection.Recive();
                Console.WriteLine(insert);
                create.Next(insert);
            } while (insert != "exit");
        }
        protected override void Execute(NativeActivityContext context)
        {
            // получим все параметры
            var teCode = TeCode.Get(context);

            // переведем код ТЕ в верхний регистр
            if (!string.IsNullOrEmpty(teCode))
            {
                teCode = teCode.ToUpper();
            }
            var placeCode  = PlaceCode.Get(context);
            var isPack     = IsPack.Get(context);
            var length     = Length.Get(context);
            var width      = Width.Get(context);
            var height     = Height.Get(context);
            var tareWeight = TareWeight.Get(context);
            var weight     = Weight.Get(context);
            var mandants   = Mandants.Get(context);
            var teTypeCode = TeTypeCode.Get(context);
            var autoTeType = AutoTeType.Get(context);
            var extFilter  = Filter.Get(context);

            _fontSize = FontSize.Get(context);
            var suspendNotifyCollectionChanged = SuspendNotifyCollectionChanged.Get(context);

            var teManager = IoC.Instance.Resolve <IBaseManager <TE> >();

            try
            {
                if (suspendNotifyCollectionChanged)
                {
                    teManager.SuspendNotifications();
                }

                // если поле тип ТЕ пустое и не стоит признак пытаться определить тип ТЕ автоматически
                if (string.IsNullOrEmpty(teTypeCode) && !autoTeType)
                {
                    throw new OperationException("Не указан тип ТЕ");
                }

                // если поле тип ТЕ заполнено и установлен признак получения автоматически
                if (!string.IsNullOrEmpty(teTypeCode) && autoTeType)
                {
                    throw new OperationException("Неверные настройки получения типа ТЕ");
                }

                var uw = BeginTransactionActivity.GetUnitOfWork(context);
                if (uw != null)
                {
                    throw new OperationException("Действие в транзакции запрещено");
                }

                // проверим существование ТЕ
                if (!string.IsNullOrEmpty(teCode))
                {
                    var bpManager = IoC.Instance.Resolve <IBPProcessManager>();
                    var existTe   = bpManager.CheckInstanceEntity("TE", teCode);
                    if (existTe == 1)
                    {
                        var existTeObj = teManager.Get(teCode);
                        if (existTeObj == null)
                        {
                            throw new OperationException("Нет прав на ТЕ с кодом {0}", teCode);
                        }
                        ExceptionResult.Set(context, null);
                        TeCode.Set(context, teCode);
                        OutTe.Set(context, existTeObj);
                        Exist.Set(context, true);
                        Result.Set(context, true);
                        return;
                    }
                }

                // фильтр на тип ТЕ
                var filter = string.Empty;
                // фильтр по мандантам
                if (!string.IsNullOrEmpty(mandants))
                {
                    filter = string.Format(
                        "tetypecode in (select tt2m.tetypecode_r from wmstetype2mandant tt2m where tt2m.partnerid_r in ({0}))",
                        mandants);
                }

                // фильтр по упаковкам
                if (isPack)
                {
                    filter =
                        string.Format(
                            "{0}tetypecode in (select CUSTOMPARAMVAL.cpvkey from wmscustomparamvalue CUSTOMPARAMVAL  where CUSTOMPARAMVAL.CPV2ENTITY = 'TETYPE' and CUSTOMPARAMVAL.CUSTOMPARAMCODE_R = 'TETypeIsPackingL2' and CUSTOMPARAMVAL.CPVVALUE is not null and CUSTOMPARAMVAL.CPVVALUE != '0')",
                            string.IsNullOrEmpty(filter) ? string.Empty : filter + " and ");
                }

                // дополнительный фильтр по типам ТЕ
                if (!string.IsNullOrEmpty(extFilter))
                {
                    filter =
                        string.Format(
                            "{0}{1}",
                            string.IsNullOrEmpty(filter) ? string.Empty : filter + " and ", extFilter);
                }

                // если надо определить тип ТЕ автоматически
                if (autoTeType)
                {
                    teTypeCode = BPH.DetermineTeTypeCodeByTeCode(teCode, filter);
                }

                var teTypeObj = GetTeType(teTypeCode, filter);

                // если не выбрали тип ТЕ
                if (teTypeObj == null)
                {
                    ExceptionResult.Set(context, null);
                    TeCode.Set(context, teCode);
                    OutTe.Set(context, null);
                    Exist.Set(context, false);
                    Result.Set(context, false);
                    return;
                }

                var teObj = new TE();
                teObj.SetKey(teCode);
                teObj.SetProperty(TE.TETypeCodePropertyName, teTypeObj.GetKey());
                teObj.SetProperty(TE.CreatePlacePropertyName, placeCode);
                teObj.SetProperty(TE.CurrentPlacePropertyName, placeCode);
                teObj.SetProperty(TE.StatusCodePropertyName, TEStates.TE_FREE.ToString());
                teObj.SetProperty(TE.TEPackStatusPropertyName,
                                  isPack ? TEPackStatus.TE_PKG_CREATED.ToString() : TEPackStatus.TE_PKG_NONE.ToString());

                teObj.SetProperty(TE.TELengthPropertyName, length ?? teTypeObj.GetProperty(TEType.LengthPropertyName));
                teObj.SetProperty(TE.TEWidthPropertyName, width ?? teTypeObj.GetProperty(TEType.WidthPropertyName));
                teObj.SetProperty(TE.TEHeightPropertyName, height ?? teTypeObj.GetProperty(TEType.HeightPropertyName));
                teObj.SetProperty(TE.TETareWeightPropertyName,
                                  tareWeight ?? teTypeObj.GetProperty(TEType.TareWeightPropertyName));
                teObj.SetProperty(TE.TEMaxWeightPropertyName,
                                  tareWeight ?? teTypeObj.GetProperty(TEType.MaxWeightPropertyName));
                teObj.SetProperty(TE.TEWeightPropertyName,
                                  weight ?? teTypeObj.GetProperty(TEType.TareWeightPropertyName));

                ((ISecurityAccess)teManager).SuspendRightChecking();
                teManager.Insert(ref teObj);

                ExceptionResult.Set(context, null);
                TeCode.Set(context, teCode);
                OutTe.Set(context, teObj);
                Exist.Set(context, false);
                Result.Set(context, true);
            }
            catch (Exception ex)
            {
                TeCode.Set(context, teCode);
                ExceptionResult.Set(context, ex);
                OutTe.Set(context, null);
                Exist.Set(context, false);
                Result.Set(context, false);
            }
            finally
            {
                if (suspendNotifyCollectionChanged)
                {
                    teManager.ResumeNotifications();
                }
                ((ISecurityAccess)teManager).ResumeRightChecking();
            }
        }
Exemple #16
0
 private static string GetMessage(Exist exist, string language)
 {
     return GetMessage(exist.ToString(), language);
 }
Exemple #17
0
 public static string GetMessage(DataTypeNumber dataTypeNumber, Exist exist, string language, string arg2)
 {
     return string.Format(GetMessageTemplate(MessageTemplate.DataType_Exist, language),
                          GetMessage(dataTypeNumber, language),
                          GetMessage(exist, language), arg2);
 }
Exemple #18
0
 public static string GetMessage(DataTypeNumber dataTypeNumber, Exist exist, string language, string arg2)
 {
     return(string.Format(GetMessageTemplate(MessageTemplate.DataType_Exist, language),
                          GetMessage(dataTypeNumber, language),
                          GetMessage(exist, language), arg2));
 }
Exemple #19
0
 private static string GetMessage(Exist exist, string language)
 {
     return(GetMessage(exist.ToString(), language));
 }