当前位置: 首页>>代码示例>>C#>>正文


C# BusinessObjects类代码示例

本文整理汇总了C#中BusinessObjects的典型用法代码示例。如果您正苦于以下问题:C# BusinessObjects类的具体用法?C# BusinessObjects怎么用?C# BusinessObjects使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BusinessObjects类属于命名空间,在下文中一共展示了BusinessObjects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EditOrCreate

        public ActionResult EditOrCreate(BusinessObjects.WorkManagement.Customer newInstance)
        {
            string userID = "SYSTEM";

            try
            {
                bool hasLocationContentChanged = false;

                if (newInstance.BillingAddress != null && newInstance.BillingAddress.ID > 0)
                {
                    string serialized = (Server.HtmlDecode(Request["originalModel"]));

                    /*
                    // Test that Request["originalModel"] is actually a serialized Location instance 
                    System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
                    xml.LoadXml(serialized);
                    BusinessObjects.WorkManagement.Location originalContent = null;
                    originalContent = (BusinessObjects.WorkManagement.Location)BusinessObjects.Base.Deserialize(typeof(BusinessObjects.WorkManagement.Location),xml);
                    */

                    hasLocationContentChanged = (serialized != newInstance.BillingAddress.Serialize());
                }

                newInstance.HasLocationChanged = hasLocationContentChanged;
                _modelContext.SaveCustomer(newInstance, userID);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
开发者ID:bedford603067,项目名称:Augment,代码行数:33,代码来源:CustomersController.cs

示例2: Create

 public int Create(BusinessObjects.User User,int isdirect=1)
 {
     int retVal = -1;
     SqlParameter sqlparm = new SqlParameter();
     sqlparm.ParameterName = "@EffectiveUserId";
     sqlparm.Direction = ParameterDirection.Output;
     sqlparm.DbType = DbType.Int32;
     List<string> outParmNames = new List<string>();
     List<SqlParameter> param = new List<SqlParameter>();
     outParmNames.Add(sqlparm.ParameterName);
     Dictionary<string, Object> dic = new Dictionary<string, Object>();
     param.Add(new SqlParameter("@UserName", User.UserLogin.UserName));
     param.Add(new SqlParameter("@Password", User.UserLogin.Password));
     param.Add(new SqlParameter("@EmailId", User.UserLogin.EmailID));
     param.Add(new SqlParameter("@AuthType", User.UserLogin.AuthType.Auth_Id));
     param.Add(sqlparm);
     dic = Execute("SP_UserLogin_Create", param.ToArray(), outParmNames);
     retVal = (int)dic[sqlparm.ParameterName];
     User.PK_User_Id = retVal;
     if (isdirect==1)
     {
         CreateUserProfile(User);
     }
     return retVal;
 }
开发者ID:bhrugu4me,项目名称:MyFan,代码行数:25,代码来源:User.cs

示例3: HandleAlarms

 protected static void HandleAlarms(string source, ref BusinessObjects.Recipe recipe)
 {
     recipe.Alarms = new List<BusinessObjects.Alarm>();
     var alarmMinEx = new Regex(".(?<text>(\\w+\\s)+)(?<minutos>\\d+)\\sminutos");
     if (alarmMinEx.IsMatch(source))
     {
         foreach (Match match in alarmMinEx.Matches(source))
         {
             var alarm = new BusinessObjects.Alarm
             {
                 Minutes = double.Parse(match.Groups["minutos"].Value),
                 Name = match.Groups["text"].Value
             };
             recipe.Alarms.Add(alarm);
         }
     }
     var alarmHourEx = new Regex(".(?<text>(\\w+\\s)+)(?<hora>\\d+)\\shora(s*)");
     if (alarmHourEx.IsMatch(source))
     {
         foreach (Match match in alarmHourEx.Matches(source))
         {
             var alarm = new BusinessObjects.Alarm
             {
                 Minutes = double.Parse(match.Groups["hora"].Value) * 60,
                 Name = match.Groups["text"].Value
             };
             recipe.Alarms.Add(alarm);
         }
     }
 }
开发者ID:pachif,项目名称:RecipeHub,代码行数:30,代码来源:ProviderBase.cs

示例4: TranslateRecipeMicrosoft

        public void TranslateRecipeMicrosoft(BusinessObjects.Recipe recipe)
        {
            CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture;
            if (!currentCulture.TwoLetterISOLanguageName.ToLowerInvariant().Equals("es"))
            {
                if (traslator == null)
                {
                    traslator = new MicrosoftTransProvider(KEY, SECRET);
                }
                string target = currentCulture.TwoLetterISOLanguageName;

                recipe.Title = traslator.Translate(HttpUtility.HtmlDecode(recipe.Title), target);
                recipe.MainIngredient = traslator.Translate(recipe.MainIngredient, target);
                recipe.Category = traslator.Translate(recipe.Category, target);

                if (!string.IsNullOrEmpty(recipe.Procedure))
                {
                    string procedure = recipe.Procedure.Replace("\r\n\r\n", " [n] ").Replace("\n                    ", " [n] ");
                    procedure = traslator.Translate(procedure, target);
                    procedure = HttpUtility.HtmlDecode(procedure);
                    recipe.Procedure = procedure.Replace("[n] ", "\n").Replace("[N] ", "\n").Replace("[ n] ", "\n").Replace("[n ] ", "\n");
                }

                if (recipe.Ingridients != null && recipe.Ingridients.Count > 0)
                {
                    recipe.Ingridients = TranslateList(traslator, recipe.Ingridients, target);
                }

                if (recipe.Alarms != null && recipe.Alarms.Count > 0)
                {
                    var list = new List<string>();
                    recipe.Alarms.ForEach(al => al.Name = traslator.Translate(al.Name, target));
                }
            }
        }
开发者ID:pachif,项目名称:RecipeHub,代码行数:35,代码来源:ProviderBase.cs

示例5: Add

        public void Add(BusinessObjects.GroupRelation entity)
        {
            //Add GroupRelation
            using (_GroupRelationRepository = new GenericRepository<DAL.DataEntities.GroupRelation>())
            {
                _GroupRelationRepository.Add((DAL.DataEntities.GroupRelation)entity.InnerEntity);
                _GroupRelationRepository.SaveChanges();
            }

            //Add GroupRelations_To_Features
            using (_GroupRelationsToFeaturesRepository = new GenericRepository<DAL.DataEntities.GroupRelation_To_Feature>())
            {

                foreach (int childFeatureID in entity.ChildFeatureIDs)
                {
                    DAL.DataEntities.GroupRelation_To_Feature grToFeature = new DAL.DataEntities.GroupRelation_To_Feature();
                    grToFeature.GroupRelationID = entity.ID;
                    grToFeature.ParentFeatureID = entity.ParentFeatureID;
                    grToFeature.ChildFeatureID = childFeatureID;

                    _GroupRelationsToFeaturesRepository.Add(grToFeature);
                }

                _GroupRelationsToFeaturesRepository.SaveChanges();
            }
        }
开发者ID:dswingle,项目名称:openconfigurator,代码行数:26,代码来源:GroupRelationService.cs

示例6: CreateUserProfile

        public long CreateUserProfile(BusinessObjects.User User)
        {
            long flg = 0;
            List<SqlParameter> param1 = new List<SqlParameter>();
            Dictionary<string, Object> dic1 = new Dictionary<string, Object>();
            param1.Add(new SqlParameter("@PK_User_Id", User.PK_User_Id));
            param1.Add(new SqlParameter("@FK_Utype_Id", User.UserType.PK_UserType_Id));
            param1.Add(new SqlParameter("@LastName", User.LastName));
            param1.Add(new SqlParameter("@FirstName", User.FirstName));
            param1.Add(new SqlParameter("@BirthDate", User.Birthdate));
            param1.Add(new SqlParameter("@Age", User.Age));
            param1.Add(new SqlParameter("@Gender", User.Gender));
            param1.Add(new SqlParameter("@UserEmpType", User.UserEmpType));
            param1.Add(new SqlParameter("@Education", User.Education));
            param1.Add(new SqlParameter("@Occupation", User.Occupation));
            param1.Add(new SqlParameter("@MaritalStatus", User.MaritalStatus));
            param1.Add(new SqlParameter("@City", User.City));
            param1.Add(new SqlParameter("@State", User.State));
            param1.Add(new SqlParameter("@Country", User.Country));
            param1.Add(new SqlParameter("@Area", User.Area));
            param1.Add(new SqlParameter("@IsOther", User.IsOther));
            param1.Add(new SqlParameter("@OtherLocation", User.OtherLocation));
            param1.Add(new SqlParameter("@ZipCode", User.ZipCode));
            param1.Add(new SqlParameter("@Mobile1", User.Mobile1));
            param1.Add(new SqlParameter("@Mobile2", User.Mobile2));
            param1.Add(new SqlParameter("@Fax", User.Fax));
            param1.Add(new SqlParameter("@IsVerified", User.IsVerified));
            param1.Add(new SqlParameter("@RequestorId", User.Updated_By));

            flg = Execute("SP_User_Create", param1.ToArray());
            return flg;
        }
开发者ID:bhrugu4me,项目名称:MyFan,代码行数:32,代码来源:User.cs

示例7: UpdateEmployee

        public void UpdateEmployee(BusinessObjects.Employee e)
        {
            var updatedEmployee = 
                employeeAdapter.UpdateEmployeePerson(e.JobTitle, e.BusinessEntityId, e.FirstName, e.MiddleName, e.LastName);

            throw new NotImplementedException();
        }
开发者ID:MatthewMcGowan,项目名称:AdventureWorks.Api,代码行数:7,代码来源:EmployeeDA.cs

示例8: Add

        public void Add(BusinessObjects.FeatureSelection entity)
        {
            using (_FeatureSelectionRepository = new GenericRepository<DAL.DataEntities.FeatureSelection>())
            {
                //Add the FeatureSelection
                _FeatureSelectionRepository.Add((DAL.DataEntities.FeatureSelection)entity.InnerEntity);
                _FeatureSelectionRepository.SaveChanges();

                //Add AttributeValues
                using (_AttributeValuesRepository = new GenericRepository<DAL.DataEntities.AttributeValue>())
                {
                    for (int i = entity.AttributeValues.Count - 1; i >= 0; i--)
                    {
                        BLL.BusinessObjects.AttributeValue BLLAttributeValue = entity.AttributeValues[i];
                        BLLAttributeValue.FeatureSelectionID = entity.ID;

                        //Add
                        if (BLLAttributeValue.ToBeDeleted == false && BLLAttributeValue.ID == 0)
                        {
                            _AttributeValuesRepository.Add((DAL.DataEntities.AttributeValue)BLLAttributeValue.InnerEntity);
                        }
                    }
                    _AttributeValuesRepository.SaveChanges();
                }
            }
        }
开发者ID:dswingle,项目名称:openconfigurator,代码行数:26,代码来源:FeatureSelectionService.cs

示例9: GetSeriesCatalogInRectangle

        public SearchResult GetSeriesCatalogInRectangle(Box extentBox, string[] keywords, double tileWidth, double tileHeight,
            DateTime startDate, DateTime endDate, WebServiceNode[] serviceIDs, BusinessObjects.Models.IProgressHandler bgWorker)
        {
            if (extentBox == null) throw new ArgumentNullException("extentBox");
            if (serviceIDs == null) throw new ArgumentNullException("serviceIDs");
            if (bgWorker == null) throw new ArgumentNullException("bgWorker");

            if (keywords == null || keywords.Length == 0)
            {
                keywords = new[] { String.Empty };
            }

            bgWorker.CheckForCancel();
            var extent = new Extent(extentBox.XMin, extentBox.YMin, extentBox.XMax, extentBox.YMax);
            var fullSeriesList = GetSeriesListForExtent(extent, keywords, tileWidth, tileHeight, startDate, endDate,
                                                        serviceIDs, bgWorker, series => true);
            SearchResult resultFs = null;
            if (fullSeriesList.Count > 0)
            {
                bgWorker.ReportMessage("Calculating Points...");
                resultFs = SearchHelper.ToFeatureSetsByDataSource(fullSeriesList);
            }

            bgWorker.CheckForCancel();
            var message = string.Format("{0} Series found.", totalSeriesCount);
            bgWorker.ReportProgress(100, "Search Finished. " + message);
            return resultFs;
        }
开发者ID:CUAHSI,项目名称:HydroClient,代码行数:28,代码来源:Seriessearcher.cs

示例10: ValidateCompare

 public ValidateCompare(BusinessObjects.BusinessObject otherObject,
     ValidationOperator @operator, String errorMessage)
 {
     OtherObject = otherObject;
     Operator = @operator;
     ErrorMessage = errorMessage;
 }
开发者ID:leloulight,项目名称:gemfirexd-oss,代码行数:7,代码来源:ValidateCompare.cs

示例11: Add

 public void Add(BusinessObjects.Relation entity)
 {
     using (_RelationRepository = new GenericRepository<DAL.DataEntities.Relation>())
     {
         _RelationRepository.Add((DAL.DataEntities.Relation)entity.InnerEntity);
         _RelationRepository.SaveChanges();
     }
 }
开发者ID:dswingle,项目名称:openconfigurator,代码行数:8,代码来源:RelationService.cs

示例12: Add

 public void Add(BusinessObjects.Constraint entity)
 {
     using (_ConstraintRepository = new GenericRepository<DAL.DataEntities.Constraint>())
     {
         _ConstraintRepository.Add((DAL.DataEntities.Constraint)entity.InnerEntity);
         _ConstraintRepository.SaveChanges();
     }
 }
开发者ID:dswingle,项目名称:openconfigurator,代码行数:8,代码来源:ConstraintService.cs

示例13: Add

 public void Add(BusinessObjects.Model entity)
 {
     using (_ModelRepository = new GenericRepository<DAL.DataEntities.Model>())
     {
         _ModelRepository.Add((DAL.DataEntities.Model)entity.InnerEntity);
         _ModelRepository.SaveChanges();
     }
 }
开发者ID:dswingle,项目名称:openconfigurator,代码行数:8,代码来源:ModelService.cs

示例14: Add

 public void Add(BusinessObjects.CustomRule entity)
 {
     using (_CustomRuleRepository = new GenericRepository<DAL.DataEntities.CustomRule>())
     {
         _CustomRuleRepository.Add((DAL.DataEntities.CustomRule)entity.InnerEntity);
         _CustomRuleRepository.SaveChanges();
     }
 }
开发者ID:dswingle,项目名称:openconfigurator,代码行数:8,代码来源:CustomRuleService.cs

示例15: UpdateTasks

        public BusinessObjects.WorkManagement.Job UpdateTasks(BusinessObjects.WorkManagement.Job targetJob, BusinessObjects.WorkManagement.EngineerFeedback feedback)
        {
            // Tasks
            ActivityTaskCollection activityTaskCollection = new ActivityTaskCollection();
            ActivityTask activityTask = null;

            /*
            foreach (TaskUpdate taskUpdate in feedback.Tasks)
            {
                if (targetJob.Tasks != null && targetJob.Tasks.Count > 0 && targetJob.Tasks.Find("ID", taskUpdate.ID) >= 0)
                {
                    // Update to existing Task
                    activityTask = targetJob.Tasks.Find(taskUpdate.ID);
                }
                else
                {
                    // Adding a new Task
                    activityTask = new ActivityTask();
                    activityTask.Description = taskUpdate.Comments[0].Text;
                }
                activityTask.IsComplete = taskUpdate.IsComplete;
                activityTask.IsDatabaseComplete = activityTask.IsComplete;
                activityTask.LastUpdatedDate = feedback.EndDateTime != null ? feedback.EndDateTime.Value : this.EndDateTime.Value;
                activityTaskCollection.Add(activityTask);
            }
            foreach (ActivityTask updatedActivityTask in activityTaskCollection)
            {
                if (updatedActivityTask.ID > 0)
                {
                    targetJob.Tasks.Replace(targetJob.Tasks.Find(updatedActivityTask.ID), updatedActivityTask);
                }
                else
                {
                    targetJob.Tasks.Add(updatedActivityTask);
                }
            }
            */

            foreach (TaskUpdate taskUpdate in feedback.Tasks)
            {
                activityTask = new ActivityTask();
                if (taskUpdate.ID <= 0)
                {
                    activityTask.Description = taskUpdate.Comments[0].Text;
                }
                activityTask.IsComplete = taskUpdate.IsComplete;
                activityTask.IsDatabaseComplete = activityTask.IsComplete;
                activityTask.LastUpdatedDate = feedback.EndDateTime != null ? feedback.EndDateTime.Value : this.EndDateTime.Value;

                activityTask.MaterialsRequired = taskUpdate.MaterialsUsed;
                activityTask.MeasurementsRequired = taskUpdate.MeasurementsTaken;
                
                activityTaskCollection.Add(activityTask);
            }
            targetJob.Tasks = activityTaskCollection;

            return targetJob;
        }
开发者ID:bedford603067,项目名称:Augment,代码行数:58,代码来源:JobUpdate.cs


注:本文中的BusinessObjects类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。