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


C# System.Contract类代码示例

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


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

示例1: WriteAssignments

 private void WriteAssignments(Contract contract, IndentedTextWriter writer)
 {
     foreach (Member member in contract.Members)
     {
         writer.WriteLine("{0} = {1};", member.Name, GeneratorUtil.ParameterCase(member.Name));
     }
 }
开发者ID:alreva,项目名称:CQRS_Example,代码行数:7,代码来源:MessagesGenerator.cs

示例2: EditContract

        public static bool EditContract(Contract Ct)
        {
            try
            {
                db = new UcasProEntities();
                db.Configuration.LazyLoadingEnabled = false;
                db.Configuration.ProxyCreationEnabled = false;
                var q = db.Contracts.Where(p => p.ID == Ct.ID).SingleOrDefault();
                q.Employee_ID = Ct.Employee_ID;
                q.TotalSalary = Ct.TotalSalary;
                q.SelaryAmount = Ct.SelaryAmount;
                q.StartDate = Ct.StartDate;
                q.EndDate = Ct.EndDate;
                q.Status = Ct.Status;
                
                db.SaveChanges();
                return true;

            }
            catch (Exception ex)
            {


                Xprema.XpremaException e = new Xprema.XpremaException();
                e.CodeNumber = 6;
                e.OtherDescription = ex.InnerException.InnerException.Message;
                e.UserDescription = "Error in Save Changed";
                e.UserDescriptionArabic = "خطاء في حفظ البيانات";
                throw e;
            }
        }
开发者ID:ainma007,项目名称:UcasProject,代码行数:31,代码来源:ContractCmd.cs

示例3: ExecuteClientSearch

        public Contract.Search.SearchResultCollection ExecuteClientSearch(Contract.Search.Search search)
        {
            YellowstonePathology.YpiConnect.Service.SearchGateway gateway = new YellowstonePathology.YpiConnect.Service.SearchGateway();
            YellowstonePathology.YpiConnect.Contract.Search.SearchResultCollection searchResults = null;

            switch (search.SearchType)
            {
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.PatientLastNameSearch:
                    searchResults = gateway.GetClientCasesByPatientLastName(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.PatientLastAndFirstNameSearch:
                    searchResults = gateway.GetClientCasesByPatientLastNameAndFirstName(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.RecentCases:
                    searchResults = gateway.GetClientRecentCases(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.NotDownloaded: //Not Downloaded is Depricated SH 5/17/2010
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.NotAcknowledged:
                    searchResults = gateway.GetClientCasesNotAcknowledged(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.DateOfBirth:
                    searchResults = gateway.GetClientCasesByPBirthDate(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.SocialSecurityNumber:
                    searchResults = gateway.GetClientCasesByPSSN(search);
                    break;
            }

            if (searchResults == null) searchResults = new Contract.Search.SearchResultCollection();
            return searchResults;
        }
开发者ID:WilliamCopland,项目名称:YPILIS,代码行数:31,代码来源:SearchService.cs

示例4: Initialize

 public override void Initialize(BacktestServerProxy.RobotContext grobotContext, 
     Contract.Util.BL.CurrentProtectedContext protectedContextx)
 {
     base.Initialize(grobotContext, protectedContextx);
     packers = Graphics.ToDictionary(g => g.a, g => new CandlePacker(g.b));
     digitsDen = (int) Math.Pow(10, roundDigits);
 }
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:7,代码来源:RoundPriceRobot.cs

示例5: InsertTest

 public void InsertTest(Contract.CTestManager manager)
 {
     using (TestManagerDBContainer container = new TestManagerDBContainer())
     {
         int result = container.InsertTestManager(manager.Name, manager.Description, manager.NumberOfQuestions, manager.NumberOfQuestions, manager.TotalMarks, manager.GradeID, manager.Duration, manager.PassingMarks);
     }
 }
开发者ID:EdiCarlos,项目名称:MyPractices,代码行数:7,代码来源:TestManagerService.cs

示例6: NewContract

        public static bool NewContract(Contract Ct)
        {
            try
            {
                db = new UcasProEntities();
                db.Configuration.ProxyCreationEnabled = false;
                db.Configuration.LazyLoadingEnabled = false;
                db.Contracts.Add(Ct);
                db.SaveChanges();
                return true;

            }
            catch (Exception ex)
            {
               
                Xprema.XpremaException e = new Xprema.XpremaException();
                e.CodeNumber = 6;
                e.OtherDescription = ex.InnerException.InnerException.Message;
                File.WriteAllText("t.txt", ex.InnerException.InnerException.Message);
                e.UserDescription = "Error in Save Changed";
                if (ex.InnerException.InnerException.Message.Contains("Violation of PRIMARY KEY constraint 'PK_Contracts'. Cannot insert duplicate key in object 'dbo.Contracts'"))
                {
                    e.UserDescriptionArabic = "الموظف موجود عقده في المشروع مسبقا";

                }
                else
                    e.UserDescriptionArabic = e.OtherDescription;//"خطاء في اضافة البيانات";
               
                 throw e;
            }
        }
开发者ID:ainma007,项目名称:UcasProject,代码行数:31,代码来源:ContractCmd.cs

示例7: ExecutePathologistSearch

        public Contract.Search.SearchResultCollection ExecutePathologistSearch(Contract.Search.Search search)
        {
            YellowstonePathology.YpiConnect.Service.SearchGateway gateway = new YellowstonePathology.YpiConnect.Service.SearchGateway();
            YellowstonePathology.YpiConnect.Contract.Search.SearchResultCollection searchResults = null;

            switch (search.SearchType)
            {
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.PatientLastNameSearch:
                    searchResults = gateway.GetPathologistCasesByPatientLastName(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.PatientLastAndFirstNameSearch:
                    searchResults = gateway.GetPathologistCasesByPatientLastNameAndFirstName(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.RecentCases:
                    searchResults = gateway.GetPathologistRecentCases(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.DateOfBirth:
                    searchResults = gateway.GetPathologistCasesByPBirthDate(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.SocialSecurityNumber:
                    searchResults = gateway.GetPathologistCasesByPSSN(search);
                    break;
                case YellowstonePathology.YpiConnect.Contract.Search.SearchTypeEnum.RecentCasesForFacilityId:
                    searchResults = gateway.GetRecentProfessionalCasesByFacilityId(search);
                    break;
            }

            if (searchResults == null) searchResults = new Contract.Search.SearchResultCollection();
            return searchResults;
        }
开发者ID:WilliamCopland,项目名称:YPILIS,代码行数:30,代码来源:SearchService.cs

示例8: ReadGraph

 /// <summary>
 /// Constructor for the <c>ReadGraph</c> object. This is used
 /// to create graphs that are used for reading objects from the XML
 /// document. The specified strategy is used to acquire the names
 /// of the special attributes used during the serialization.
 /// </summary>
 /// <param name="contract">
 /// this is the name scheme used by the strategy
 /// </param>
 /// <param name="loader">
 /// this is the class loader to used for the graph
 /// </param>
 public ReadGraph(Contract contract, Loader loader) {
    this.refer = contract.getReference();
    this.mark = contract.getIdentity();
    this.length = contract.getLength();
    this.label = contract.getLabel();
    this.loader = loader;
 }
开发者ID:ngallagher,项目名称:simplexml,代码行数:19,代码来源:ReadGraph.cs

示例9: ProvisionSiteCollection

        public bool ProvisionSiteCollection(Contract.SharePointProvisioningData sharePointProvisioningData)
        {
            bool processed = false;
            try
            {
                SiteProvisioningBase siteToProvision = null;
                switch (sharePointProvisioningData.Template)
                {
                    case SiteProvisioningTypes.ContosoCollaboration:
                        siteToProvision = new ContosoCollaboration();
                        break;
                    case SiteProvisioningTypes.ContosoProject:
                        siteToProvision = new ContosoProject();
                        break;
                }

                siteToProvision.SharePointProvisioningData = sharePointProvisioningData;
                HookupAuthentication(siteToProvision);

                // Hookup class that will hold the on-prem overrides
                SiteProvisioningOnPremises spo = new SiteProvisioningOnPremises();
                siteToProvision.SiteProvisioningOnPremises = spo;

                // Provision the site collection
                processed = siteToProvision.Execute();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                //log error
            }

            return processed;
        }
开发者ID:Calisto1980,项目名称:PnP,代码行数:34,代码来源:SharePointProvisioning.cs

示例10: btnNewContract_Click_1

 private void btnNewContract_Click_1(object sender, RoutedEventArgs e)
 {
     Contract nContract = new Contract();
     nContract.CompanyId = company.Id;
     saveUpdateContract(nContract);
     loadContracts();
 }
开发者ID:Exomnius,项目名称:TogetherIsBetter,代码行数:7,代码来源:SettingsFrm.xaml.cs

示例11: CreateContract

        public async Task CreateContract(CreateContractInputDto input)
        {
            //We can use Logger, it's defined in ApplicationService class.
            Logger.Info("Creating an contract for input: " + input);

            //Creating a new Task entity with given input's properties
            var contract = new Contract
            {
                Start = input.Start,
                State = ContractState.Active,
                Type = input.Type,
                BaseHourQtyPerMonth = input.BaseHourQtyPerMonth,
                BaseHourRatePerMonth = input.BaseHourRatePerMonth
                

            };
            if (input.Finish.HasValue) { contract.Finish = input.Finish; }

            
            contract.AccountId = input.AccountId;
            contract.Account = _accountRepository.Load((long)input.AccountId);
           

            //Saving entity with standard Insert method of repositories.
            await _contractRepository.InsertAsync(contract);
        }
开发者ID:jonquickqsense,项目名称:projectkorai,代码行数:26,代码来源:ContractAppService.cs

示例12: PutContract

        public async Task<IHttpActionResult> PutContract(int id, Contract contract)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != contract.Id)
            {
                return BadRequest();
            }
            using (var transaction = db.Database.BeginTransaction())
            {
                var origin = db.Contracts.Find(contract.Id);
                db.Entry<Contract>(origin).Collection(c => c.AppartmentOwners).Load();

                db.Changes.AddRange(Helper.Logger.ChangeRecords<Contract>(origin, contract, RequestContext.Principal.Identity.Name));
                var added = contract.AppartmentOwners.Except(origin.AppartmentOwners.ToList(), new AppartmentOwnerComparator());
                var deleted = origin.AppartmentOwners.ToList().Except(contract.AppartmentOwners, new AppartmentOwnerComparator());
                db.AppartmentOwners.RemoveRange(deleted);
                foreach (var ao in added)
                {
                    ao.ContractId = contract.Id;
                    db.AppartmentOwners.Add(ao);
                }
                db.Entry<Contract>(origin).State = EntityState.Detached;
                await db.SaveChangesAsync();
                foreach (var ao in contract.AppartmentOwners)
                {
                    var aoindb = db.AppartmentOwners.Find(ao.Id);
                    aoindb.ShowAsOwner = ao.ShowAsOwner;
                    aoindb.ShowOnCert = ao.ShowOnCert;
                    db.Entry<AppartmentOwner>(aoindb).State = EntityState.Modified;
                }
               
                contract.AppartmentOwners = null;
                db.Entry<Contract>(contract).State = EntityState.Modified;
               
                try
                {
                    await db.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContractExists(id))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                transaction.Commit();
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
开发者ID:luffy-xiao,项目名称:HTMS,代码行数:58,代码来源:ContractsController.cs

示例13: ContractView

        public ContractView(Contract contract)
        {
            InitializeComponent();

            _activeContract = contract;
            _repository = new DataRepository();

            PopulateFields(contract);
            InitializeHandlers();
        }
开发者ID:reecebedding,项目名称:EVE_LogisticiansTool,代码行数:10,代码来源:ContractView.cs

示例14: PutUserProfile

        public int PutUserProfile(Contract.DataContract.User user)
        {
            Guid userId = ((NotenetIdentity)HttpContext.Current.User.Identity).UID;
            if (userId != user.userID)
            {
                return -1;//will not be stopped at exception
            }

            return (int)db.PutUserInfo(user.userID, user.Birthday, user.NickName, user.RealName, user.Email).FirstOrDefault();
        }
开发者ID:sirtristancomtedeartois,项目名称:note,代码行数:10,代码来源:User.svc.cs

示例15: DevContract

        public DevContract(winStatusEnum status, Contract con = null)
        {
            InitializeComponent();
            if (con != null)
                m_contract = con;
            else
                m_contract = new Contract();

            SetFormStatus(status);
        }
开发者ID:hmxiaoxiao,项目名称:haimenlg,代码行数:10,代码来源:DevContract.cs


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