コード例 #1
0
        public async Task <ActionResult <JobDto> > UpdateJobTaskItem(int industryId, Guid jobId, Guid jobTaskId, [FromBody] JobTaskItemForUpdateDto request)
        {
            if (!IndustryType.TryFromValue(industryId, out IndustryType industryType))
            {
                return(NotFound());
            }

            var existingJob = await _repository.GetByIdAsync(new GetJobWithTasksSpecification(new JobId(jobId)));

            if (existingJob == null || existingJob.IndustryId != industryType.Value)
            {
                return(NotFound());
            }

            var jobTask = existingJob.JobTasks.SingleOrDefault(jt => jt.Id.Id == jobTaskId);

            if (jobTask == null)
            {
                return(NotFound());
            }

            var previousJobTaskItem = jobTask.JobTaskItems.SingleOrDefault(jti => jti.Summary == request.PreviousSummary);

            jobTask.UpdateJobTaskItem(_mapper.Map <JobTaskItem>(previousJobTaskItem), new JobTaskItem(request.Summary));

            await _repository.UpdateAsync(existingJob);

            return(CreatedAtRoute(
                       "GetJob",
                       new { industryId, jobId },
                       _mapper.Map <JobDto>(existingJob)
                       ));
        }
コード例 #2
0
        public void InsertUpdateDelete()
        {
            IndustryTypeController industryTypeController = new IndustryTypeController();

            //create new entity
            IndustryType industryType = new IndustryType();

            industryType.industryTypeId = Guid.NewGuid();
            industryType.name           = "Test Name";
            industryType.entryDate      = DateTime.Now;
            industryType.appUserId      = Guid.NewGuid();
            industryType.modifiedDate   = DateTime.Now;
            industryType.remark         = "Test Remark";

            //insert
            var result1 = industryTypeController.Post(industryType);
            //update
            var result2 = industryTypeController.Post(industryType);
            //delete
            var result3 = industryTypeController.Delete(industryType.industryTypeId);

            //assert
            Assert.IsNotNull(result1);
            Assert.IsNotNull(result2);
            Assert.IsNotNull(result3);
            Assert.IsTrue(result1 is OkResult);
            Assert.IsTrue(result2 is OkResult);
            Assert.IsTrue(result3 is OkResult);
        }
コード例 #3
0
        // for read
        public IndustryType GetIndustryTypeRecord(string recordID, string UserID)
        {
            SqlDataReader dr = null;

            try
            {
                IndustryType   industryType = new IndustryType();
                SqlParameter[] Parameters   = { new SqlParameter("@SNo",  Convert.ToInt32(recordID)),
                                                new SqlParameter("@UserID", Convert.ToInt32(UserID)) };

                dr = SqlHelper.ExecuteReader(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "dbo.GetRecordIndustryType", Parameters);

                if (dr.Read())
                {
                    industryType.IndustryTypeName = dr["IndustryTypeName"].ToString();

                    industryType.IndustryTypeDesc = dr["IndustryTypeDesc"].ToString();

                    industryType.Active      = dr["Active"].ToString();
                    industryType.IsActive    = Convert.ToBoolean(dr["IsActive"].ToString());
                    industryType.CreatedUser = dr["CreatedUser"].ToString();
                    industryType.UpdatedUser = dr["UpdatedUser"].ToString();
                }
                dr.Close();
                return(industryType);
            }
            catch (Exception ex)//
            {
                dr.Close();
                throw ex;
            }
        }
コード例 #4
0
 public static void AttachNichesToIndustry(IndustryType industry, NicheType[] nicheTypes, GameContext gameContext)
 {
     foreach (var n in nicheTypes)
     {
         AttachNicheToIndustry(n, industry, gameContext);
     }
 }
コード例 #5
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Tz888.Model.Advertorial.IndustryTypeModel model = new Tz888.Model.Advertorial.IndustryTypeModel();
        IndustryType bll = new IndustryType();

        if (ViewState["code"] != null)
        {
            model.classID = int.Parse(ViewState["code"].ToString());
        }
        else
        {
            model.classID = 0;
        }
        model.industryName = txtMuneName.Text.Trim();

        if (rdoClose.Checked)
        {
            model.CheckiD = 0;
        }
        else
        {
            model.CheckiD = 1;
        }
        model.desc = txtUrlAdd.Text.Trim();
        if (bll.Add(model) > 0)
        {
            Response.Write("<script>alert('添加成功');location.href='" + ViewState["returnUrl"].ToString() + "';</script>");
        }
        else
        {
            Response.Write("<script>alert('添加失败');location.href='" + ViewState["returnUrl"].ToString() + "';</script>");
        }
    }
コード例 #6
0
        public async Task <ActionResult <JobDto> > CreateJob(int industryId, [FromBody] JobForCreationDto request)
        {
            if (!IndustryType.TryFromValue(industryId, out IndustryType industryType))
            {
                return(NotFound());
            }

            var job = industryType.Industry.CreateJobForIndustry(
                request.Title,
                request.Description
                );

            if (request.JobTasks.Any())
            {
                foreach (var jobTask in request.JobTasks)
                {
                    job.AddNewJobTask(
                        new TitleAndDescription(jobTask.Title, jobTask.Description)
                        );
                }
            }

            Job createdJob = await _repository.AddAsync(job);

            var mappedJob = _mapper.Map <JobDto>(createdJob);

            return(CreatedAtRoute(
                       nameof(GetJob),
                       new { industryId = industryId, jobId = createdJob.Id.Id },
                       mappedJob
                       ));
        }
コード例 #7
0
    public override string RenderValue()
    {
        NicheType    NicheType    = SelectedNiche;
        IndustryType IndustryType = Markets.GetIndustry(NicheType, Q);

        return(Visuals.Link("Is part of " + Enums.GetFormattedIndustryName(IndustryType) + " industry"));
    }
コード例 #8
0
        public async Task <ActionResult> UpdateJob(int industryId, Guid jobId, [FromBody] JobForUpdateDto request)
        {
            if (!IndustryType.TryFromValue(industryId, out IndustryType industryType))
            {
                return(NotFound());
            }

            var existingJob = await _repository.GetByIdAsync(new GetJobWithTasksSpecification(new JobId(jobId)));

            if (existingJob == null || existingJob.IndustryId != industryType.Value)
            {
                return(NotFound());
            }

            existingJob.UpdateTitleAndDescription(new TitleAndDescription(request.Title, request.Description));

            // PUT is a full update, so we need to clear all job tasks
            existingJob.ClearAllJobTasks();

            if (request.JobTasks.Any())
            {
                foreach (var jobTask in request.JobTasks)
                {
                    existingJob.AddNewJobTask(
                        new TitleAndDescription(jobTask.Title, jobTask.Description)
                        );
                }
            }

            await _repository.UpdateAsync(existingJob);

            return(NoContent());
        }
コード例 #9
0
        public async Task <ActionResult <JobDto> > UpdateJobTask(int industryId, Guid jobId, Guid jobTaskId, [FromBody] JobTaskForUpdateDto request)
        {
            if (!IndustryType.TryFromValue(industryId, out IndustryType industryType))
            {
                return(NotFound());
            }

            var existingJob = await _repository.GetByIdAsync(new GetJobWithTasksSpecification(new JobId(jobId)));

            if (existingJob == null || existingJob.IndustryId != industryType.Value)
            {
                return(NotFound());
            }

            existingJob.UpdateJobTask(
                new JobTaskId(jobTaskId),
                new TitleAndDescription(request.Title, request.Description),
                request.Order.Value,
                request.JobTaskItems.Select(jti => _mapper.Map <JobTaskItem>(jti))
                );

            await _repository.UpdateAsync(existingJob);

            return(CreatedAtRoute(
                       "GetJob",
                       new { industryId, jobId },
                       _mapper.Map <JobDto>(existingJob)
                       ));
        }
コード例 #10
0
    public void ReplaceIndustry(IndustryType newIndustryType)
    {
        var index     = GameComponentsLookup.Industry;
        var component = (IndustryComponent)CreateComponent(index, typeof(IndustryComponent));

        component.IndustryType = newIndustryType;
        ReplaceComponent(index, component);
    }
コード例 #11
0
    public void SetEntity(IndustryType industry)
    {
        var name = Enums.GetFormattedIndustryName(industry);

        Name.text = name + "\nIndustry";

        GetComponent <LinkToIndustry>().SetIndustry(industry);
    }
コード例 #12
0
    public void SetIndustry(IndustryType industry, InputField Input)
    {
        var niches = Markets.GetPlayableNichesInIndustry(industry, Q).Where(m => Markets.IsAppropriateStartNiche(m, Q)).ToArray();
        var index  = Random.Range(0, niches.Count());
        var niche  = niches[index].niche.NicheType;

        SetNiche(niche, Input);
    }
コード例 #13
0
    public void SetIndustry(IndustryType industry, GameObject TypeCorporationNameContainer, GameObject ChooseInitialNicheContainer)
    {
        this.IndustryType = industry;
        this.TypeCorporationNameContainer = TypeCorporationNameContainer;
        this.ChooseInitialNicheContainer  = ChooseInitialNicheContainer;

        GetComponentInChildren <TextMeshProUGUI>().text = Enums.GetFormattedIndustryName(IndustryType);
    }
コード例 #14
0
 private IndustryBM ConvertToIndustryBM(IndustryType model)
 {
     return(new IndustryBM()
     {
         Id = model.Id,
         Name = model.Name,
     });
 }
コード例 #15
0
        public ActionResult DeleteConfirmed(int id)
        {
            IndustryType businessStream = db.IndustryTypes.Find(id);

            db.IndustryTypes.Remove(businessStream);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #16
0
    public void SetIndustry(IndustryType industry)
    {
        Industry = industry;

        StartCampaignButton.SetIndustry(industry, Input);

        Input.Select();
        Input.ActivateInputField();
    }
コード例 #17
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            IndustryType industryType = await db.IndustryTypes.FindAsync(id);

            db.IndustryTypes.Remove(industryType);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
コード例 #18
0
        public Job CreateJobForIndustry(string title, string description = "")
        {
            Guard.Against.NullOrEmpty(title, nameof(title));
            Guard.Against.OutOfRange(title.Length, nameof(title), 0, 255);

            Job job = new Job(new TitleAndDescription(title, description), IndustryType.FromValue(Type));

            return(job);
        }
コード例 #19
0
    GameObject GetIndustryObject(IndustryType industry)
    {
        if (!industryNames.ContainsKey(industry))
        {
            industryNames[industry] = Instantiate(IndustryPrefab, transform);
        }

        return(industryNames[industry]);
    }
コード例 #20
0
 public ActionResult Edit([Bind(Include = "Id,IndustryType1,Isactive,CreatedOn,ModifiedOn")] IndustryType IndustryType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(IndustryType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(IndustryType));
 }
コード例 #21
0
ファイル: TemplateManager.cs プロジェクト: bing-copy/NFlex
        /// <summary>
        /// 设置所属行业
        /// </summary>
        /// <param name="primary">公众号模板消息所属主行业编号</param>
        /// <param name="secondary">公众号模板消息所属副行业编号</param>
        /// <returns></returns>
        public Result SetIndustry(IndustryType primary, IndustryType secondary)
        {
            var data = new
            {
                industry_id1 = primary,
                industry_id2 = secondary
            };

            return(PostJson("/cgi-bin/template/api_set_industry", data));
        }
コード例 #22
0
        public async Task <ActionResult> Edit([Bind(Include = "IndustryTypeID,Type")] IndustryType industryType)
        {
            if (ModelState.IsValid)
            {
                db.Entry(industryType).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(industryType));
        }
コード例 #23
0
        public ResourcesTypes GetResources()
        {
            ResourcesTypes data = new ResourcesTypes();

            _dataProvider.ExecuteCmd("dbo.ResourcesTypes_SelectAll", inputParamMapper : null, singleRecordMapper :
                                     delegate(IDataReader reader, short set)
            {
                switch (set)
                {
                case 0:
                    CategoryType model = new CategoryType();
                    int startingIndex  = 0;
                    model.Id           = reader.GetSafeInt32(startingIndex++);
                    model.Name         = reader.GetSafeString(startingIndex++);

                    if (data.Categories == null)
                    {
                        data.Categories = new List <CategoryType>();
                    }
                    data.Categories.Add(model);
                    break;
                }
                switch (set)
                {
                case 1:
                    BusinessType model = new BusinessType();
                    int startingIndex  = 0;
                    model.Id           = reader.GetSafeInt32(startingIndex++);
                    model.Name         = reader.GetSafeString(startingIndex++);

                    if (data.BusinessTypes == null)
                    {
                        data.BusinessTypes = new List <BusinessType>();
                    }
                    data.BusinessTypes.Add(model);
                    break;
                }
                switch (set)
                {
                case 2:
                    IndustryType model = new IndustryType();
                    int startingIndex  = 0;
                    model.Id           = reader.GetSafeInt32(startingIndex++);
                    model.Name         = reader.GetSafeString(startingIndex++);
                    if (data.IndustryTypes == null)
                    {
                        data.IndustryTypes = new List <IndustryType>();
                    }
                    data.IndustryTypes.Add(model);
                    break;
                }
            });
            return(data);
        }
コード例 #24
0
        public async Task <ActionResult <List <JobDto> > > GetJobs(int industryId)
        {
            if (!IndustryType.TryFromValue(industryId, out IndustryType industryType))
            {
                return(NotFound());
            }

            List <Job> items = await _repository.ListAsync(new GetJobsWithTasksSpecification(industryType));

            return(Ok(items.Select(i => _mapper.Map <JobDto>(i))));
        }
コード例 #25
0
 public ActionResult Edit(IndustryType businessStream)
 {
     businessStream.Isactive   = true;
     businessStream.ModifiedOn = System.DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(businessStream).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(businessStream));
 }
コード例 #26
0
        public async Task <ActionResult> Create([Bind(Include = "IndustryTypeID,Type")] IndustryType industryType)
        {
            if (ModelState.IsValid)
            {
                db.IndustryTypes.Add(industryType);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(industryType));
        }
コード例 #27
0
    public void ReplaceNiche(NicheType newNicheType, IndustryType newIndustryType, System.Collections.Generic.List <MarketCompatibility> newMarketCompatibilities, System.Collections.Generic.List <NicheType> newCompetingNiches, NicheType newParent)
    {
        var index     = GameComponentsLookup.Niche;
        var component = (NicheComponent)CreateComponent(index, typeof(NicheComponent));

        component.NicheType             = newNicheType;
        component.IndustryType          = newIndustryType;
        component.MarketCompatibilities = newMarketCompatibilities;
        component.CompetingNiches       = newCompetingNiches;
        component.Parent = newParent;
        ReplaceComponent(index, component);
    }
コード例 #28
0
        public ActionResult Create(IndustryType businessStream)
        {
            businessStream.Isactive  = true;
            businessStream.CreatedOn = System.DateTime.Now;
            if (ModelState.IsValid)
            {
                db.IndustryTypes.Add(businessStream);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(businessStream));
        }
コード例 #29
0
        public ActionResult Create(IndustryType IndustryType)
        {
            if (ModelState.IsValid)
            {
                IndustryType.CreatedOn = DateTime.Now;
                IndustryType.Isactive  = true;
                db.IndustryTypes.Add(IndustryType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(IndustryType));
        }
コード例 #30
0
        public static void AddFocusIndustry(IndustryType industryType, GameEntity company)
        {
            var industries = company.companyFocus.Industries;

            if (industries.Contains(industryType))
            {
                return;
            }

            industries.Add(industryType);

            company.ReplaceCompanyFocus(company.companyFocus.Niches, industries);
        }
コード例 #31
0
 private void cboMerchantIndustryType_SelectedIndexChanged(object sender, EventArgs e)
 {
     _MerchantIndustryType = (IndustryType)cboMerchantIndustryType.SelectedItem;
 }
コード例 #32
0
        public void CallingForm(MerchantProfile merchantProfile, bool blnNewProfile, BankcardService bcs, ElectronicCheckingService ecks, StoredValueService svas, string serviceId)
        {
            _bcs = bcs;
            _ecks = ecks;
            _svas = svas;
            _strServiceID = serviceId;

            hideAllFields();
            //Since MerchantProfile is saved at the serviceId level, display serviceId.
            txtMerchantProfileServiceId.Text = merchantProfile.ServiceId;
            
            if(blnNewProfile)
            {//New profile to add to CWS
                cmdAddUpdate.Text = "Add";

                //Populate combo boxes with the Enumeration
                cboCountryCode.Sorted = true;
                cboCountryCode.DataSource = Enum.GetValues(typeof(TypeISOCountryCodeA3));
                cboCountryCode.SelectedItem = TypeISOCountryCodeA3.NotSet;

                cboLanguage.Sorted = true;
                cboLanguage.DataSource = Enum.GetValues(typeof(TypeISOLanguageCodeA3));
                cboLanguage.SelectedItem = TypeISOLanguageCodeA3.NotSet;

                cboCurrencyCode.Sorted = true;
                cboCurrencyCode.DataSource = Enum.GetValues(typeof(TypeISOCurrencyCodeA3));
                cboCurrencyCode.SelectedItem = TypeISOCurrencyCodeA3.NotSet;


                cboCustomerPresent.Sorted = true;
                cboCustomerPresent.DataSource = Enum.GetValues(typeof(CustomerPresent));
                cboCustomerPresent.SelectedItem = CustomerPresent.NotSet;

                cboRequestACI.Sorted = true;
                cboRequestACI.DataSource = Enum.GetValues(typeof(RequestACI));
                cboRequestACI.SelectedItem = RequestACI.IsCPSMeritCapable;

                cboEntryMode.Sorted = true;
                cboEntryMode.DataSource = Enum.GetValues(typeof(EntryMode));
                cboEntryMode.SelectedItem = EntryMode.NotSet;

                cboMerchantIndustryType.Sorted = true;
                cboMerchantIndustryType.DataSource = Enum.GetValues(typeof(IndustryType));
                cboMerchantIndustryType.SelectedItem = IndustryType.NotSet;
            }
            else
            {//Existing Profile to Update;
                //Note : items commented out are not use so no need to wire up a text box as well as add to 'SaveMerchantInformation()'
                txtProfileId.Text = merchantProfile.ProfileId;
                txtProfileId.ReadOnly = true;
                lblLastUpdated.Text = "Last Updated : " + merchantProfile.LastUpdated;
                //MerchantData
                //MerchantData.Address
                txtCity.Text = merchantProfile.MerchantData.Address.City;
                txtPostalCode.Text = merchantProfile.MerchantData.Address.PostalCode;
                txtStateProvince.Text = merchantProfile.MerchantData.Address.StateProvince.ToString();
                txtStreetAddress1.Text = merchantProfile.MerchantData.Address.Street1;
                txtStreetAddress2.Text = merchantProfile.MerchantData.Address.Street2;

                txtCustomerServiceInternet.Text = merchantProfile.MerchantData.CustomerServiceInternet;
                txtCustomerServicePhone.Text = merchantProfile.MerchantData.CustomerServicePhone;
                txtMerchantId.Text = merchantProfile.MerchantData.MerchantId;
                txtName.Text = merchantProfile.MerchantData.Name;
                txtPhone.Text = merchantProfile.MerchantData.Phone;
                txtTaxId.Text = merchantProfile.MerchantData.TaxId;
                if (_bcs != null)
                {
		                //MerchantData.BankcardMerchantData
		                txtABANumber.Text = merchantProfile.MerchantData.BankcardMerchantData.ABANumber;
		                txtAcquirerBIN.Text = merchantProfile.MerchantData.BankcardMerchantData.AcquirerBIN;
		                txtAgentBank.Text = merchantProfile.MerchantData.BankcardMerchantData.AgentBank;
		                txtAgentChain.Text = merchantProfile.MerchantData.BankcardMerchantData.AgentChain;
		                txtClientNum.Text = merchantProfile.MerchantData.BankcardMerchantData.ClientNumber;
		                txtLocation.Text = merchantProfile.MerchantData.BankcardMerchantData.Location;
		                //txtTBD.Text = _MerchantProfile.MerchantData.BankcardMerchantData.PrintCustomerServicePhone == "";
		                txtSecondaryTerminalId.Text = merchantProfile.MerchantData.BankcardMerchantData.SecondaryTerminalId;
		                txtSettlementAgent.Text = merchantProfile.MerchantData.BankcardMerchantData.SettlementAgent;
		                txtSharingGroup.Text = merchantProfile.MerchantData.BankcardMerchantData.SharingGroup;
		                txtSIC.Text = merchantProfile.MerchantData.BankcardMerchantData.SIC;
		                txtStoreId.Text = merchantProfile.MerchantData.BankcardMerchantData.StoreId;
		                txtSocketNum.Text = merchantProfile.MerchantData.BankcardMerchantData.TerminalId;
		                txtTimeZoneDifferential.Text = merchantProfile.MerchantData.BankcardMerchantData.TimeZoneDifferential;
		                txtReimbursementAttribute.Text = merchantProfile.MerchantData.BankcardMerchantData.ReimbursementAttribute;
              	}
              	if (_svas != null)
              	{
              			//MerchantData.StoredValueMerchantData
		                txtAgentChain.Text = merchantProfile.MerchantData.StoredValueMerchantData.AgentChain;
		                txtClientNum.Text = merchantProfile.MerchantData.StoredValueMerchantData.ClientNumber;
		                txtSIC.Text = merchantProfile.MerchantData.StoredValueMerchantData.SIC;
		                txtStoreId.Text = merchantProfile.MerchantData.StoredValueMerchantData.StoreId;
		                txtSocketNum.Text = merchantProfile.MerchantData.StoredValueMerchantData.TerminalId;
		                _MerchantIndustryType = merchantProfile.MerchantData.StoredValueMerchantData.IndustryType;
		            }
                    if (_ecks != null)
                    {
                        //MerchantData.ElectronicCheckingMerchantData
                        txtMerchantId.Text = merchantProfile.MerchantData.ElectronicCheckingMerchantData.OrginatorId;
                        txtStoreId.Text = merchantProfile.MerchantData.ElectronicCheckingMerchantData.SiteId;
                        txtSocketNum.Text = merchantProfile.MerchantData.ElectronicCheckingMerchantData.ProductId;
                    }

                //First Populate with the Enumeration
                cboCountryCode.DataSource = Enum.GetValues(typeof(TypeISOCountryCodeA3));
                //Now select the index that matches
                if (merchantProfile.MerchantData.Address.CountryCode.ToString().Length > 0)
                {
                    cboCountryCode.SelectedItem = merchantProfile.MerchantData.Address.CountryCode;
                    _CountryCode = (TypeISOCountryCodeA3)cboCountryCode.SelectedItem;
                }
                //First Populate with the Enumeration
                cboLanguage.DataSource = Enum.GetValues(typeof(TypeISOLanguageCodeA3));
                //Now select the index that matches
                if (merchantProfile.MerchantData.Language.ToString().Length > 0)
                {
                    cboLanguage.SelectedItem = merchantProfile.MerchantData.Language;
                    _Language = (TypeISOLanguageCodeA3)cboLanguage.SelectedItem;
                }
                //First Populate with the Enumeration
                cboCurrencyCode.DataSource = Enum.GetValues(typeof(TypeISOCurrencyCodeA3));
                //Now select the index that matches
                if (merchantProfile.MerchantData.Language.ToString().Length > 0)
                {
                    cboCurrencyCode.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.CurrencyCode;
                    _CurrencyCode = (TypeISOCurrencyCodeA3)cboCurrencyCode.SelectedItem;
                }

                //First Populate with the Enumeration
                cboCustomerPresent.DataSource = Enum.GetValues(typeof(CustomerPresent));
                //Now select the index that matches
                if (merchantProfile.TransactionData.BankcardTransactionDataDefaults.CustomerPresent.ToString().Length > 0)
                {
                    cboCustomerPresent.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.CustomerPresent;
                    _CustomerPresent = (CustomerPresent)cboCustomerPresent.SelectedItem;
                }

                //First Populate with the Enumeration
                cboRequestACI.DataSource = Enum.GetValues(typeof(RequestACI));
                //Now select the index that matches
                if (merchantProfile.TransactionData.BankcardTransactionDataDefaults.RequestACI.ToString().Length > 0)
                {
                    cboRequestACI.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.RequestACI;
                    _RequestACI = (RequestACI)cboRequestACI.SelectedItem;
                }

                //First Populate with the Enumeration
                cboMerchantIndustryType.DataSource = Enum.GetValues(typeof(IndustryType));
                if (merchantProfile.MerchantData.BankcardMerchantData.IndustryType.ToString().Length > 0)
                {
                    cboMerchantIndustryType.SelectedItem = merchantProfile.MerchantData.BankcardMerchantData.IndustryType;
                    _MerchantIndustryType = (IndustryType)cboMerchantIndustryType.SelectedItem;
                }

                //First Populate with the Enumeration
                cboEntryMode.DataSource = Enum.GetValues(typeof(EntryMode));
                if (merchantProfile.TransactionData.BankcardTransactionDataDefaults.EntryMode.ToString().Length > 0)
                {
                    cboEntryMode.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.EntryMode;
                    _EntryMode = (EntryMode)cboEntryMode.SelectedItem;
                }

                _Add = false; //In this case it's an update and not an add
                cmdAddUpdate.Text = "Update";
            }
            

            if (_bcs != null)
            {
                if (_strServiceID == "C82ED00001" || _strServiceID == "71C8700001" ||
                    _strServiceID == "88D9300001" || _strServiceID == "B447F00001" ||
                    _strServiceID == "D806000001" || _strServiceID == "E88FD00001")
                    showBCPExpandedFields();
                else if (_strServiceID == "168511300C" || _strServiceID == "9999999999")
                    showBCPExpandedFields();
                else
                {
                    showBCPFields();
                }
            }

            if (_ecks != null)
            {
                showECKFields();
            }
            if (_svas != null)
            {
                showSVAFields();
            }
        }
        private void GetMerchantProfile()
        {
            if (cboAvailableProfiles.Text.Length < 1)
            {
                MessageBox.Show("Please select a merchant profileId");
                cboAvailableProfiles.Focus();
                return;
            }

             ((SampleCode_DeskTop)(Owner)).Helper.CheckTokenExpire();
            string _strServiceID = ((SampleCode_DeskTop)(Owner)).Helper.ServiceID;
            string _strSessionToken = ((SampleCode_DeskTop)(Owner)).Helper.SessionToken;

            MerchantProfile merchantProfile =
                ((SampleCode_DeskTop)(Owner)).Helper.Cwssic.GetMerchantProfile(_strSessionToken, cboAvailableProfiles.Text, _strServiceID, TenderType.Credit);

            //Note : items commented out are not use so no need to wire up a text box as well as add to 'SaveMerchantInformation()'
            lblLastUpdated.Text = "Last Updated : " + merchantProfile.LastUpdated;
            //MerchantData
            //MerchantData.Address
            txtCity.Text = merchantProfile.MerchantData.Address.City;
            txtPostalCode.Text = merchantProfile.MerchantData.Address.PostalCode;
            txtStateProvince.Text = merchantProfile.MerchantData.Address.StateProvince.ToString();
            txtStreetAddress1.Text = merchantProfile.MerchantData.Address.Street1;
            txtStreetAddress2.Text = merchantProfile.MerchantData.Address.Street2;

            txtCustomerServiceInternet.Text = merchantProfile.MerchantData.CustomerServiceInternet;
            txtCustomerServicePhone.Text = merchantProfile.MerchantData.CustomerServicePhone;
            txtMerchantId.Text = merchantProfile.MerchantData.MerchantId;
            txtName.Text = merchantProfile.MerchantData.Name;
            txtPhone.Text = merchantProfile.MerchantData.Phone;
            txtTaxId.Text = merchantProfile.MerchantData.TaxId;
            if (_bcs != null)
            {
                //MerchantData.BankcardMerchantData
                txtABANumber.Text = merchantProfile.MerchantData.BankcardMerchantData.ABANumber;
                txtAcquirerBIN.Text = merchantProfile.MerchantData.BankcardMerchantData.AcquirerBIN;
                txtAgentBank.Text = merchantProfile.MerchantData.BankcardMerchantData.AgentBank;
                txtAgentChain.Text = merchantProfile.MerchantData.BankcardMerchantData.AgentChain;
                txtClientNum.Text = merchantProfile.MerchantData.BankcardMerchantData.ClientNumber;
                txtLocation.Text = merchantProfile.MerchantData.BankcardMerchantData.Location;
                //txtTBD.Text = _MerchantProfile.MerchantData.BankcardMerchantData.PrintCustomerServicePhone == "";
                txtSecondaryTerminalId.Text = merchantProfile.MerchantData.BankcardMerchantData.SecondaryTerminalId;
                txtSettlementAgent.Text = merchantProfile.MerchantData.BankcardMerchantData.SettlementAgent;
                txtSharingGroup.Text = merchantProfile.MerchantData.BankcardMerchantData.SharingGroup;
                txtSIC.Text = merchantProfile.MerchantData.BankcardMerchantData.SIC;
                txtStoreId.Text = merchantProfile.MerchantData.BankcardMerchantData.StoreId;
                txtSocketNum.Text = merchantProfile.MerchantData.BankcardMerchantData.TerminalId;
                txtTimeZoneDifferential.Text = merchantProfile.MerchantData.BankcardMerchantData.TimeZoneDifferential;
                txtReimbursementAttribute.Text = merchantProfile.MerchantData.BankcardMerchantData.ReimbursementAttribute;
            }
            if (_svas != null)
            {
                //MerchantData.StoredValueMerchantData
                txtAgentChain.Text = merchantProfile.MerchantData.StoredValueMerchantData.AgentChain;
                txtClientNum.Text = merchantProfile.MerchantData.StoredValueMerchantData.ClientNumber;
                txtSIC.Text = merchantProfile.MerchantData.StoredValueMerchantData.SIC;
                txtStoreId.Text = merchantProfile.MerchantData.StoredValueMerchantData.StoreId;
                txtSocketNum.Text = merchantProfile.MerchantData.StoredValueMerchantData.TerminalId;
                _MerchantIndustryType = merchantProfile.MerchantData.StoredValueMerchantData.IndustryType;
            }
            if (_ecks != null)
            {
                //MerchantData.ElectronicCheckingMerchantData
                txtMerchantId.Text = merchantProfile.MerchantData.ElectronicCheckingMerchantData.OrginatorId;
                txtStoreId.Text = merchantProfile.MerchantData.ElectronicCheckingMerchantData.SiteId;
                txtSocketNum.Text = merchantProfile.MerchantData.ElectronicCheckingMerchantData.ProductId;
            }

            //First Populate with the Enumeration
            cboCountryCode.DataSource = Enum.GetValues(typeof(TypeISOCountryCodeA3));
            //Now select the index that matches
            if (merchantProfile.MerchantData.Address.CountryCode.ToString().Length > 0)
            {
                cboCountryCode.SelectedItem = merchantProfile.MerchantData.Address.CountryCode;
                _CountryCode = (TypeISOCountryCodeA3)cboCountryCode.SelectedItem;
            }
            //First Populate with the Enumeration
            cboLanguage.DataSource = Enum.GetValues(typeof(TypeISOLanguageCodeA3));
            //Now select the index that matches
            if (merchantProfile.MerchantData.Language.ToString().Length > 0)
            {
                cboLanguage.SelectedItem = merchantProfile.MerchantData.Language;
                _Language = (TypeISOLanguageCodeA3)cboLanguage.SelectedItem;
            }
            //First Populate with the Enumeration
            cboCurrencyCode.DataSource = Enum.GetValues(typeof(TypeISOCurrencyCodeA3));
            //Now select the index that matches
            if (merchantProfile.MerchantData.Language.ToString().Length > 0)
            {
                cboCurrencyCode.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.CurrencyCode;
                _CurrencyCode = (TypeISOCurrencyCodeA3)cboCurrencyCode.SelectedItem;
            }

            //First Populate with the Enumeration
            cboCustomerPresent.DataSource = Enum.GetValues(typeof(CustomerPresent));
            //Now select the index that matches
            if (merchantProfile.TransactionData.BankcardTransactionDataDefaults.CustomerPresent.ToString().Length > 0)
            {
                cboCustomerPresent.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.CustomerPresent;
                _CustomerPresent = (CustomerPresent)cboCustomerPresent.SelectedItem;
            }

            //First Populate with the Enumeration
            cboRequestACI.DataSource = Enum.GetValues(typeof(RequestACI));
            //Now select the index that matches
            if (merchantProfile.TransactionData.BankcardTransactionDataDefaults.RequestACI.ToString().Length > 0)
            {
                cboRequestACI.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.RequestACI;
                _RequestACI = (RequestACI)cboRequestACI.SelectedItem;
            }

            //First Populate with the Enumeration
            cboMerchantIndustryType.DataSource = Enum.GetValues(typeof(IndustryType));
            if (merchantProfile.MerchantData.BankcardMerchantData.IndustryType.ToString().Length > 0)
            {
                cboMerchantIndustryType.SelectedItem = merchantProfile.MerchantData.BankcardMerchantData.IndustryType;
                _MerchantIndustryType = (IndustryType)cboMerchantIndustryType.SelectedItem;
            }

            //First Populate with the Enumeration
            cboEntryMode.DataSource = Enum.GetValues(typeof(EntryMode));
            if (merchantProfile.TransactionData.BankcardTransactionDataDefaults.EntryMode.ToString().Length > 0)
            {
                cboEntryMode.SelectedItem = merchantProfile.TransactionData.BankcardTransactionDataDefaults.EntryMode;
                _EntryMode = (EntryMode)cboEntryMode.SelectedItem;
            }
        }