Beispiel #1
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormCarrierEdit FormCE = new FormCarrierEdit();

            FormCE.IsNew = true;
            Carrier carrier = new Carrier();

            if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))             //Canadian. en-CA or fr-CA
            {
                carrier.IsCDA = true;
            }
            FormCE.CarrierCur = new Carrier();
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            FillGrid();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (FormCE.CarrierCur.CarrierNum.ToString() == table.Rows[i]["CarrierNum"].ToString())
                {
                    gridMain.SetSelected(i, true);
                }
            }
        }
Beispiel #2
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormCarrierEdit FormCE = new FormCarrierEdit(0);

            FormCE.IsNew = true;
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            FillGrid();
        }
Beispiel #3
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            FormCarrierEdit FormCE = null;

            if (checkCDAnet.Checked)
            {
                FormCE = new FormCarrierEdit(PIn.PInt(table.Rows[e.Row]["CarrierNum"].ToString()));
            }
            else
            {
                FormCE = new FormCarrierEdit(Carriers.List[e.Row].CarrierNum);
            }
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            changed = true;
            FillGrid();
        }
Beispiel #4
0
 private void butAdd_Click(object sender, System.EventArgs e)
 {
     FormCarrierEdit FormCE=new FormCarrierEdit();
     FormCE.IsNew=true;
     Carrier carrier=new Carrier();
     if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
         carrier.IsCDA=true;
     }
     FormCE.CarrierCur=new Carrier();
     FormCE.ShowDialog();
     if(FormCE.DialogResult!=DialogResult.OK){
         return;
     }
     changed=true;
     FillGrid();
     for(int i=0;i<table.Rows.Count;i++){
         if(FormCE.CarrierCur.CarrierNum.ToString()==table.Rows[i]["CarrierNum"].ToString()){
             gridMain.SetSelected(i,true);
         }
     }
 }
Beispiel #5
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            Carrier carrier = Carriers.GetCarrier(PIn.Long(table.Rows[e.Row]["CarrierNum"].ToString()));

            if (IsSelectMode)
            {
                SelectedCarrier = carrier;
                DialogResult    = DialogResult.OK;
                return;
            }
            FormCarrierEdit FormCE = new FormCarrierEdit();

            FormCE.CarrierCur = carrier;
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            FillGrid();
            DataValid.SetInvalid(InvalidType.Carriers);
        }
Beispiel #6
0
        private void butAdd_Click(object sender, System.EventArgs e)
        {
            FormCarrierEdit FormCE = new FormCarrierEdit();

            FormCE.IsNew = true;
            Carrier carrier = new Carrier();

            if (CultureInfo.CurrentCulture.Name.EndsWith("CA"))             //Canadian. en-CA or fr-CA
            {
                carrier.IsCDA = true;
            }
            carrier.CarrierName = textCarrier.Text;
            //The phone number will get formated while the user types inside the carrier edit window.
            //However, the user could have typed in a poorly formatted number so we will reformat the number once before load.
            string phoneFormatted = TelephoneNumbers.ReFormat(textPhone.Text);

            carrier.Phone     = phoneFormatted;
            FormCE.CarrierCur = carrier;
            FormCE.ShowDialog();
            if (FormCE.DialogResult != DialogResult.OK)
            {
                return;
            }
            //Load the name and phone number of the newly added carrier to the search fields so that the new carrier shows up in the grid.
            textCarrier.Text = FormCE.CarrierCur.CarrierName;
            textPhone.Text   = FormCE.CarrierCur.Phone;
            FillGrid();
            for (int i = 0; i < table.Rows.Count; i++)
            {
                if (FormCE.CarrierCur.CarrierNum.ToString() == table.Rows[i]["CarrierNum"].ToString())
                {
                    gridMain.SetSelected(i, true);
                }
            }
            DataValid.SetInvalid(InvalidType.Carriers);
        }
		private void butAdd_Click(object sender, System.EventArgs e) {
			FormCarrierEdit FormCE=new FormCarrierEdit();
			FormCE.IsNew=true;
			Carrier carrier=new Carrier();
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				carrier.IsCDA=true;
			}
			carrier.CarrierName=textCarrier.Text;
			//The phone number will get formated while the user types inside the carrier edit window.
			//However, the user could have typed in a poorly formatted number so we will reformat the number once before load.
			string phoneFormatted=TelephoneNumbers.ReFormat(textPhone.Text);
			carrier.Phone=phoneFormatted;
			FormCE.CarrierCur=carrier;
			FormCE.ShowDialog();
			if(FormCE.DialogResult!=DialogResult.OK){
				return;
			}
			changed=true;
			//Load the name and phone number of the newly added carrier to the search fields so that the new carrier shows up in the grid.
			textCarrier.Text=FormCE.CarrierCur.CarrierName;
			textPhone.Text=FormCE.CarrierCur.Phone;
			FillGrid();
			for(int i=0;i<table.Rows.Count;i++){
				if(FormCE.CarrierCur.CarrierNum.ToString()==table.Rows[i]["CarrierNum"].ToString()){
					gridMain.SetSelected(i,true);
				}
			}
		}
		private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) {
			Carrier carrier=Carriers.GetCarrier(PIn.Long(table.Rows[e.Row]["CarrierNum"].ToString()));
			if(IsSelectMode) {
				SelectedCarrier=carrier;
				DialogResult=DialogResult.OK;
				return;
			}
			FormCarrierEdit FormCE=new FormCarrierEdit();
			FormCE.CarrierCur=carrier;
			FormCE.ShowDialog();
			if(FormCE.DialogResult!=DialogResult.OK){
				return;
			}
			changed=true;
			FillGrid();
		}
		///<summary>Used from butGetElectronic_Click and from butOK_Click.  Returns false if unable to complete.  Also fills SubCur if not null.</summary>
		private bool FillPlanCurFromForm(){
			if(textDateEffect.errorProvider1.GetError(textDateEffect)!=""
				||textDateTerm.errorProvider1.GetError(textDateTerm)!=""
				||textDentaide.errorProvider1.GetError(textDentaide)!=""
				) {
				MsgBox.Show(this,"Please fix data entry errors first.");
				return false;
			}
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				if(textPlanFlag.Text!="" && textPlanFlag.Text!="A" && textPlanFlag.Text!="V" && textPlanFlag.Text!="N") {
					MsgBox.Show(this,"Plan flag must be A, V, N, or blank.");
					return false;
				}
				if(textPlanFlag.Text=="") {
					if(checkIsPMP.Checked) {
						MsgBox.Show(this,"The provincial medical plan checkbox must be unchecked when the plan flag is blank.");
						return false;
					}
				}
				else {
					if(!checkIsPMP.Checked) {
						MsgBox.Show(this,"The provincial medical plan checkbox must be checked when the plan flag is not blank.");
						return false;
					}
					if(textPlanFlag.Text=="A") {
						if(textCanadianDiagCode.Text=="" || textCanadianDiagCode.Text!=Eclaims.Canadian.TidyAN(textCanadianDiagCode.Text,textCanadianDiagCode.Text.Length,true)) {
							MsgBox.Show(this,"When plan flag is set to A, diagnostic code must be set and must be 6 characters or less in length.");
							return false;
						}
						if(textCanadianInstCode.Text=="" || textCanadianInstCode.Text!=Eclaims.Canadian.TidyAN(textCanadianInstCode.Text,textCanadianInstCode.Text.Length,true)) {
							MsgBox.Show(this,"When plan flag is set to A, institution code must be set and must be 6 characters or less in length.");
							return false;
						}
					}
				}
			}
			if(textSubscriberID.Text=="" && SubCur!=null) {
				MsgBox.Show(this,"Subscriber ID not allowed to be blank.");
				return false;
			}
			if(textCarrier.Text=="") {
				MsgBox.Show(this,"Carrier not allowed to be blank.");
				return false;
			}
			if(PatPlanCur!=null && textOrdinal.errorProvider1.GetError(textOrdinal)!=""){
				MsgBox.Show(this,"Please fix data entry errors first.");
				return false;
			}
			if(SubCur!=null) {
				//Subscriber: Only changed when user clicks change button.
				SubCur.SubscriberID=textSubscriberID.Text;
				SubCur.DateEffective=PIn.Date(textDateEffect.Text);
				SubCur.DateTerm=PIn.Date(textDateTerm.Text);
				SubCur.ReleaseInfo=checkRelease.Checked;
				SubCur.AssignBen=checkAssign.Checked;
				SubCur.SubscNote=textSubscNote.Text;
				//MonthRenew already handled inside benefit window.
			}
			GetEmployerNum();
			PlanCur.GroupName=textGroupName.Text;
			PlanCur.GroupNum=textGroupNum.Text;
			PlanCur.RxBIN=textBIN.Text;
			PlanCur.DivisionNo=textDivisionNo.Text;//only visible in Canada
			//carrier-----------------------------------------------------------------------------------------------------
			CarrierCur=new Carrier();
			CarrierCur.CarrierName=textCarrier.Text;
			CarrierCur.Phone=textPhone.Text;
			CarrierCur.Address=textAddress.Text;
			CarrierCur.Address2=textAddress2.Text;
			CarrierCur.City=textCity.Text;
			CarrierCur.State=textState.Text;
			CarrierCur.Zip=textZip.Text;
			CarrierCur.ElectID=textElectID.Text;
			CarrierCur.NoSendElect=checkNoSendElect.Checked;
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				bool carrierFound=true;
				try {
					CarrierCur=Carriers.GetIndentical(CarrierCur);
				}
				catch {//match not found
					carrierFound=false;
				}
				if(!carrierFound) {
					if(!MsgBox.Show(this,MsgBoxButtons.OKCancel,"Carrier not found.  Create new carrier?")) {
						return false;
					}
					FormCarrierEdit formCE=new FormCarrierEdit();
					formCE.IsNew=true;
					formCE.CarrierCur=CarrierCur;
					formCE.ShowDialog();
					if(formCE.DialogResult!=DialogResult.OK) {
						return false;
					}
				}
			}
			else {
				CarrierCur=Carriers.GetIndentical(CarrierCur);
			}
			PlanCur.CarrierNum=CarrierCur.CarrierNum;
			//plantype already handled.
			if(comboClaimForm.SelectedIndex!=-1){
				PlanCur.ClaimFormNum=ClaimForms.ListShort[comboClaimForm.SelectedIndex].ClaimFormNum;
			}
			PlanCur.UseAltCode=checkAlternateCode.Checked;
			PlanCur.CodeSubstNone=checkCodeSubst.Checked;
			PlanCur.IsMedical=checkIsMedical.Checked;
			PlanCur.ClaimsUseUCR=checkClaimsUseUCR.Checked;
			PlanCur.IsHidden=checkIsHidden.Checked;
			PlanCur.ShowBaseUnits=checkShowBaseUnits.Checked;
			if(comboFeeSched.SelectedIndex==0){
				PlanCur.FeeSched=0;
			}
			else{
				PlanCur.FeeSched=FeeSchedsStandard[comboFeeSched.SelectedIndex-1].FeeSchedNum;
			}
			if(comboCopay.SelectedIndex==0){
				PlanCur.CopayFeeSched=0;
			}
			else{
				PlanCur.CopayFeeSched=FeeSchedsCopay[comboCopay.SelectedIndex-1].FeeSchedNum;
			}
			if(comboAllowedFeeSched.SelectedIndex==0){
				if(IsNewPlan
					&& PlanCur.PlanType==""//percentage
					&& PrefC.GetBool(PrefName.AllowedFeeSchedsAutomate)){
					//add a fee schedule if needed
					FeeSched sched=FeeScheds.GetByExactName(CarrierCur.CarrierName,FeeScheduleType.Allowed);
					if(sched==null){
						sched=new FeeSched();
						sched.Description=CarrierCur.CarrierName;
						sched.FeeSchedType=FeeScheduleType.Allowed;
						//sched.IsNew=true;
						sched.ItemOrder=FeeSchedC.ListLong.Count;
						FeeScheds.Insert(sched);
						DataValid.SetInvalid(InvalidType.FeeScheds);
					}
					PlanCur.AllowedFeeSched=sched.FeeSchedNum;
				}
				else{
					PlanCur.AllowedFeeSched=0;
				}
			}
			else{
				PlanCur.AllowedFeeSched=FeeSchedsAllowed[comboAllowedFeeSched.SelectedIndex-1].FeeSchedNum;
			}
			PlanCur.CobRule=(EnumCobRule)comboCobRule.SelectedIndex;
			if(comboFilingCode.SelectedIndex==-1) {
				PlanCur.FilingCode=0;
			}
			else {
				PlanCur.FilingCode=InsFilingCodeC.Listt[comboFilingCode.SelectedIndex].InsFilingCodeNum;
			}
			PlanCur.FilingCodeSubtype=0;
			List<InsFilingCodeSubtype> subtypeList=InsFilingCodeSubtypes.GetForInsFilingCode(PlanCur.FilingCode);
			if(comboFilingCodeSubtype.SelectedIndex != -1 && comboFilingCodeSubtype.SelectedIndex < subtypeList.Count) {
				PlanCur.FilingCodeSubtype=subtypeList[comboFilingCodeSubtype.SelectedIndex].InsFilingCodeSubtypeNum;
			}
			//Canadian------------------------------------------------------------------------------------------
			PlanCur.DentaideCardSequence=PIn.Byte(textDentaide.Text);
			PlanCur.CanadianPlanFlag=textPlanFlag.Text;//validated
			PlanCur.CanadianDiagnosticCode=textCanadianDiagCode.Text;//validated
			PlanCur.CanadianInstitutionCode=textCanadianInstCode.Text;//validated
			//Canadian end---------------------------------------------------------------------------------------
			PlanCur.TrojanID=textTrojanID.Text;
			PlanCur.PlanNote=textPlanNote.Text;
			return true;
		}