Exemplo n.º 1
0
        public static Socket Accept(Socket listeningSocket, int acceptTimeout)
        {
            AcceptParams acceptParams = new AcceptParams(listeningSocket, acceptTimeout);

            Thread acceptingThread = new Thread(new ParameterizedThreadStart(AcceptThread));
            acceptingThread.Start(acceptParams);

            acceptingThread.Join();

            return acceptParams.AcceptedSocket;
        }
Exemplo n.º 2
0
 private async Task AcceptLaw(AcceptParams acceptParams)
 {
     await connection.ExecuteAsync(QueryConstants.ACCEPT_BRR_LSBM_SQL_QUERY,
                                   new
     {
         acceptParams.LawId,
         acceptParams.SectionId,
         acceptParams.ApproverId,
         StatusId        = 3,
         IsCurrentStatus = 1,
         acceptParams.CreatedBy,
         acceptParams.LawDetailId,
         TabIndex = 0,
         Step     = 0,
         acceptParams.UserId,
         companyProcessId = acceptParams.CompanyProcessId,
         acceptParams.Flag
     }).ConfigureAwait(false);
 }
Exemplo n.º 3
0
        private async Task AcceptSectionOfLaw(AcceptBusinessRequirement accept, IEnumerable <int> companyProcessId, int sectionId)
        {
            foreach (var item in companyProcessId)
            {
                var chkexst = await CheckExistanceInLawStatusBusinessModule(sectionId, item);

                if (!chkexst)
                {
                    AcceptParams acceptParams = new AcceptParams
                    {
                        SectionId        = sectionId,
                        CreatedBy        = accept.UserName,
                        LawDetailId      = accept.LawDetailId,
                        CompanyProcessId = item,
                        Flag             = (int)accept.Flag,
                        UserId           = accept.UserId
                    };
                    await AcceptLaw(acceptParams);
                }
            }
        }