Exemplo n.º 1
0
 private async void InitializeRequestList()
 {
     foreach (Request r in await DataTransferUtility.GetRequests())
     {
         RequestList.Add(r);
     }
 }
Exemplo n.º 2
0
        public IActionResult requestList()
        {
            string        connectionString = configuration.GetConnectionString("DefaultConnectionString");
            SqlConnection connection       = new SqlConnection(connectionString);

            connection.Open();
            string     nm    = HttpContext.Session.GetString("driver");
            string     id    = getID();
            string     query = "select * from ticket where number_plate in (select number_plate from bus where dri_id ='" + id.ToString() + "')";
            SqlCommand com   = new SqlCommand(query, connection);

            com.CommandType = System.Data.CommandType.Text;
            SqlDataReader reader = com.ExecuteReader();
            var           model  = new List <RequestList>();

            while (reader.Read())
            {
                RequestList rq = new RequestList();
                rq.id   = reader["cusid"].ToString();
                rq.code = reader["code"].ToString();
                model.Add(rq);
            }
            connection.Close();
            return(View(model));
        }
Exemplo n.º 3
0
    private APIRequestTask RequestChatData()
    {
        APIRequestTask apirequestTask = new APIRequestTask();

        if (BlockManager.instance().blockList == null)
        {
            apirequestTask.Add(BlockManager.instance().RequestBlockList(false));
        }
        RequestList requestList = new RequestList();

        GameWebAPI.UserChatGroupList userChatGroupList = new GameWebAPI.UserChatGroupList();
        userChatGroupList.OnReceived = delegate(GameWebAPI.RespData_UserChatGroupList response)
        {
            ClassSingleton <ChatData> .Instance.CurrentChatInfo.joinGroupData = response;
        };
        RequestBase addRequest = userChatGroupList;

        requestList.AddRequest(addRequest);
        GameWebAPI.UserChatInviteListLogic userChatInviteListLogic = new GameWebAPI.UserChatInviteListLogic();
        userChatInviteListLogic.OnReceived = delegate(GameWebAPI.RespData_UserChatInviteListLogic response)
        {
            ClassSingleton <ChatData> .Instance.CurrentChatInfo.inviteGroupData = response;
        };
        addRequest = userChatInviteListLogic;
        requestList.AddRequest(addRequest);
        GameWebAPI.UserChatRequestListLogic userChatRequestListLogic = new GameWebAPI.UserChatRequestListLogic();
        userChatRequestListLogic.OnReceived = delegate(GameWebAPI.RespData_UserChatRequestList response)
        {
            ClassSingleton <ChatData> .Instance.CurrentChatInfo.requestGroupData = response;
        };
        addRequest = userChatRequestListLogic;
        requestList.AddRequest(addRequest);
        apirequestTask.Add(new APIRequestTask(requestList, false));
        return(apirequestTask);
    }
Exemplo n.º 4
0
        public ActionResult AddListRequest(int reestrId, int type)
        {
            var model   = db.RegisterOrdererViews.First(m => m.ReestrId == reestrId);
            var request = new RequestList()
            {
                Id              = Guid.NewGuid(),
                Type            = type,
                Concentration   = model.Concentration,
                MnnName         = model.MnnName,
                RegNumber       = model.RegNumber,
                AtxCode         = model.AtxCode,
                DrugForm        = model.DrugForm,
                TradeName       = model.TradeName,
                Manufacturer    = model.Manufacturer,
                Characteristic  = model.Characteristic,
                Country         = model.Country,
                Dosage          = model.Dosage,
                Measure         = model.Measure,
                ReestrId        = model.ReestrId,
                RegDate         = model.RegDate,
                RegDateExpire   = model.RegDateExpire,
                substance_count = model.substance_count?.ToString() ?? "0",
                unit_count      = model.unit_count?.ToString() ?? "0",
                dosage_comment  = model.dosage_comment
            };

            db.RequestLists.Add(request);
            db.SaveChanges();
            return(Json(request));
        }
Exemplo n.º 5
0
        private void RefreshRequest()
        {
            if (_requestService == null)
            {
                _requestService = new RequestServiceImpl.RequestService(AppSettings.DbConnection);
            }
            RequestList.Clear();
            var requests = _requestService.GetRequestList(RequestNum, FilterByCreateDate, FromDate, ToDate,
                                                          ExecuteFromDate, ExecuteToDate,
                                                          FilterStreetList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          _selectedHouse?.Id, SelectedFlat?.Id,
                                                          FilterParentServiceList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          SelectedService?.Id,
                                                          FilterStatusList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          FilterMasterList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          FilterExecuterList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          FilterServiceCompanyList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          FilterUserList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          FilterRatingList.Where(w => w.Selected).Select(x => x.Id).ToArray(),
                                                          SelectedPayment?.Id, ServiceCompanyBadWork, OnlyRetry, ClientPhone, OnlyGaranty, OnlyImmediate);

            foreach (var request in requests)
            {
                RequestList.Add(request);
            }
            RequestCount = RequestList.Count;
            OnPropertyChanged(nameof(RequestList));
        }
        public async Task SaveAsync(RequestList model)
        {
            var isFirstLoadConfig =
                _configuration["Environment:IS_FIRST_LOAD"]
                ?? Environment.GetEnvironmentVariable("IS_FIRST_LOAD")
                ?? "false";

            bool.TryParse(isFirstLoadConfig, out var isFirstLoad);

            if (isFirstLoad)
            {
                var entitiesToAdd = model.requests.ToEntities <RequestEntity, Request>();
                await _requestEntityRepository.AddManyAsync(entitiesToAdd);

                return;
            }

            var requestIds           = model.requests.Select(x => x.RequestId).ToList();
            var alreadySavedRequests =
                (await _requestEntityRepository.FindAsync(x => requestIds.Contains(x.RequestId)))
                .Select(x => (x.EntityId, x.RequestId))
                .ToDictionary(x => x.RequestId, x => x.EntityId);

            var requestsToUpdate        = model.requests.Where(x => alreadySavedRequests.Keys.Contains(x.RequestId));
            var requestEntitiesToUpdate = requestsToUpdate.ToEntities <RequestEntity, Request>();

            await UpdateAlreadySavedRequestsAsync(requestEntitiesToUpdate, alreadySavedRequests);

            var requestsToAdd        = model.requests.Where(x => !alreadySavedRequests.Keys.Contains(x.RequestId));
            var requestEntitiesToAdd = requestsToAdd.ToEntities <RequestEntity, Request>();

            await AddRequestsAsync(requestEntitiesToAdd);
        }
        private RequestList MyRequestInput()
        {
            var request = new RequestList
            {
                payload = new[] { new Payload
                                  {
                                      country      = "AUD",
                                      description  = "Test for MI9",
                                      drm          = true,
                                      episodeCount = 3,
                                      image        = new Image
                                      {
                                          showImage = "https://www.google.com.au/search?q=mi9+images&espv=2&biw=1366&bih=667&source=lnms&tbm=isch&sa=X&ei=2YWaVaaUNoee8QXl8bngDQ&ved=0CAYQ_AUoAQ&dpr=1#imgrc=Vz2XqwEL-gA6nM%3A"
                                      },
                                      language      = "English",
                                      nextEpisode   = null,
                                      primaryColour = "#1B201E",
                                      seasons       = new[] { new Season {
                                                                  slug = "testMI/Mi9/season/1"
                                                              } },
                                      slug      = "testMI/Mi9/",
                                      title     = "Mi9",
                                      tvChannel = "ABC"
                                  } }
            };

            return(request);
        }
Exemplo n.º 8
0
        async Task getAppsAsync()
        {
            if (Xamarin.Essentials.Connectivity.NetworkAccess != Xamarin.Essentials.NetworkAccess.Internet)
            {
                Device.BeginInvokeOnMainThread(async() =>
                                               await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorNoInternet, "OK"));
                return;
            }

            _requestList = await _server.GetRequestsList();

            if (_requestList.Error == null)
            {
                if (Settings.UpdateKey != _requestList.UpdateKey)
                {
                    RequestInfos = null;
                    setCloses(_requestList.Requests);
                    Settings.UpdateKey  = _requestList.UpdateKey;
                    this.BindingContext = this;
                }
            }
            else
            {
                await DisplayAlert(AppResources.ErrorTitle, AppResources.ErrorAppsInfo, "OK");
            }
        }
Exemplo n.º 9
0
        //whenever there is a request, create an event(bypass)
        protected override void ControlRequest(RequestList requestListIn)
        {
            Dictionary <Storage, BinList> eventsToCreate = new Dictionary <Storage, BinList>();
            Transporter transporter = this.Manager.LayoutManager.Layout.Transporter;

            foreach (Request request in requestListIn)
            {
                Bin bin = new Bin(request.ComponentType + "-Bin", this.Manager.LayoutManager.Layout, request.ComponentType);
                this.Manager.LayoutManager.Layout.Bins.Add(bin);
                bin.Destination = request.Owner;
                transporter.Receive(this.Manager.Time, bin);
                if (eventsToCreate.Keys.Contains(request.Owner))
                {
                    eventsToCreate[request.Owner].Add(bin);
                }
                else
                {
                    eventsToCreate.Add(request.Owner, new BinList());
                    eventsToCreate[request.Owner].Add(bin);
                }
            }

            foreach (Storage storage in eventsToCreate.Keys)
            {
                double time = this.Manager.Time;
                time += transporter.TravelTime.GenerateValue();
                for (int i = 0; i < eventsToCreate[storage].Count; i++)
                {
                    time += transporter.TransferTime.GenerateValue();
                }
                this.Manager.EventCalendar.ScheduleEndLoadUnloadEvent(time, eventsToCreate[storage], transporter, (BinMagazine)storage);
            }

            requestListIn.Clear();
        }
Exemplo n.º 10
0
        public async Task <IActionResult> Edit(int userId, int groupId, [Bind("UserId,GroupId,IsAwaiting,IsAccepted,IsDenied")] RequestList requestList)
        {
            if (userId != requestList.UserId || groupId != requestList.GroupId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _db.Update(requestList);
                    _db.Save();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RequestListExists(requestList.UserId, requestList.GroupId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GroupId"] = new SelectList(_db.GetGroupDescriptions(), "Id", "Name", requestList.GroupId);
            ViewData["UserId"]  = new SelectList(_db.GetUserDescriptions(), "Id", "Email", requestList.UserId);
            return(View(requestList));
        }
Exemplo n.º 11
0
        public void OnConnectionFinished(TcpConnection conn)
        {
            RequestList.Clear();
            ResponseList.Clear();

            // We only want http stream
            if (conn.Pair.APort != HttpStatics.Httpd_Port &&
                conn.Pair.BPort != HttpStatics.Httpd_Port)
            {
                return;
            }

            // Find client direction
            int reqDir = conn.Pair.APort == HttpStatics.Httpd_Port ? 1 : 0;
            int rpyDir = 1 - reqDir;

            // Set position to begin to all streams, in case they are not there.
            for (int i = 0; i != 2; i++)
            {
                conn.Stream(i).Data.Seek(0, SeekOrigin.Begin);
            }

            FindRequests(conn, reqDir);
            FindResponses(conn, rpyDir);
        }
Exemplo n.º 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         List <RequestEntity> requests = null;
         string        conString       = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
         SqlConnection con             = new SqlConnection(conString);
         SqlCommand    com             = new SqlCommand("SELECT i2.ItemId MyItemId, i2.ItemName MyItemName, i2.ItemDesc MyItemDesc, i2.ContentType MyContentType, i2.Image MyImage, i2.Category MyCategory, i2.UserId MyUserId, " +
                                                        "i.ItemId, i.ItemName, i.ItemDesc, i.ContentType, i.Image, i.Category, i.UserId, r.RequestId, 0 As IsMyRequest, 'MyRequest' AS CssClass " +
                                                        "FROM ExchangeDB..Request r " +
                                                        "JOIN ExchangeDB..Item i ON r.RequesterItemId = i.ItemId " +
                                                        "JOIN ExchangeDB..Item i2 ON r.ItemId = i2.ItemId " +
                                                        "WHERE i2.UserId = @UserId AND r.RequestComplete = 0 " +
                                                        "UNION ALL " +
                                                        "SELECT i.ItemId MyItemId, i.ItemName MyItemName, i.ItemDesc MyItemDesc, i.ContentType MyContentType, i.Image MyImage, i.Category MyCategory, i.UserId MyUserId, " +
                                                        "i2.ItemId, i2.ItemName, i2.ItemDesc, i2.ContentType, i2.Image, i2.Category, i2.UserId, r.RequestId, 1 As IsMyRequest, 'Requested' AS CssClass " +
                                                        "FROM ExchangeDB..Request r " +
                                                        "JOIN ExchangeDB..Item i ON r.RequesterItemId = i.ItemId " +
                                                        "JOIN ExchangeDB..Item i2 ON r.ItemId = i2.ItemId " +
                                                        "WHERE i.UserId = @UserId AND r.RequestComplete = 0", con);
         com.Parameters.Add("@UserId", SqlDbType.Int).Value = Session["UserId"] == null ? 0 : Convert.ToInt32(Session["UserId"]);
         con.Open();
         var lDataAdapter = new SqlDataAdapter(com);
         var lDataSet     = new DataSet();
         lDataAdapter.Fill(lDataSet);
         if (lDataSet.Tables[0].Rows.Count != 0)
         {
             requests = lDataSet.Tables[0].AsEnumerable().Select(row => new RequestEntity(row)).ToList();
         }
         con.Close();
         RequestList.DataSource = requests;
         RequestList.DataBind();
     }
 }
Exemplo n.º 13
0
        public ICollection <RequestDTO> GetAllRequestsByStatusfromDB(int status)
        {
            ICollection <RequestDTO> outputList = default(ICollection <RequestDTO>);

            try
            {
                // 1- Select All Groups From DB
                RequestBusiness _RequestBusiness = new RequestBusiness();
                //RequestList _RequestList = _RequestBusiness.SelectRows(null, null, null, null, null, null, null, null,
                //    null, null, null, null, null, null, null, null);

                RequestList _RequestList = _RequestBusiness.SelectRows(null, null, null, null, null, null, null, null, null,
                                                                       null, null, null, null, status, null, null);

                if (_RequestList != null && _RequestList.Count > 0)
                //outputList = Mapper.MapUserAsOutput();
                {
                    // 2- Prepare Mapping Obects (Fill Values from DB)

                    //if(Mapper._RequestTypeList == default(List<RequestType>)) ==> In case we try to save DB hits (we apply that check for all lists)
                    //Mapper._RequestTypeList = fillRequestTypeList();

                    Mapper._RequestList         = _RequestList;
                    Mapper._RequestDetailList   = fillRequestDetailListbyRequestStatus(Mapper._RequestList);
                    Mapper._RequestTypeList     = fillRequestTypeList();
                    Mapper._RequestStatusList   = fillRequestStatusList();
                    Mapper._RequestClassList    = fillRequestClassList();
                    Mapper._RequestPriorityList = fillRequestPriorityList();
                    Mapper._RejectReasonList    = fillRejectReasonList();
                    Mapper._CardTypeList        = fillCardTypeList();
                    Mapper._CardValidityList    = fillCardValidityList();
                    Mapper._WorkFieldList       = fillWorkFieldList();
                    Mapper._CustomerList        = fillCustomerList();
                    Mapper._UserList            = fillUserList();

                    //UserGroupBusiness _UserGroupBusiness = new UserGroupBusiness();
                    //UserGroupList _UserGroupList = default(UserGroupList);

                    //foreach (User _User in _UserList)
                    //{
                    //    _UserGroupList = _UserGroupBusiness.SelectRows(null, _User.Id, null);

                    //    if (_UserGroupList != null && _UserGroupList.Count > 0)
                    //        foreach (UserGroup _UserGroup in _UserGroupList)
                    //            Mapper._UserGroupList.Add(Copier.copyUserGroup(_UserGroup));
                    //}


                    // 3- Perform Mapping to Output
                    outputList = Mapper.MapRequestAsOutput();
                }
            }
            catch (Exception ex)
            {
                // Log Exception Here
                throw; //new Exception(ex.Message);
            }

            return(outputList);
        }
Exemplo n.º 14
0
        private void BT_Request_Click(object sender, EventArgs e)
        {
            //KaEvent[] kaEvents = new KaEvent[3];

            //for (int i = 0; i < 3; i++)
            //{
            //    kaEvents[i] = new KaEvent();
            //    kaEvents[i].Titel = "Titel" + i;
            //    kaEvents[i].Beginn = DateTime.Now;
            //    kaEvents[i].Ende = DateTime.Now;
            //    kaEvents[i].Ort = "Ort" + i;
            //    kaEvents[i].owner = new User("Name " + i, "Password");
            //}

            //kaEvents[2].members = new List<string>();
            //kaEvents[2].members.Add("asd");

            using (var form = new RequestList(invites, clientLogic.GetUser()))
            {
                var result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                }
                else
                {
                }
                foreach (KaEvent ka in form.returnValue)
                {
                    kaEvents.Add(ka);
                }
            }
        }
Exemplo n.º 15
0
    // Returns all items in the Request table and fill it in a RequestList
    public static RequestList GetList()
    {
        RequestList tempList = new RequestList();

        using (SqlConnection myConnection = new SqlConnection(AppConfiguration.SqlConnectionString))
        {
            using (SqlCommand myCommand = new SqlCommand("sprocRequestSelectList", myConnection))
            {
                myCommand.CommandType = CommandType.StoredProcedure;
                myConnection.Open();
                using (SqlDataReader myReader = myCommand.ExecuteReader())
                {
                    if (myReader.HasRows)
                    {
                        tempList = new RequestList();
                        while (myReader.Read())
                        {
                            tempList.Add(FillDataRecord(myReader));
                        }
                    }
                    myReader.Close();
                }
            }
        }
        return(tempList);
    }
        public int SaveRows(DbTransaction pTran, RequestList RequestList, bool CreateTransaction)
        {
            int           intRows   = 0;
            DbTransaction objTran   = pTran;
            Exception     exception = null;

            try
            {
                if (pTran == null && CreateTransaction == true)
                {
                    objTran = RequestData.CreateTransaction();
                }
                intRows = RequestData.SaveRows(objTran, RequestList);
                if (pTran == null && objTran != null && CreateTransaction == true)
                {
                    RequestData.CommitTransaction(objTran, true);
                    objTran = null;
                }
            }
            catch (Exception EX)
            {
                exception = EX;
                if (pTran == null && objTran != null && CreateTransaction == true)
                {
                    RequestData.RollbackTransaction(objTran, true);
                    objTran = null;
                }
            }
            finally
            {
            }
            return(intRows);
        }
Exemplo n.º 17
0
    public APIRequestTask RequestFriendData(bool requestRetry = true)
    {
        RequestList requestList = new RequestList();

        GameWebAPI.RequestFR_FriendList requestFR_FriendList = new GameWebAPI.RequestFR_FriendList();
        requestFR_FriendList.OnReceived = delegate(GameWebAPI.RespDataFR_FriendList response)
        {
            DataMng.Instance().RespDataFR_FriendList = response;
        };
        RequestBase addRequest = requestFR_FriendList;

        requestList.AddRequest(addRequest);
        GameWebAPI.RequestFR_FriendApplicationList requestFR_FriendApplicationList = new GameWebAPI.RequestFR_FriendApplicationList();
        requestFR_FriendApplicationList.OnReceived = delegate(GameWebAPI.RespDataFR_FriendRequestList response)
        {
            DataMng.Instance().RespDataFR_FriendRequestList = response;
        };
        addRequest = requestFR_FriendApplicationList;
        requestList.AddRequest(addRequest);
        GameWebAPI.RequestFR_FriendUnapprovedList requestFR_FriendUnapprovedList = new GameWebAPI.RequestFR_FriendUnapprovedList();
        requestFR_FriendUnapprovedList.OnReceived = delegate(GameWebAPI.RespDataFR_FriendUnapprovedList response)
        {
            DataMng.Instance().RespDataFR_FriendUnapprovedList = response;
        };
        addRequest = requestFR_FriendUnapprovedList;
        requestList.AddRequest(addRequest);
        GameWebAPI.RequestFR_FriendInfo requestFR_FriendInfo = new GameWebAPI.RequestFR_FriendInfo();
        requestFR_FriendInfo.OnReceived = delegate(GameWebAPI.RespDataFR_FriendInfo response)
        {
            DataMng.Instance().RespDataFR_FriendInfo = response;
        };
        addRequest = requestFR_FriendInfo;
        requestList.AddRequest(addRequest);
        return(new APIRequestTask(requestList, requestRetry));
    }
Exemplo n.º 18
0
        // public void ExecuteQueue(object sender, ElapsedEventArgs e)
        public void ExecuteQueue()
        {
            lock (padlock)
            {
                string   docDir     = queueDir + "\\document";
                string   requestDir = queueDir + "\\request";
                string   tempDir    = queueDir + "\\temp";
                string[] files      = Directory.GetFiles(requestDir);

                if (files.Length <= 0)
                {
                    return;
                }
                foreach (string f in files)
                {
                    Console.WriteLine("正在归档:" + f);
                    DocumentBuilder builder   = null;
                    int             tempIndex = f.LastIndexOf("\\") + 1;
                    string          tag       = f.Substring(tempIndex, f.LastIndexOf(".") - tempIndex);
                    try
                    {
                        ZipHelper.UnZip(f, tempDir + "\\" + tag);
                        FileFilter(tempDir + "\\" + tag);
                        string      docPath = docDir + "\\" + tag + ".doc";
                        string      xmlPath = tempDir + "\\" + tag + "\\request.xml";
                        RequestList list    = SerializableHelper.DeserilizeXml(xmlPath);
                        File.Delete(xmlPath);
                        builder = InvokeFrontCover(list, docPath);
                        // builder = new DocumentBuilder(docPath);

                        foreach (RequestData data in list.RequestData)
                        {
                            InvokeMethod(data, builder);
                        }
                        builder.Save();
                        builder.Quit();
                        Directory.Delete(tempDir + "\\" + tag, true);
                        SendConvertLog(tag, true, "");

                        File.Delete(f);

                        Console.WriteLine(f + " 归档成功");
                    }
                    catch (Exception ex)
                    {
                        SendConvertLog(tag, false, ex.Message);
                        File.Delete(f);
                        log.ErrorFormat("执行队列出错,异常信息: {0}", ex.Message);
                        Console.WriteLine(f + " 归档失败");
                        Console.WriteLine("执行队列出错,异常信息: {0}", ex.Message);
                        if (builder != null)
                        {
                            builder.Quit();
                            builder.KillWordProcess();
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
        private Layout.Layout layout;            //state

        public LayoutManager(string nameIn, FLOWObject parentIn)
            : base(nameIn, parentIn)
        {
            this.congestedNodes      = new NodeList();
            this.stationsToDecide    = new StationList();
            this.queuesToPull        = new QueueList(); //ie486f18
            this.requestsToReplenish = new RequestList();
        }
Exemplo n.º 20
0
        public void Remove(RequestList entity)
        {
            var temp = this._context.RequestLists.FirstOrDefault(x => x.ApiName == entity.ApiName && x.Nik == entity.Nik && x.Id == entity.Id);

            if (temp != null)
            {
                this._context.RequestLists.Remove(temp);
            }
        }
Exemplo n.º 21
0
        public void AddRequestLicense(RequestListViewModel re)
        {
            bool applied = false;
            List <CustomerInfo> listCus = ctr.LoadListObject <CustomerInfo>();

            if (re.CustomerTypeID != 1) // khách hàng lẻ
            {
                var result = listCus.FirstOrDefault(x => x.Email == re.Email);
                if (result != null)
                {
                    applied = true;
                }
                else
                {
                    applied = false;
                }
            }
            else // khách hàng côngty
            {
                var result = listCus.FirstOrDefault(x => x.CompanyCode == re.CompanyCode);
                if (result != null)
                {
                    applied = true;
                }
                else
                {
                    applied = false;
                }
            }

            try
            {
                RequestList request = new RequestList()
                {
                    CustomerName    = re.CustomerName,
                    Company         = re.Company,
                    CompanyCode     = re.CompanyCode,
                    ServerName      = re.ServerName,
                    Keys            = re.Keys.ToString(),
                    Phone           = re.Phone,
                    Fax             = re.Fax,
                    Email           = re.Email,
                    Address         = re.Address,
                    CityID          = re.CityID,
                    Country         = "Việt Nam", // tạm thời
                    ContractTypeID  = re.ContractTypeID,
                    StatusLicenseID = 1,          // Chưa cấp phép
                    CustomerTypeID  = re.CustomerTypeID,
                    CreateDate      = SystemDefine.SystemDate.Date,
                    Applied         = applied,
                };
                ctr.Insert <RequestList>(request);
            }
            catch
            {
            }
        }
Exemplo n.º 22
0
    private void Start()
    {
        timeLeft = totalTime;

        timerScaleOriginal = timer.GetComponent <RectTransform>().localScale;

        loseScreen.active = false;

        list = GetComponent <RequestList>();
    }
        public void StatusCodeBadRequest_RequestIsNull()
        {
            var         controller = MyControllerToTest();
            RequestList request    = null;
            var         status     = controller.Post(request);

            //Assert
            Assert.IsNotNull(status);
            Assert.AreEqual(status.StatusCode, HttpStatusCode.BadRequest);
        }
Exemplo n.º 24
0
        public ActionResult ListRequestDestroy([DataSourceRequest] DataSourceRequest request, RequestListView item)
        {
            if (item != null)
            {
                RequestList newItem = db.RequestLists.First(o => o.Id == item.Id);
                db.RequestLists.Remove(newItem);
                db.SaveChanges();
            }

            return(Json(new[] { item }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 25
0
        public ActionResult ListRequestUpdate([DataSourceRequest] DataSourceRequest request, RequestListView item)
        {
            if (item != null && ModelState.IsValid)
            {
                RequestList newItem = db.RequestLists.First(o => o.Id == item.Id);
                newItem.LimitPriceMnn = item.LimitPriceMnn;
                newItem.LimitPriceTn  = item.LimitPriceTn;
                db.SaveChanges();
            }

            return(Json(new[] { item }.ToDataSourceResult(request, ModelState)));
        }
Exemplo n.º 26
0
        private void RefreshRequest()
        {
            RequestList.Clear();
            var requests = _requestService.GetAlertRequestList(SelectedServiceCompany?.Id, ShowDoned).ToArray();

            foreach (var request in requests)
            {
                RequestList.Add(request);
            }
            RequestCount = RequestList.Count;
            OnPropertyChanged(nameof(RequestList));
        }
Exemplo n.º 27
0
        public ArtworkCache()
        {
            iLock = new object();

            iPendingRequests = new RequestList();
            iCacheData       = new CacheData(kMaxCacheSizeLarge);

            iThread = new Thread(ProcessRequests);
            iThread.IsBackground = true;
            iThread.Name         = "ArtworkCache";
            iThread.Start();
        }
Exemplo n.º 28
0
 public async Task <IActionResult> Create([Bind("UserId,GroupId,IsAwaiting,IsAccepting,IsDenied")] RequestList requestList)
 {
     if (ModelState.IsValid)
     {
         _db.Create(requestList);
         _db.Save();
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["GroupId"] = new SelectList(_db.GetGroupDescriptions(), "Id", "Name", requestList.GroupId);
     ViewData["UserId"]  = new SelectList(_db.GetUserDescriptions(), "Id", "Email", requestList.UserId);
     return(View(requestList));
 }
        public void ErrorMessage_BadRequestSent()
        {
            var         controller = MyControllerToTest();
            RequestList request    = null;
            var         response   = controller.Post(request);
            var         error      = (ObjectContent <Error>)response.Content;
            var         status     = ((Error)error.Value).error;

            //Assert
            Assert.IsNotNull(status);
            Assert.AreEqual(status, "Could not decode request: JSON parsing failed");
        }
Exemplo n.º 30
0
        private void PrintActs()
        {
            if (RequestList.Count == 0)
            {
                MessageBox.Show("Нельзя экспортировать пустой список!", "Ошибка");
                return;
            }
            try
            {
                var saveDialog = new SaveFileDialog();
                saveDialog.AddExtension = true;
                saveDialog.DefaultExt   = ".doc";
                saveDialog.Filter       = "Word файл|*.doc";
                if (saveDialog.ShowDialog() == true)
                {
                    var fileName = saveDialog.FileName;
                    if (fileName.EndsWith(".doc"))
                    {
                        var stiReport = new StiReport();
                        stiReport.Load("templates\\act.mrt");
                        var requestsDto = RequestList.Select(x => new
                        {
                            RequestNumber = x.Id,
                            Address       = x.FullAddress,
                            ClientName    = x.MainFio,
                            ClientPhones  = x.ContactPhones,
                            ParentService = x.ParentService,
                            Service       = x.Service,
                        }).ToArray();
                        StiOptions.Engine.HideRenderingProgress = true;
                        //StiOptions.Engine.HideExceptions = true;
                        StiOptions.Engine.HideMessages = true;


                        stiReport.RegBusinessObject("", "Acts", requestsDto);
                        stiReport.Render();
                        var reportStream = new MemoryStream();
                        stiReport.ExportDocument(StiExportFormat.Rtf, reportStream);
                        //stiReport.ExportDocument(StiExportFormat.Pdf, reportStream);
                        reportStream.Position = 0;
                        File.WriteAllBytes(fileName, reportStream.GetBuffer());

                        MessageBox.Show("Данные сохранены в файл\r\n" + fileName);
                    }
                }
            }
            catch
            (Exception exc)
            {
                MessageBox.Show("Произошла ошибка:\r\n" + exc.Message);
            }
        }
Exemplo n.º 31
0
 public GatewayRequestHandler(Machine machine) {
   this.machine = machine;
   ReDiRNode = new ReDiR(machine);
   RequestQueue = new RequestList();
   ReDiRNode.ReDiRLookupCompleted += redir_LookupCompleted;
   ReDiRNode.ReDiRLookupFailed += redir_LookupFailed;
   gateWayCache = new Dictionary<string, NodeId>();
 }