當前位置: 首頁>>代碼示例>>C#>>正文


C# AppObjects.Identification類代碼示例

本文整理匯總了C#中ServiceHost.Contracts.Linked.AppObjects.Identification的典型用法代碼示例。如果您正苦於以下問題:C# Identification類的具體用法?C# Identification怎麽用?C# Identification使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Identification類屬於ServiceHost.Contracts.Linked.AppObjects命名空間,在下文中一共展示了Identification類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SendAll

 public Task SendAll(BroadcastMessage message, Identification identification)
 {
     // Call the addMessage method on all clients
     message.UserName = identification.Username;
     message.When = DateTime.Now;
     return Clients.All.Broadcast(message);
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:7,代碼來源:MessageHub.cs

示例2: BeginGetUser

 public IAsyncResult BeginGetUser(int id, Identification identification, AsyncCallback callback, object state)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     if (AppLib.VerifyToken(identification.Token) <= 0) {
         throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
     }
     var task = Task<User>.Factory.StartNew(process => DoGetUser(id), state);
     return task.ContinueWith(res => callback(task));
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:9,代碼來源:UserService.cs

示例3: BeginGetBusinessClosedDays

 public IAsyncResult BeginGetBusinessClosedDays(Identification identification, DateTime startDate, DateTime endDate, AsyncCallback callback, object state)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     if (AppLib.VerifyToken(identification.Token) <= 0) {
         throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
     }
     var task = Task<SmartCollection<BusinessClosedDay>>.Factory.StartNew(process => DoGetBusinessClosedDays(identification, startDate, endDate), state);
     return task.ContinueWith(res => callback(task));
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:9,代碼來源:SystemService.cs

示例4: BeginGetAnalytes

 public IAsyncResult BeginGetAnalytes(bool addAny, bool includeInActive, Identification identification, AsyncCallback callback, object state)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     if (AppLib.VerifyToken(identification.Token) <= 0) {
         throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
     }
     var task = Task<SmartCollection<Analyte>>.Factory.StartNew(process => DoGetAnalytes(addAny, includeInActive, identification), state);
     return task.ContinueWith(res => callback(task));
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:9,代碼來源:SystemService.cs

示例5: BeginGetInventoryItem

        public IAsyncResult BeginGetInventoryItem(int id, Identification identification, AsyncCallback callback, object state)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
            if (AppLib.VerifyToken(identification.Token) <= 0)
                throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));

            if (!AppLib.IsAuthorized(identification, ModuleNames.Inventory.ToString()))
                throw new FaultException<ServiceFault>(new ServiceFault("User account is not Authorized.", "Authorization"), new FaultReason("Restricted"));

            var task = Task<InventoryItem>.Factory.StartNew(process => DoGetInventoryItem(id, identification.Token), state);
            return task.ContinueWith(res => callback(task));
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:12,代碼來源:InventoryService.cs

示例6: BeginGetChangeHistory

        public IAsyncResult BeginGetChangeHistory(string moduleName, int rootModelKey, Identification identification, AsyncCallback callback, object state)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
            if (AppLib.VerifyToken(identification.Token) <= 0) throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));

            //if (!AppLib.IsAuthorized(identification, SysLib.GetOptionName(ModuleNames.Orders, ModelNamesEnum.SampleTest, ModuleAction.Create, ModuleAction.Report)))
            //    throw new FaultException<ServiceFault>(new ServiceFault("User account is not Authorized.", "Authorization"), new FaultReason("Restricted"));

            // TODO: if isauthorized

            var task = Task<SmartCollection<AuditedModelValue>>.Factory.StartNew(process => DoGetChangeHistory(moduleName, rootModelKey, identification), state);
            return task.ContinueWith(res => callback(task));
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:13,代碼來源:SystemService.cs

示例7: BeginGetUsers

        public IAsyncResult BeginGetUsers(string searchString, Identification identification, AsyncCallback callback, object state)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
            // JSON POST Sample = {"searchString":"Test","searchFields":["FirstName"]}

            if (AppLib.VerifyToken(identification.Token) <= 0)
            {
                throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
            }

            var task = Task<SmartCollection<User>>.Factory.StartNew(process => DoGetUsers(searchString), state);
            return task.ContinueWith(res => callback(task));
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:13,代碼來源:UserService.cs

示例8: BeginCancelSample

        public IAsyncResult BeginCancelSample(int arlNumber, SampleNote note, Identification identification, AsyncCallback callback, object state)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
            identification.UserId = AppLib.VerifyToken(identification.Token);
            if (identification.UserId <= 0) {
                throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
            }

            if (!AppLib.IsAuthorized(identification, SysLib.GetOptionName(ModuleNames.Samples, ModelNamesEnum.Sample, ModuleAction.Cancel)))
                throw new FaultException<ServiceFault>(new ServiceFault("User account is not Authorized.", "Authorization"), new FaultReason("Restricted"));

            var task = Task<int>.Factory.StartNew(process => DoCancelSample(arlNumber, note, identification), state);
            return task.ContinueWith(res => callback(task));
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:14,代碼來源:SampleService.cs

示例9: GetClientComplaintsOpenCount

        private string GetClientComplaintsOpenCount(ref MsSqlPersistence dbConnection, ref SqlCommand dbCommand, Identification identification)
        {
            try
            {
                bool canApproveComplaints = AppLib.IsAuthorized(identification, SysLib.GetOptionName(ModuleNames.Clients, ModelNamesEnum.Complaint, ModuleAction.Approve));

                int returnValue = 0;

                dbCommand.CommandType = CommandType.StoredProcedure;
                dbCommand.CommandText = "uspGetClientComplaintsOpenCount";
                dbCommand.Parameters.Clear();
                dbCommand.Parameters.Add("@UserId", System.Data.SqlDbType.Int).Value = identification.UserId;
                returnValue = (int)dbConnection.ExecuteScalar(dbCommand);
                return returnValue <= 0 ? string.Empty : returnValue.ToString();
            }
            catch
            {
                throw;
            }
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:20,代碼來源:ClientDAO.cs

示例10: SaveClientComplaint

        public int SaveClientComplaint(ref MsSqlPersistence dbConnection, ref SqlCommand dbCommand, ClientComplaint complaint, Identification identification)
        {
            try
            {
                int returnValue = 0;
                if (complaint.IsDirty)
                {
                    SystemDAO.SaveChangeAudit<ClientComplaint>(ref dbConnection, ref dbCommand,
                        GetClientComplaint(ref dbConnection, ref dbCommand, complaint.Pk),
                        complaint,
                        ModuleNames.Clients,
                        complaint.ClientId,
                        identification.UserId);

                    dbCommand.Parameters.Clear();
                    dbCommand.CommandType = CommandType.StoredProcedure;
                    dbCommand.CommandText = "uspUpdateClientComplaint";

                    dbCommand.Parameters.Add("@ClientComplaintId", System.Data.SqlDbType.Int).Value = complaint.ClientComplaintId;
                    dbCommand.Parameters.Add("@ClientId", System.Data.SqlDbType.Int).Value = complaint.ClientId;
                    dbCommand.Parameters.Add("@ClassificationId", System.Data.SqlDbType.Int).Value = complaint.ClassificationId;
                    dbCommand.Parameters.Add("@StatusYN", System.Data.SqlDbType.Int).Value = (bool)complaint.StatusYN;
                    dbCommand.Parameters.Add("@Description", System.Data.SqlDbType.NVarChar, 100).Value = complaint.Description;
                    dbCommand.Parameters.Add("@ARLNumber", System.Data.SqlDbType.NVarChar, 100).Value = complaint.ARLNumber;
                    dbCommand.Parameters.Add("@RootCause", System.Data.SqlDbType.NVarChar, 100).Value = complaint.RootCause;
                    dbCommand.Parameters.Add("@NotifyUserId", System.Data.SqlDbType.Int).Value = complaint.NotifyUserId;
                    dbCommand.Parameters.Add("@CorrectiveAction", System.Data.SqlDbType.NVarChar, 100).Value = complaint.CorrectiveAction;
                    dbCommand.Parameters.Add("@CorrectiveActionDate", System.Data.SqlDbType.DateTime).Value = DateTime.Now;
                    dbCommand.Parameters.Add("@CorrectiveActionUserId", System.Data.SqlDbType.Int).Value = complaint.CorrectiveActionUserId;
                    dbCommand.Parameters.Add("@ModifiedDate", System.Data.SqlDbType.DateTime).Value = complaint.CorrectiveActionDate != null ? (SqlDateTime)complaint.CorrectiveActionDate : SqlDateTime.Null;
                    dbCommand.Parameters.Add("@ModifiedBy", System.Data.SqlDbType.Int).Value = identification.UserId;
                    returnValue += dbConnection.ExecuteCommand(dbCommand);
                }
                return returnValue;
            }
            catch
            {
                throw;
            }
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:40,代碼來源:ClientDAO.cs

示例11: DoCreateMultiSampleInvoice

        public string DoCreateMultiSampleInvoice(string arlNumbers, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO())
            {
                return dao.CreateMultiSampleInvoice(arlNumbers, identification);
            }
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:9,代碼來源:SampleService.cs

示例12: DoSaveUser

        public int DoSaveUser(User user, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            //Validate Object
            if (!user.ValidateModel())
                throw new FaultException<ServiceFault>(new ServiceFault(user.CurrentErrors), new FaultReason(SysVars.InvalidFormat));

            if (user.UserId == null) {
                using (UserDAO dao = new UserDAO()) {
                    if (dao.IsDuplicateUserName(user.Username))
                        throw new FaultException<ServiceFault>(new ServiceFault("Duplicate User Name", "Rejected"), new FaultReason("Duplicate User Name Found."));
                }
            }
            using (UserDAO dao = new UserDAO()) {
                return dao.SaveUser(user, identification.Token, identification.UserId);
            }
        }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:18,代碼來源:UserService.cs

示例13: DoRemoveInventoryItemNote

 public int DoRemoveInventoryItemNote(int id, Identification identification)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     using (InventoryDAO dao = new InventoryDAO())
     {
         return dao.RemoveInventoryNote(id, identification.UserId);
     }
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:8,代碼來源:InventoryService.cs

示例14: DoRemoveUser

 public int DoRemoveUser(int id, Identification identification)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     using (UserDAO dao = new UserDAO()) {
         return dao.RemoveUser(id, identification.UserId);
     }
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:7,代碼來源:UserService.cs

示例15: BeginSearchInventory

 public IAsyncResult BeginSearchInventory(string searchString, Collection<SearchItem> searchItems, Identification identification, AsyncCallback callback, object state)
 {
     logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));
     if (AppLib.VerifyToken(identification.Token) <= 0)
     {
         throw new FaultException<ServiceFault>(new ServiceFault("Invalid Authentication", "Authorization"), new FaultReason("Unauthorized"));
     }
     var task = Task<SmartCollection<InventoryItem>>.Factory.StartNew(process => DoSearchInventory(searchString, searchItems, identification), state);
     return task.ContinueWith(res => callback(task));
 }
開發者ID:jserna-arl,項目名稱:LIMSv2,代碼行數:10,代碼來源:InventoryService.cs


注:本文中的ServiceHost.Contracts.Linked.AppObjects.Identification類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。