Exemplo n.º 1
0
    protected void btnCheckThrough_Click(object sender, EventArgs e)
    {
        order.Status = OrderStatus.FINISHED;
        order.Reason = "";
        Client client = order.Client;
        order.CheckUserId = user.Id;
        order.CheckTime = DateTime.Now;
        OrderOperation.UpdateOrderStatus(order);
        OrderOperation.UpdateOrderCheckInfo(order);
        OrderOperation.UpdateOrderReason(order);

        string encode = StringHelper.GetEncodeNumber("YF");
        foreach (OrderDetail od in result)
        {
            ShouldPay sp = new ShouldPay();
            sp.OrderEncode = order.Encode;
            sp.OrderDetail = od;
            sp.CreateTime = DateTime.Now;
            sp.Encode = encode;
            sp.UserId = user.Id;
            sp.CompanyId = user.CompanyId;
            Carrier carrier = new Carrier();
            carrier.Id = CarrierOperation.GetCarrierByEncode(od.CarrierEncode).Id;
            sp.Carrier = carrier;
            sp.Type = "营业应付";
            ShouldPayOperation.CreateShouldPay(sp);
        }
        string msg = "";

        Company company = CompanyOperation.GetCompanyById(order.CompanyId);
        EmailHelper.SendMailForConsign(company, order.Client, order, out msg);
        Response.Write("<script language='javascript' type='text/javascript'>alert('" + msg + "');location.href='CheckOrderList.aspx';</script>");
    }
Exemplo n.º 2
0
 ///<summary>Inserts one Carrier into the database.  Returns the new priKey.</summary>
 internal static long Insert(Carrier carrier)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         carrier.CarrierNum=DbHelper.GetNextOracleKey("carrier","CarrierNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(carrier,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     carrier.CarrierNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(carrier,false);
     }
 }
Exemplo n.º 3
0
    protected void btnCreate_Click(object sender, EventArgs e)
    {
        string name = Request.Form[txtName.ID].Trim();

        if (string.IsNullOrEmpty(name) || Validator.IsMatchLessThanChineseCharacter(name, NAME_LENGTH))
        {
            lblMsg.Text = "分区名称不能为空,并且长度不能超过 " + NAME_LENGTH + " 个字符!";
            return;
        }

        CarrierArea ca = new CarrierArea();
        ca.Name = name;

        if (carrier == null)
        {
            carrier = CarrierOperation.GetCarrierById(int.Parse(ddlCarrier.SelectedItem.Value));
        }
        ca.Carrier = carrier;
        ca.Encode = CarrierAreaOperation.GetNextEncode();

        if (CarrierAreaOperation.CreateCarrierArea(ca))
        {
            lblMsg.Text = "添加成功!";
            return;
        }
        else
        {
            lblMsg.Text = "此分区名称已经存在!";
            return;
        }
    }
Exemplo n.º 4
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<Carrier> TableToList(DataTable table){
			List<Carrier> retVal=new List<Carrier>();
			Carrier carrier;
			for(int i=0;i<table.Rows.Count;i++) {
				carrier=new Carrier();
				carrier.CarrierNum              = PIn.Long  (table.Rows[i]["CarrierNum"].ToString());
				carrier.CarrierName             = PIn.String(table.Rows[i]["CarrierName"].ToString());
				carrier.Address                 = PIn.String(table.Rows[i]["Address"].ToString());
				carrier.Address2                = PIn.String(table.Rows[i]["Address2"].ToString());
				carrier.City                    = PIn.String(table.Rows[i]["City"].ToString());
				carrier.State                   = PIn.String(table.Rows[i]["State"].ToString());
				carrier.Zip                     = PIn.String(table.Rows[i]["Zip"].ToString());
				carrier.Phone                   = PIn.String(table.Rows[i]["Phone"].ToString());
				carrier.ElectID                 = PIn.String(table.Rows[i]["ElectID"].ToString());
				carrier.NoSendElect             = PIn.Bool  (table.Rows[i]["NoSendElect"].ToString());
				carrier.IsCDA                   = PIn.Bool  (table.Rows[i]["IsCDA"].ToString());
				carrier.CDAnetVersion           = PIn.String(table.Rows[i]["CDAnetVersion"].ToString());
				carrier.CanadianNetworkNum      = PIn.Long  (table.Rows[i]["CanadianNetworkNum"].ToString());
				carrier.IsHidden                = PIn.Bool  (table.Rows[i]["IsHidden"].ToString());
				carrier.CanadianEncryptionMethod= PIn.Byte  (table.Rows[i]["CanadianEncryptionMethod"].ToString());
				carrier.CanadianSupportedTypes  = (CanSupTransTypes)PIn.Int(table.Rows[i]["CanadianSupportedTypes"].ToString());
				retVal.Add(carrier);
			}
			return retVal;
		}
        public async Task<IActionResult> RegisterCarrier(CarrierViewModel carrierViewModel)
        {
            var vm = new CarrierListViewModel(await _carrierRepository.GetCarriersAsync(null));
            if (ViewData.ModelState.IsValid)
            {
                var carrier = new Carrier();
                carrierViewModel.CopyTo(carrier);
                var user = await UserManager.FindByNameAsync(carrier.Name);
                if (user == null)
                {
                    var carrierId = await _carrierRepository.AddAsync(carrier);
                    user = new ApplicationUser { UserName = carrier.Name, CarrierId = carrierId };
                    await UserManager.CreateAsync(user, _securityContext.DefaultPassword);
                    return new RedirectToActionResult("Login", "Carrier", null);
                }
                else
                {
                    ViewData.ModelState.AddModelError("UserNameNotAvailable","The User Name is not available");
                }
            }
            else
            {
                vm.LoadCarrierFrom(carrierViewModel);
            }

            ViewData.Model = vm;
            return new ViewResult() { ViewData = ViewData, ViewName = "Index" };
        }
Exemplo n.º 6
0
        public async Task<ActionResult> Create(CarrierViewModel model)
        {
            if (ModelState.IsValid == false) {
                return View(model);
            }

            var carrier = new Carrier {
                Name = model.Name,
                Code = model.Code,
                Identification = model.Identification,
                Address = new Address {
                    StreetAddress = model.StreetAddress,
                    District = model.District,
                    Locality = model.Locality,
                    Region = model.Region
                },
                PhoneNumber = model.PhoneNumber,
                Url = model.Url,
                PricePerKm = model.PricePerKm,
                PickUpTime = model.PickUpTime
            };

            _db.Carriers.Add(carrier);

            int x = await _db.SaveChangesAsync();

            return RedirectToAction("Index");
        }
Exemplo n.º 7
0
        public async Task PutAsync(Carrier carrier)
        {
            string url = String.Format(CultureInfo.InvariantCulture
                , "{0}carriers/Put", _urlPrefix);

            await base.PutAsync<Carrier>(url, carrier);
        }
Exemplo n.º 8
0
        public async Task<int> PostAsync(Carrier carrier)
        {
            string url = String.Format(CultureInfo.InvariantCulture
              , "{0}carriers/Post", _urlPrefix);

            return await base.PostAsync<int, Carrier>(url, carrier);
        }
Exemplo n.º 9
0
        public void Handle_CarrierInMovie_IsCorrectlyMappedToStringInViewModel(Carrier carrier, string expected)
        {
            var movie = new Movie { Carrier = carrier };

            var result = Mapper.Map<MovieViewModel>(movie);

            Assert.That(result.carrier, Is.EqualTo(expected));
        }
Exemplo n.º 10
0
 public ShipsBundle()
 {
     Bomber = new Bomber();
     Carrier = new Carrier();
     Fighter = new Fighter();
     Interceptor = new Interceptor();
     Juggernaut = new Juggernaut();
     Scout = new Scout();
 }
        public async Task<int> AddAsync(Carrier carrier)
        {
            carrier.Picture = Convert.FromBase64String(FakeImages.Carriers[DEFAULT_PICTURE]);

            await _context.Carriers.AddAsync(carrier);

            await _context.SaveChangesAsync();

            return carrier.CarrierId;
        }
Exemplo n.º 12
0
 public TwoD_Density_Base(IExperiment exp, Carrier carrier_type)
     : this(exp)
 {
     this.carrier_type = carrier_type;
     if (carrier_type == Carrier.hole)
     {
         Change_Charge(+1.0 * Physics_Base.q_e);
         Change_Mass(0.51 * Physics_Base.m_e);
     }
 }
Exemplo n.º 13
0
 public OneD_DFTSolver(IExperiment exp, Carrier carrier_type)
     : this(exp)
 {
     this.carrier_type = carrier_type;
     if (carrier_type == Carrier.hole)
     {
         Change_Charge(+1.0 * Physics_Base.q_e);
         Change_Mass(0.51 * Physics_Base.m_e);
         t = -0.5 * Physics_Base.hbar * Physics_Base.hbar / (mass * dz * dz);
     }
 }
Exemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (int.TryParse(Request.QueryString["id"], out carrierId))
     {
         carrier = CarrierOperation.GetCarrierById(carrierId);
         trLblCarrier.Visible = true;
         lblCarrier.Text = carrier.Name;
     }
     else
     {
         trDdlCarrier.Visible = true;
     }
 }
Exemplo n.º 15
0
 public TrackInfo(string trackingNumber,
     Carrier carrier,
     TrackStatus status,
     string details,
     DateTime localTime,
     Address? location)
     : this()
 {
     TrackingNumber = trackingNumber;
       Carrier = carrier;
       Status = status;
       Details = details;
       LocalTime = localTime;
       Location = location;
 }
Exemplo n.º 16
0
        public const double q_e = 160.217646; // (zC) is positive as in these definitions it is the elementary charge

        #endregion Fields

        #region Methods

        /// <summary>
        /// gets 3D spin-resolved density of states for a given potential and energy
        /// </summary>
        public static double Get_3D_DensityofStates(double energy, double band_edge, Carrier carrier_type, double mass)
        {
            // if the energy is below the potential (i.e. below the conduction band) return zero
            if (carrier_type == Carrier.electron && energy < band_edge)
                return 0.0;
            else if (carrier_type == Carrier.hole && energy > band_edge)
                return 0.0;

            // generate density of states
            if (carrier_type == Carrier.electron)
                return Math.Pow(2.0 * mass * mass * mass * (energy - band_edge), 0.5) / (Math.PI * Math.PI * hbar * hbar * hbar);
            else if (carrier_type == Carrier.hole)
                return Math.Pow(2.0 * mass * mass * mass * (band_edge - energy), 0.5) / (Math.PI * Math.PI * hbar * hbar * hbar);
            else
                throw new NotImplementedException();
        }
Exemplo n.º 17
0
        public CarrierViewModel(Carrier carrier, string meansOfTransport)
        {
            if (carrier == null)
            {
                address = new AddressViewModel(null);
                return;
            }

            if (!string.IsNullOrWhiteSpace(meansOfTransport))
            {
                MeansOfTransport = meansOfTransport;
            }

            SetBusinessFields(carrier.Business);
            SetContactFields(carrier.Contact);
            address = new AddressViewModel(carrier.Address);
        }
Exemplo n.º 18
0
        public TwoD_SO_DFTSolver(Experiment exp, Carrier carrier_type)
            : base(exp, carrier_type)
        {
            tx = -0.5 * Physics_Base.hbar * Physics_Base.hbar / (mass * dx * dx);
            ty = -0.5 * Physics_Base.hbar * Physics_Base.hbar / (mass * dy * dy);
            double r_so = 117.1 * (0.01 / Physics_Base.q_e);                                                    // r^{6c6c}_{41} for InAs as reported by Winkler (Table 6.6, p.87)
                                                                                                                // NOTE: the result there is in e A^2... to convert to nm^2, we divide by shown factors
            alpha = r_so / Physics_Base.q_e;

            theta_x = r_so * mass * dx / (Physics_Base.q_e / Physics_Base.hbar);
            theta_y = -1.0 * r_so * mass * dy / (Physics_Base.q_e / Physics_Base.hbar);

            g_1D = 0.5 / Math.PI;

            if (carrier_type == Carrier.hole)
                throw new NotImplementedException();
        }
Exemplo n.º 19
0
 public Label(object id,
     string url,
     byte[] data,
     LabelFormat format,
     string trackingNumber,
     Carrier carrier,
     NFX.Financial.Amount rate)
     : this()
 {
     ID = id;
       CreateDate = App.TimeSource.UTCNow;
       URL = url;
       Data = data;
       Format = format;
       TrackingNumber = trackingNumber;
       Carrier = carrier;
       Rate = rate;
 }
Exemplo n.º 20
0
    public void Rpc_init(GameObject co, byte spI, float squids, float urSquids ) {
       
        Car = co.GetComponent<Carrier>();
        if(Car == null || (uint)spI >= (uint)Car.SpawnPoints.Count) {  //note: in network functions we are unduly careful
            Destroy(gameObject);
            Debug.LogError("Error in UnitSpawn_Hlpr::init  " + Car + "  ---- " + (int)spI);
            return;
        }

        Player o = Car.Owner;

        if(o.isLocalPlayer && !isServer) {
        //    o.Squids -= (float) U.SquidCost;
            o.Squids = squids;  //todo probably not correct place for these
            o.UnrefSquids = urSquids;
            o.Pop += U.PopCost;
        }

        U.init(o);

        SP = Car.SpawnPoints[spI];
        SP.CurSpwn = this;
        Prev = SP.FirstPoint;

        if(Prev.childCount > 0) Next = Prev.GetChild(0);
       // U.Trnsfrm.parent = c.Trnsfrm;


        Timer = 1;
        //enabled = true;
        // gameObject.SetActive(true);
        





    }
Exemplo n.º 21
0
    protected void btnInsert_Click(object sender, EventArgs e)
    {
        CustomValidator cvInsert = ((CustomValidator)(this.FV_Carrier.FindControl("cvInsert")));
        if (cvInsert.IsValid)
        {
            carrier = new Carrier();

            carrier.Code = ((TextBox)(this.FV_Carrier.FindControl("tbCode"))).Text.Trim();
            carrier.Name = ((TextBox)(this.FV_Carrier.FindControl("tbName"))).Text.Trim();
            carrier.IsActive = ((CheckBox)(this.FV_Carrier.FindControl("cbIsActive"))).Checked;
            carrier.Country = ((TextBox)(this.FV_Carrier.FindControl("tbCountry"))).Text.Trim();
            carrier.PaymentTerm = ((TextBox)(this.FV_Carrier.FindControl("tbPaymentTerm"))).Text.Trim();
            carrier.TradeTerm = ((TextBox)(this.FV_Carrier.FindControl("tbTradeTerm"))).Text.Trim();
            carrier.ReferenceSupplier = ((TextBox)(this.FV_Carrier.FindControl("tbReferenceSupplier"))).Text.Trim();

            TheCarrierMgr.CreateCarrier(carrier, this.CurrentUser);
            if (CreateEvent != null)
            {
                CreateEvent(carrier.Code, e);
                ShowSuccessMessage("Transportation.Carrier.AddCarrier.Successfully", carrier.Code);
            }
        }
    }
Exemplo n.º 22
0
 ///<summary>Inserts one Carrier into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Carrier carrier,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         carrier.CarrierNum=ReplicationServers.GetKey("carrier","CarrierNum");
     }
     string command="INSERT INTO carrier (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="CarrierNum,";
     }
     command+="CarrierName,Address,Address2,City,State,Zip,Phone,ElectID,NoSendElect,IsCDA,CDAnetVersion,CanadianNetworkNum,IsHidden,CanadianEncryptionMethod,CanadianSupportedTypes) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(carrier.CarrierNum)+",";
     }
     command+=
          "'"+POut.String(carrier.CarrierName)+"',"
         +"'"+POut.String(carrier.Address)+"',"
         +"'"+POut.String(carrier.Address2)+"',"
         +"'"+POut.String(carrier.City)+"',"
         +"'"+POut.String(carrier.State)+"',"
         +"'"+POut.String(carrier.Zip)+"',"
         +"'"+POut.String(carrier.Phone)+"',"
         +"'"+POut.String(carrier.ElectID)+"',"
         +    POut.Bool  (carrier.NoSendElect)+","
         +    POut.Bool  (carrier.IsCDA)+","
         +"'"+POut.String(carrier.CDAnetVersion)+"',"
         +    POut.Long  (carrier.CanadianNetworkNum)+","
         +    POut.Bool  (carrier.IsHidden)+","
         +    POut.Byte  (carrier.CanadianEncryptionMethod)+","
         +    POut.Int   ((int)carrier.CanadianSupportedTypes)+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         carrier.CarrierNum=Db.NonQ(command,true);
     }
     return carrier.CarrierNum;
 }
Exemplo n.º 23
0
 public TwoD_DFTSolver(IExperiment exp, Carrier carrier_type)
     : base(exp, carrier_type)
 {
     tx = -0.5 * Physics_Base.hbar * Physics_Base.hbar / (mass * dx * dx);
     ty = -0.5 * Physics_Base.hbar * Physics_Base.hbar / (mass * dy * dy);
 }
 private ActionResult <Carrier> CreatedAtAction(string v, object p, Carrier carrier)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 25
0
        ///<summary>Updates one Carrier in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
        public static bool Update(Carrier carrier, Carrier oldCarrier)
        {
            string command = "";

            if (carrier.CarrierName != oldCarrier.CarrierName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CarrierName = '" + POut.String(carrier.CarrierName) + "'";
            }
            if (carrier.Address != oldCarrier.Address)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Address = '" + POut.String(carrier.Address) + "'";
            }
            if (carrier.Address2 != oldCarrier.Address2)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Address2 = '" + POut.String(carrier.Address2) + "'";
            }
            if (carrier.City != oldCarrier.City)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "City = '" + POut.String(carrier.City) + "'";
            }
            if (carrier.State != oldCarrier.State)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "State = '" + POut.String(carrier.State) + "'";
            }
            if (carrier.Zip != oldCarrier.Zip)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Zip = '" + POut.String(carrier.Zip) + "'";
            }
            if (carrier.Phone != oldCarrier.Phone)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Phone = '" + POut.String(carrier.Phone) + "'";
            }
            if (carrier.ElectID != oldCarrier.ElectID)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ElectID = '" + POut.String(carrier.ElectID) + "'";
            }
            if (carrier.NoSendElect != oldCarrier.NoSendElect)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "NoSendElect = " + POut.Int((int)carrier.NoSendElect) + "";
            }
            if (carrier.IsCDA != oldCarrier.IsCDA)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsCDA = " + POut.Bool(carrier.IsCDA) + "";
            }
            if (carrier.CDAnetVersion != oldCarrier.CDAnetVersion)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CDAnetVersion = '" + POut.String(carrier.CDAnetVersion) + "'";
            }
            if (carrier.CanadianNetworkNum != oldCarrier.CanadianNetworkNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CanadianNetworkNum = " + POut.Long(carrier.CanadianNetworkNum) + "";
            }
            if (carrier.IsHidden != oldCarrier.IsHidden)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsHidden = " + POut.Bool(carrier.IsHidden) + "";
            }
            if (carrier.CanadianEncryptionMethod != oldCarrier.CanadianEncryptionMethod)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CanadianEncryptionMethod = " + POut.Byte(carrier.CanadianEncryptionMethod) + "";
            }
            if (carrier.CanadianSupportedTypes != oldCarrier.CanadianSupportedTypes)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CanadianSupportedTypes = " + POut.Int((int)carrier.CanadianSupportedTypes) + "";
            }
            //SecUserNumEntry excluded from update
            //SecDateEntry not allowed to change
            //SecDateTEdit can only be set by MySQL
            if (carrier.TIN != oldCarrier.TIN)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TIN = '" + POut.String(carrier.TIN) + "'";
            }
            if (carrier.CarrierGroupName != oldCarrier.CarrierGroupName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CarrierGroupName = " + POut.Long(carrier.CarrierGroupName) + "";
            }
            if (carrier.ApptTextBackColor != oldCarrier.ApptTextBackColor)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ApptTextBackColor = " + POut.Int(carrier.ApptTextBackColor.ToArgb()) + "";
            }
            if (carrier.IsCoinsuranceInverted != oldCarrier.IsCoinsuranceInverted)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsCoinsuranceInverted = " + POut.Bool(carrier.IsCoinsuranceInverted) + "";
            }
            if (carrier.TrustedEtransFlags != oldCarrier.TrustedEtransFlags)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TrustedEtransFlags = " + POut.Int((int)carrier.TrustedEtransFlags) + "";
            }
            if (command == "")
            {
                return(false);
            }
            command = "UPDATE carrier SET " + command
                      + " WHERE CarrierNum = " + POut.Long(carrier.CarrierNum);
            Db.NonQ(command);
            return(true);
        }
Exemplo n.º 26
0
 public IFluentCarrier AddCarrier(Carrier newObject)
 {
     unitOfWork.carrierRepository.AddObject(newObject);
     this.processStatus = CreateProcessStatus.Insert;
     return(this as IFluentCarrier);
 }
Exemplo n.º 27
0
    void Start()
    {
        sr = gameObject.GetComponent <SpriteRenderer>();

        carrierScript = GetComponentInParent <Carrier>();
    }
Exemplo n.º 28
0
        static public String GetTrackingURL(String ShippingTrackingNumber)
        {
            // Trim tracking number, get rid of spaces and hyphens.
            ShippingTrackingNumber = ShippingTrackingNumber.Replace(" ", "").Replace("-", "").Trim();

            if (ShippingTrackingNumber.Length == 0)
            {
                return("");
            }

            // Check for a match on the ShippingTrackingNumber

            String[] CarrierList = AppLogic.AppConfig("ShippingTrackingCarriers").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            String   match       = String.Empty;

            foreach (String Carrier in CarrierList)
            {
                match = Regex.Match(ShippingTrackingNumber, AppLogic.AppConfig("ShippingTrackingRegex." + Carrier.Trim()), RegexOptions.Compiled).Value;

                if (match.Length != 0)
                {
                    return(String.Format(AppLogic.AppConfig("ShippingTrackingURL." + Carrier.Trim()), ShippingTrackingNumber));
                }
            }

            return("");
        }
Exemplo n.º 29
0
 public IFluentCarrier UpdateCarrier(Carrier updateObject)
 {
     unitOfWork.carrierRepository.UpdateObject(updateObject);
     this.processStatus = CreateProcessStatus.Update;
     return(this as IFluentCarrier);
 }
Exemplo n.º 30
0
        protected void saveCarrier()
        {
            Carrier carrier = null;
            int countryID = 0;

            using (TransactionScope scope = new TransactionScope()) {
                if (carrierID == 0)
                    carrier = new Carrier();						// new carrier
                else
                    carrier = CarrierManager.Get(carrierID);		// update carrier

                if (carrier != null) {
                    carrier.CarrierName = txtName.Text;
                    carrier.AddressLine1 = txtAddress.Text.Trim();
                    carrier.AddressLine2 = txtAddress2.Text.Trim();

                    if (ddlState.SelectedIndex > 0) {
                        carrier.StateID = Convert.ToInt32(ddlState.SelectedValue);
                        carrier.StateName = ddlState.SelectedItem.Text;
                    }

                    if (ddlCity.SelectedIndex > 0)
                        carrier.CityID = Convert.ToInt32(ddlCity.SelectedValue);

                    carrier.ZipCode = txtZipCode.Text;

                    carrier.IsActive = true;

                    carrier.ClientID = clientID;

                    countryID = Convert.ToInt32(ddlCountry.SelectedValue);
                    if (countryID > 0)
                        carrier.CountryID = countryID;

                    carrier = CarrierManager.Save(carrier);

                    scope.Complete();

                    Session["CarrierID"] = carrier.CarrierID;

                    tabContainer.Visible = true;
                }
            }
        }
Exemplo n.º 31
0
 ///<summary>Inserts one Carrier into the database.  Returns the new priKey.</summary>
 public static long Insert(Carrier carrier)
 {
     return(Insert(carrier, false));
 }
Exemplo n.º 32
0
        public async Task UpdateAsync(Carrier carrier)
        {
            _context.Carriers.Update(carrier);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 33
0
        ///<summary></summary>
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textMain.Text == "")
            {
                MsgBox.Show(this, "Please paste the text generated by the other program into the large box first.");
                return;
            }
            pat               = new Patient();
            pat.PriProv       = PrefC.GetLong(PrefName.PracticeDefaultProv);
            pat.BillingType   = PrefC.GetLong(PrefName.PracticeDefaultBillType);
            guar              = new Patient();
            guar.PriProv      = PrefC.GetLong(PrefName.PracticeDefaultProv);
            guar.BillingType  = PrefC.GetLong(PrefName.PracticeDefaultBillType);
            subsc             = new Patient();
            subsc.PriProv     = PrefC.GetLong(PrefName.PracticeDefaultProv);
            subsc.BillingType = PrefC.GetLong(PrefName.PracticeDefaultBillType);
            sub               = new InsSub();
            sub.ReleaseInfo   = true;
            sub.AssignBen     = PrefC.GetBool(PrefName.InsDefaultAssignBen);
            plan              = new InsPlan();
            carrier           = new Carrier();
            insRelat          = "self"; //this is the default if not included
            guarRelat         = "self";
            InsEmp            = "";
            GuarEmp           = "";
            NoteMedicalComp   = "";
            insPresent        = false;
            annualMax         = -1;
            deductible        = -1;
            XmlTextReader reader = new XmlTextReader(new StringReader(textMain.Text));

            reader.WhitespaceHandling = WhitespaceHandling.None;
            string element     = "";
            string textValue   = "";
            string rootElement = "";
            string segment     = "";    //eg PatientIdentification
            string field       = "";    //eg NameLast
            string endelement  = "";

            warnings = "";
            try{
                while (reader.Read())
                {
                    switch (reader.NodeType)
                    {
                    case XmlNodeType.Element:
                        element = reader.Name;
                        if (rootElement == "")                              //should be the first node
                        {
                            if (element == "Message")
                            {
                                rootElement = "Message";
                            }
                            else
                            {
                                throw new Exception(element + " should not be the first element.");
                            }
                        }
                        else if (segment == "")                              //expecting a new segment
                        {
                            segment = element;
                            if (segment != "MessageHeader" &&
                                segment != "PatientIdentification" &&
                                segment != "Guarantor" &&
                                segment != "Insurance")
                            {
                                throw new Exception(segment + " is not a recognized segment.");
                            }
                        }
                        else                                 //expecting a new field
                        {
                            field = element;
                        }
                        if (segment == "Insurance")
                        {
                            insPresent = true;
                        }
                        break;

                    case XmlNodeType.Text:
                        textValue = reader.Value;
                        if (field == "")
                        {
                            throw new Exception("Unexpected text: " + textValue);
                        }
                        break;

                    case XmlNodeType.EndElement:
                        endelement = reader.Name;
                        if (field == "")                              //we're not in a field, so we must be closing a segment or rootelement
                        {
                            if (segment == "")                        //we're not in a segment, so we must be closing the rootelement
                            {
                                if (rootElement == "Message")
                                {
                                    rootElement = "";
                                }
                                else
                                {
                                    throw new Exception("Message closing element expected.");
                                }
                            }
                            else                                     //must be closing a segment
                            {
                                segment = "";
                            }
                        }
                        else                                 //closing a field
                        {
                            field     = "";
                            textValue = "";
                        }
                        break;
                    }                    //switch
                    if (rootElement == "")
                    {
                        break;                        //this will ignore anything after the message endelement
                    }
                    if (field != "" && textValue != "")
                    {
                        if (segment == "MessageHeader")
                        {
                            ProcessMSH(field, textValue);
                        }
                        else if (segment == "PatientIdentification")
                        {
                            ProcessPID(field, textValue);
                        }
                        else if (segment == "Guarantor")
                        {
                            ProcessGT(field, textValue);
                        }
                        else if (segment == "Insurance")
                        {
                            ProcessINS(field, textValue);
                        }
                    }
                }                //while
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                //MsgBox.Show(this,"Error in the XML format.");
                reader.Close();
                return;
            }
            finally{
                reader.Close();
            }
            //Warnings and errors-----------------------------------------------------------------------------
            if (pat.LName == "" || pat.FName == "" || pat.Birthdate.Year < 1880)
            {
                MsgBox.Show(this, "Patient first and last name and birthdate are required.  Could not import.");
                return;
            }
            //if guarRelat is not self, and name and birthdate not supplied, no error.  Just make guar self.
            if (guarRelat != "self")
            {
                if (guar.LName == "" || guar.FName == "" || guar.Birthdate.Year < 1880)
                {
                    warnings += "Guarantor information incomplete.  Guarantor will be self.\r\n";
                    guarRelat = "self";
                }
            }
            if (insPresent)
            {
                if (carrier.CarrierName == "")
                {
                    warnings  += "Insurance CompanyName is missing. No insurance info will be imported.\r\n";
                    insPresent = false;
                }
                else if (insRelat != "self")
                {
                    if (subsc.LName == "" || subsc.FName == "" || subsc.Birthdate.Year < 1880)
                    {
                        warnings  += "Subscriber name or birthdate is missing. No insurance info will be imported.\r\n";
                        insPresent = false;
                    }
                }
                else if (sub.SubscriberID == "")
                {
                    warnings        += "PolicyNumber/SubscriberID missing.\r\n";
                    sub.SubscriberID = " ";
                }
            }
            if (warnings != "")
            {
                if (MessageBox.Show("It's safe to import, but you should be aware of the following issues:\r\n" + warnings + "\r\nContinue with Import?", "Warnings", MessageBoxButtons.OKCancel) != DialogResult.OK)
                {
                    return;
                }
            }

            //Patient-------------------------------------------------------------------------------------
            //DataTable table;
            long    patNum      = Patients.GetPatNumByNameAndBirthday(pat.LName, pat.FName, pat.Birthdate);
            Patient existingPat = null;

            existingPatOld = null;      //we will need this to do an update.
            if (patNum != 0)            //a patient already exists, so only add missing fields
            {
                existingPat    = Patients.GetPat(patNum);
                existingPatOld = existingPat.Copy();
                if (existingPat.MiddleI == "")              //only alter existing if blank
                {
                    existingPat.MiddleI = pat.MiddleI;
                }
                if (pat.Gender != PatientGender.Unknown)
                {
                    existingPat.Gender = pat.Gender;
                }
                if (existingPat.Preferred == "")
                {
                    existingPat.Preferred = pat.Preferred;
                }
                if (existingPat.Address == "")
                {
                    existingPat.Address = pat.Address;
                }
                if (existingPat.Address2 == "")
                {
                    existingPat.Address2 = pat.Address2;
                }
                if (existingPat.City == "")
                {
                    existingPat.City = pat.City;
                }
                if (existingPat.State == "")
                {
                    existingPat.State = pat.State;
                }
                if (existingPat.Zip == "")
                {
                    existingPat.Zip = pat.Zip;
                }
                if (existingPat.HmPhone == "")
                {
                    existingPat.HmPhone = pat.HmPhone;
                }
                if (existingPat.Email == "")
                {
                    existingPat.Email = pat.Email;
                }
                if (existingPat.WkPhone == "")
                {
                    existingPat.WkPhone = pat.WkPhone;
                }
                if (existingPat.Position == PatientPosition.Single)
                {
                    existingPat.Position = pat.Position;
                }
                if (existingPat.SSN == "")
                {
                    existingPat.SSN = pat.SSN;
                }
                existingPat.AddrNote += pat.AddrNote;              //concat
                Patients.Update(existingPat, existingPatOld);
                PatientNote PatientNoteCur = PatientNotes.Refresh(existingPat.PatNum, existingPat.Guarantor);
                PatientNoteCur.MedicalComp += NoteMedicalComp;
                PatientNotes.Update(PatientNoteCur, existingPat.Guarantor);
                //guarantor will not be altered in any way
            }            //if patient already exists
            else         //patient is new, so insert
            {
                Patients.Insert(pat, false);
                SecurityLogs.MakeLogEntry(Permissions.PatientCreate, pat.PatNum, "Created from Import Patient XML tool.");
                existingPatOld = pat.Copy();
                pat.Guarantor  = pat.PatNum;             //this can be changed later.
                Patients.Update(pat, existingPatOld);
                PatientNote PatientNoteCur = PatientNotes.Refresh(pat.PatNum, pat.Guarantor);
                PatientNoteCur.MedicalComp += NoteMedicalComp;
                PatientNotes.Update(PatientNoteCur, pat.Guarantor);
            }
            //guar-----------------------------------------------------------------------------------------------------
            if (existingPat == null)          //only add or alter guarantor for new patients
            {
                if (guarRelat == "self")
                {
                    //pat is already set with guar as self
                    //ignore all guar fields except EmployerName
                    existingPatOld  = pat.Copy();
                    pat.EmployerNum = Employers.GetEmployerNum(GuarEmp);
                    Patients.Update(pat, existingPatOld);
                }
                else
                {
                    //if guarRelat is not self, and name and birthdate not supplied, a warning was issued, and relat was changed to self.
                    //add guarantor or attach to an existing guarantor
                    long guarNum = Patients.GetPatNumByNameAndBirthday(guar.LName, guar.FName, guar.Birthdate);
                    if (guarNum != 0)                    //a guar already exists, so simply attach. Make no other changes
                    {
                        existingPatOld = pat.Copy();
                        pat.Guarantor  = guarNum;
                        if (guarRelat == "parent")
                        {
                            pat.Position = PatientPosition.Child;
                        }
                        Patients.Update(pat, existingPatOld);
                    }
                    else                     //we need to completely create guar, then attach
                    {
                        Patients.Insert(guar, false);
                        SecurityLogs.MakeLogEntry(Permissions.PatientCreate, guar.PatNum, "Created from Import Patient XML tool.");
                        //set guar for guar
                        existingPatOld   = guar.Copy();
                        guar.Guarantor   = guar.PatNum;
                        guar.EmployerNum = Employers.GetEmployerNum(GuarEmp);
                        Patients.Update(guar, existingPatOld);
                        //set guar for pat
                        existingPatOld = pat.Copy();
                        pat.Guarantor  = guar.PatNum;
                        if (guarRelat == "parent")
                        {
                            pat.Position = PatientPosition.Child;
                        }
                        Patients.Update(pat, existingPatOld);
                    }
                }
            }
            //subsc--------------------------------------------------------------------------------------------------
            if (!insPresent)
            {
                //this takes care of missing carrier name or subscriber info.
                MsgBox.Show(this, "Done");
                DialogResult = DialogResult.OK;
            }
            if (insRelat == "self")
            {
                sub.Subscriber = pat.PatNum;
            }
            else             //we need to find or add the subscriber
            {
                patNum = Patients.GetPatNumByNameAndBirthday(subsc.LName, subsc.FName, subsc.Birthdate);
                if (patNum != 0)                //a subsc already exists, so simply attach. Make no other changes
                {
                    sub.Subscriber = patNum;
                }
                else                 //need to create and attach a subscriber
                {
                    Patients.Insert(subsc, false);
                    SecurityLogs.MakeLogEntry(Permissions.PatientCreate, subsc.PatNum, "Created from Import Patient XML tool.");
                    //set guar to same guar as patient
                    existingPatOld  = subsc.Copy();
                    subsc.Guarantor = pat.Guarantor;
                    Patients.Update(subsc, existingPatOld);
                    sub.Subscriber = subsc.PatNum;
                }
            }
            //carrier-------------------------------------------------------------------------------------------------
            //Carriers.Cur=carrier;
            carrier = Carriers.GetIdentical(carrier);          //this automatically finds or creates a carrier
            //plan------------------------------------------------------------------------------------------------------
            plan.EmployerNum = Employers.GetEmployerNum(InsEmp);
            plan.CarrierNum  = carrier.CarrierNum;
            InsPlans.Insert(plan);
            //Attach plan to subscriber
            sub.PlanNum = plan.PlanNum;
            InsSubs.Insert(sub);
            //Then attach plan
            List <PatPlan> PatPlanList = PatPlans.Refresh(pat.PatNum);
            PatPlan        patplan     = new PatPlan();

            patplan.Ordinal   = (byte)(PatPlanList.Count + 1);      //so the ordinal of the first entry will be 1, NOT 0.
            patplan.PatNum    = pat.PatNum;
            patplan.InsSubNum = sub.InsSubNum;
            switch (insRelat)
            {
            case "self":
                patplan.Relationship = Relat.Self;
                break;

            case "parent":
                patplan.Relationship = Relat.Child;
                break;

            case "spouse":
                patplan.Relationship = Relat.Spouse;
                break;

            case "guardian":
                patplan.Relationship = Relat.Dependent;
                break;
            }
            PatPlans.Insert(patplan);
            //benefits
            if (annualMax != -1 && CovCats.GetCount(true) > 0)
            {
                Benefit ben = new Benefit();
                ben.BenefitType = InsBenefitType.Limitations;
                ben.CovCatNum   = CovCats.GetFirst(true).CovCatNum;
                ben.MonetaryAmt = annualMax;
                ben.PlanNum     = plan.PlanNum;
                ben.TimePeriod  = BenefitTimePeriod.CalendarYear;
                Benefits.Insert(ben);
            }
            if (deductible != -1 && CovCats.GetCount(true) > 0)
            {
                Benefit ben = new Benefit();
                ben.BenefitType = InsBenefitType.Deductible;
                ben.CovCatNum   = CovCats.GetFirst(true).CovCatNum;
                ben.MonetaryAmt = deductible;
                ben.PlanNum     = plan.PlanNum;
                ben.TimePeriod  = BenefitTimePeriod.CalendarYear;
                Benefits.Insert(ben);
            }
            MsgBox.Show(this, "Done");
            DialogResult = DialogResult.OK;
        }
Exemplo n.º 34
0
        ///<summary>Returns null if there is no HL7Def enabled or if there is no outbound ADT defined for the enabled HL7Def.</summary>
        public static MessageHL7 GenerateADT(Patient pat, Patient guar, EventTypeHL7 eventType)
        {
            HL7Def hl7Def = HL7Defs.GetOneDeepEnabled();

            if (hl7Def == null)
            {
                return(null);
            }
            //find an outbound ADT message in the def
            HL7DefMessage hl7DefMessage = null;

            for (int i = 0; i < hl7Def.hl7DefMessages.Count; i++)
            {
                if (hl7Def.hl7DefMessages[i].MessageType == MessageTypeHL7.ADT && hl7Def.hl7DefMessages[i].InOrOut == InOutHL7.Outgoing)
                {
                    hl7DefMessage = hl7Def.hl7DefMessages[i];
                    //continue;
                    break;
                }
            }
            if (hl7DefMessage == null)           //ADT message type is not defined so do nothing and return
            {
                return(null);
            }
            if (PrefC.GetBool(PrefName.ShowFeaturePatientClone))
            {
                pat = Patients.GetOriginalPatientForClone(pat);
            }
            MessageHL7     messageHL7   = new MessageHL7(MessageTypeHL7.ADT);
            Provider       prov         = Providers.GetProv(Patients.GetProvNum(pat));
            List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum);

            for (int i = 0; i < hl7DefMessage.hl7DefSegments.Count; i++)
            {
                int countRepeat = 1;
                //IN1 segment can repeat, get the number of current insurance plans attached to the patient
                if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.IN1)
                {
                    countRepeat = listPatPlans.Count;
                }
                //countRepeat is usually 1, but for repeatable/optional fields, it may be 0 or greater than 1
                //for example, countRepeat can be zero if the patient does not have any current insplans, in which case no IN1 segments will be included
                for (int j = 0; j < countRepeat; j++)           //IN1 is optional and can repeat so add as many as listPatplans
                {
                    PatPlan patplanCur = null;
                    InsPlan insplanCur = null;
                    InsSub  inssubCur  = null;
                    Carrier carrierCur = null;
                    Patient patSub     = null;
                    if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.IN1)                   //index repeat is guaranteed to be less than listPatplans.Count
                    {
                        patplanCur = listPatPlans[j];
                        inssubCur  = InsSubs.GetOne(patplanCur.InsSubNum);
                        insplanCur = InsPlans.RefreshOne(inssubCur.PlanNum);
                        carrierCur = Carriers.GetCarrier(insplanCur.CarrierNum);
                        if (pat.PatNum == inssubCur.Subscriber)
                        {
                            patSub = pat.Copy();
                        }
                        else
                        {
                            patSub = Patients.GetPat(inssubCur.Subscriber);
                        }
                    }
                    SegmentHL7 seg = new SegmentHL7(hl7DefMessage.hl7DefSegments[i].SegmentName);
                    seg.SetField(0, hl7DefMessage.hl7DefSegments[i].SegmentName.ToString());
                    for (int k = 0; k < hl7DefMessage.hl7DefSegments[i].hl7DefFields.Count; k++)
                    {
                        string fieldName = hl7DefMessage.hl7DefSegments[i].hl7DefFields[k].FieldName;
                        if (fieldName == "")                       //If fixed text instead of field name just add text to segment
                        {
                            seg.SetField(hl7DefMessage.hl7DefSegments[i].hl7DefFields[k].OrdinalPos, hl7DefMessage.hl7DefSegments[i].hl7DefFields[k].FixedText);
                        }
                        else
                        {
                            string fieldValue = "";
                            if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.IN1)
                            {
                                fieldValue = FieldConstructor.GenerateFieldIN1(hl7Def, fieldName, j + 1, patplanCur, inssubCur, insplanCur, carrierCur, listPatPlans.Count, patSub);
                            }
                            else
                            {
                                fieldValue = FieldConstructor.GenerateFieldADT(hl7Def, fieldName, pat, prov, guar, j + 1, eventType, seg.Name);
                            }
                            seg.SetField(hl7DefMessage.hl7DefSegments[i].hl7DefFields[k].OrdinalPos, fieldValue);
                        }
                    }
                    messageHL7.Segments.Add(seg);
                }
            }
            return(messageHL7);
        }
Exemplo n.º 35
0
 public async Task RemoveCarrierAsync(Carrier carrier)
 {
     _context.Carriers.Remove(carrier);
     await _context.SaveChangesAsync();
 }
Exemplo n.º 36
0
        public async Task AddCarrierAsync(Carrier carrier)
        {
            await _context.AddAsync(carrier);

            await _context.SaveChangesAsync();
        }
Exemplo n.º 37
0
 ///<summary>Inserts one Carrier into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(Carrier carrier)
 {
     return(InsertNoCache(carrier, false));
 }
        public ICarrier Decode(string content)
        {
            NullableCarrier Defer()
            {
                return(NullableCarrier.Instance);
            }

            if (string.IsNullOrEmpty(content))
            {
                return(Defer());
            }

            var parts = content.Split('-');

            if (parts.Length < 7)
            {
                return(Defer());
            }

            if (!int.TryParse(parts[0], out var sampled))
            {
                return(Defer());
            }

            if (!_uniqueIdParser.TryParse(_base64Formatter.Decode(parts[1]), out var traceId))
            {
                return(Defer());
            }

            if (!_uniqueIdParser.TryParse(_base64Formatter.Decode(parts[2]), out var segmentId))
            {
                return(Defer());
            }

            if (!int.TryParse(parts[3], out var parentSpanId))
            {
                return(Defer());
            }

            if (!int.TryParse(parts[4], out var parentServiceInstanceId))
            {
                return(Defer());
            }

            if (!int.TryParse(parts[5], out var entryServiceInstanceId))
            {
                return(Defer());
            }

            var carrier = new Carrier(traceId, segmentId, parentSpanId, parentServiceInstanceId,
                                      entryServiceInstanceId)
            {
                NetworkAddress = StringOrIntValueHelpers.ParseStringOrIntValue(_base64Formatter.Decode(parts[6])),
                Sampled        = sampled != 0
            };

            if (parts.Length >= 9)
            {
                carrier.ParentEndpoint =
                    StringOrIntValueHelpers.ParseStringOrIntValue(_base64Formatter.Decode(parts[7]));
                carrier.EntryEndpoint =
                    StringOrIntValueHelpers.ParseStringOrIntValue(_base64Formatter.Decode(parts[8]));
            }

            return(carrier);
        }
Exemplo n.º 39
0
        private void Save_Carrier_Availability()
        {
            bool flag = false;

            Carrier carrier = new Carrier();
            Order   order   = new Order();

            carrier.orderID = txtOrderID.Text;
            var orderList = order.GetOrderDetailWithID(carrier.orderID);

            if (orderList.Count != 0)
            {
                carrier.carrierID = orderList[0].carrierID;
                var carrierAvailabilityResult = carrier.GetAvailabilty(carrier.orderID, carrier.carrierID);

                //#### Make Plan
                //Planinfo
                //set Order.carrierID with selected carrierID
                if (carrierAvailabilityResult[0] != null)
                {
                    carrier.command = "UPDATE";

                    //assign data from table
                    carrier.carrierID    = carrierAvailabilityResult[0].carrierID;
                    carrier.depotCity    = carrierAvailabilityResult[0].depotCity;
                    carrier.carrierName  = carrierAvailabilityResult[0].carrierName;
                    carrier.jobType      = carrierAvailabilityResult[0].jobType;
                    carrier.quantity     = carrierAvailabilityResult[0].quantity;
                    carrier.vanType      = carrierAvailabilityResult[0].vanType;
                    carrier.ftlAvail     = carrierAvailabilityResult[0].ftlAvail;
                    carrier.ltlAvail     = carrierAvailabilityResult[0].ltlAvail;
                    carrier.ftlRate      = carrierAvailabilityResult[0].ftlRate;
                    carrier.ltlRate      = carrierAvailabilityResult[0].ltlRate;
                    carrier.reeferCharge = carrierAvailabilityResult[0].reeferCharge;
                    //FTL
                    if (carrier.jobType == 0)
                    {
                        carrier.ftlAvail = carrier.ftlAvail - 1;
                    }
                    //LTL
                    else
                    {
                        carrier.ltlAvail = carrier.ltlAvail - carrier.quantity;
                    }
                }
                flag = carrier.Save();

                //#### Check the carrierAvailability
                if (flag == true)
                {
                    MessageBox.Show("Carrier Availability is update sucessfully.", "Update Carrier Availabitily.");
                    Billing_Page_Setup(carrier.jobType, carrier.quantity, carrier.vanType);
                }
                else
                {
                    MessageBox.Show("Carrier Availability is not updated. You need to check this.", "Update failed for Carrier Availability.");
                }
            }
            else
            {
                MessageBox.Show("There is no carrierID information for the order. Please check the carrier information first.",
                                "Check the carrier information.");
            }
        }
Exemplo n.º 40
0
        void drawMissileCarrier(Carrier carrier, int y, Color color)
        {
            GL.Enable(EnableCap.Blend);
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
            GL.Color4(color.R, color.G, color.B, (byte)64);

            double angle = Math.PI * level.carrier.heading / 2048.0;
            // sin/cos swapped so N = 0, W = 1024
            int dx = (int)(level.carrier.distance * Math.Sin(angle));
            int dz = (int)(level.carrier.distance * Math.Cos(angle));

            // front vertices
            Vector3 lbf = new Vector3(carrier.x - 30, y, carrier.z);
            Vector3 rbf = new Vector3(carrier.x + 30, y, carrier.z);
            Vector3 rtf = new Vector3(carrier.x + 30, y + 60, carrier.z);
            Vector3 ltf = new Vector3(carrier.x - 30, y + 60, carrier.z);
            // back vertices
            Vector3 lbb = new Vector3(carrier.x - 30 + dx, y, carrier.z + dz);
            Vector3 rbb = new Vector3(carrier.x + 30 + dx, y, carrier.z + dz);
            Vector3 rtb = new Vector3(carrier.x + 30 + dx, y + 60, carrier.z + dz);
            Vector3 ltb = new Vector3(carrier.x - 30 + dx, y + 60, carrier.z + dz);

            GL.Begin(PrimitiveType.Quads);
            // bottom
            GL.Normal3(0.0f, -1.0f, 0.0f);
            GL.Vertex3(lbf);
            GL.Vertex3(rbf);
            GL.Vertex3(rbb);
            GL.Vertex3(lbb);
            // left
            GL.Normal3(-1.0f, 0.0f, 0.0f);
            GL.Vertex3(lbf);
            GL.Vertex3(ltf);
            GL.Vertex3(ltb);
            GL.Vertex3(lbb);
            // right
            GL.Normal3(1.0f, 0.0f, 0.0f);
            GL.Vertex3(rbf);
            GL.Vertex3(rtf);
            GL.Vertex3(rtb);
            GL.Vertex3(rbb);
            // front
            GL.Normal3(0.0f, 0.0f, 1.0f);
            GL.Vertex3(lbf);
            GL.Vertex3(rbf);
            GL.Vertex3(rtf);
            GL.Vertex3(ltf);
            // back
            GL.Normal3(0.0f, 0.0f, -1.0f);
            GL.Vertex3(lbb);
            GL.Vertex3(rbb);
            GL.Vertex3(rtb);
            GL.Vertex3(ltb);
            // top
            GL.Normal3(0.0f, 1.0f, 0.0f);
            GL.Vertex3(ltf);
            GL.Vertex3(rtf);
            GL.Vertex3(rtb);
            GL.Vertex3(ltb);
            GL.End();

            GL.Disable(EnableCap.Blend);
        }
Exemplo n.º 41
0
 public IFluentCarrier DeleteCarrier(Carrier deleteObject)
 {
     unitOfWork.carrierRepository.DeleteObject(deleteObject);
     this.processStatus = CreateProcessStatus.Delete;
     return(this as IFluentCarrier);
 }
Exemplo n.º 42
0
        public async Task <IActionResult> Register(Account account)
        {
            account.AccountId = Guid.NewGuid().ToString().Replace("-", "");

            if (ModelState.IsValid)
            {
                var mailAddress = new MailAddress(account.AccountEmail);
                account.AccountUserName = mailAddress.User;

                var userObject = new CustomUser
                {
                    Id             = account.AccountId,
                    Email          = account.AccountEmail,
                    UserName       = account.AccountUserName,
                    Role           = account.AccountRole,
                    PhoneNumber    = account.AccountPhoneNumber,
                    LockoutEnabled = false
                };

                var userCreationResult = await _userManager.CreateAsync(userObject, account.UserPassword);

                if (userCreationResult.Succeeded)
                {
                    if (account.AccountRole == "Consumer")
                    {
                        var consumer = new Consumer
                        {
                            ConsumerId     = account.AccountId,
                            Account        = account,
                            CustomerStatus = "Silver"
                        };
                        _context.Add(consumer);
                        _context.Add(account);
                        await _context.SaveChangesAsync();

                        await _signInManager.SignInAsync(userObject, isPersistent : true);

                        return(RedirectToAction("Index", "Consumer", new
                        {
                            connId = account.AccountId
                        }));
                    }
                    if (account.AccountRole == "Restaurant")
                    {
                        var restaurant = new Restaurant
                        {
                            RestaurantId            = account.AccountId,
                            Account                 = account,
                            RestaurantStatus        = "Silver",
                            RestaurantAverageRating = 0.0f
                        };
                        _context.Add(restaurant);
                        _context.Add(account);
                        await _context.SaveChangesAsync();

                        await _signInManager.SignInAsync(userObject, isPersistent : true);

                        return(RedirectToAction("Index", "Restaurant", new
                        {
                            resId = account.AccountId
                        }));
                    }

                    var carrier = new Carrier
                    {
                        CarrierId            = account.AccountId,
                        Account              = account,
                        CarrierStatus        = "Silver",
                        CarrierAverageRating = 0.0f
                    };
                    _context.Add(carrier);
                    _context.Add(account);
                    await _context.SaveChangesAsync();

                    await _signInManager.SignInAsync(userObject, isPersistent : true);

                    return(RedirectToAction("Index", "Carrier", new
                    {
                        carrIId = account.AccountId
                    }));
                }

                foreach (var error in userCreationResult.Errors)
                {
                    ModelState.AddModelError("", error.Description);
                }
            }
            return(View(account));
        }
Exemplo n.º 43
0
        private void copyCarrier(int sourceCarrierID)
        {
            Carrier carrier = null;
            List<CarrierLocation> carrierLocations = null;
            int copyCarrierID = 0;

            carrier = CarrierManager.Get(sourceCarrierID);
            if (carrier != null) {
                Carrier copyCarrier = new Carrier();

                copyCarrier.AddressLine1 = carrier.AddressLine1;
                copyCarrier.AddressLine2 = carrier.AddressLine2;
                copyCarrier.CarrierName = carrier.CarrierName;
                copyCarrier.CityID = carrier.CityID;
                copyCarrier.CityName = carrier.CityName;
                copyCarrier.ClientID = carrier.ClientID;
                copyCarrier.CountryID = carrier.CountryID;
                copyCarrier.IsActive = true;
                copyCarrier.StateID = carrier.StateID;
                copyCarrier.StateName = carrier.StateName;
                copyCarrier.ZipCodeID = carrier.ZipCodeID;
                copyCarrier.ZipCode = carrier.ZipCode;

                using (TransactionScope scope = new TransactionScope()) {
                    try {
                        copyCarrier = CarrierManager.Save(copyCarrier);

                        if (carrier.CarrierLocation != null) {
                            copyCarrierID = copyCarrier.CarrierID;

                            carrierLocations = carrier.CarrierLocation.ToList();

                            copyCarrierLocations(carrierLocations, copyCarrierID);
                        }

                        if (carrier.CarrierInvoiceProfile != null)
                            copyCarrierInvoiceProfiles(carrier.CarrierInvoiceProfile.ToList(), copyCarrierID);

                        copyCarrierContacts(sourceCarrierID, copyCarrierID);

                        scope.Complete();
                    }
                    catch (Exception ex) {
                        Core.EmailHelper.emailError(ex);
                    }
                }

                // refresh grid
                DoBind();
            }
        }
Exemplo n.º 44
0
 public async Task <int> Post([FromBody] Carrier carrier)
 {
     return(await _carrierRepository.AddAsync(carrier));
 }
        public async Task UpdateAsync(Carrier carrier)
        {
            await _context.Carriers.UpdateAsync(carrier);

            await _context.SaveChangesAsync();
        }
 /// <summary>
 /// REQUIRED. Carrier name. Valid values include: USPS
 /// </summary>
 /// <param name="c">The carrier</param>
 /// <returns></returns>
 public RatesArrayFluent <T> Carrier(Carrier c)
 {
     _current.Carrier = c;
     return(this);
 }
Exemplo n.º 47
0
        private static IUnit CreateUnit(UnitType type, int x, int y)
        {
            IUnit unit;

            switch (type)
            {
            case UnitType.Settlers: unit = new Settlers(); break;

            case UnitType.Militia: unit = new Militia(); break;

            case UnitType.Phalanx: unit = new Phalanx(); break;

            case UnitType.Legion: unit = new Legion(); break;

            case UnitType.Musketeers: unit = new Musketeers(); break;

            case UnitType.Riflemen: unit = new Riflemen(); break;

            case UnitType.Cavalry: unit = new Cavalry(); break;

            case UnitType.Knights: unit = new Knights(); break;

            case UnitType.Catapult: unit = new Catapult(); break;

            case UnitType.Cannon: unit = new Cannon(); break;

            case UnitType.Chariot: unit = new Chariot(); break;

            case UnitType.Armor: unit = new Armor(); break;

            case UnitType.MechInf: unit = new MechInf(); break;

            case UnitType.Artillery: unit = new Artillery(); break;

            case UnitType.Fighter: unit = new Fighter(); break;

            case UnitType.Bomber: unit = new Bomber(); break;

            case UnitType.Trireme: unit = new Trireme(); break;

            case UnitType.Sail: unit = new Sail(); break;

            case UnitType.Frigate: unit = new Frigate(); break;

            case UnitType.Ironclad: unit = new Ironclad(); break;

            case UnitType.Cruiser: unit = new Cruiser(); break;

            case UnitType.Battleship: unit = new Battleship(); break;

            case UnitType.Submarine: unit = new Submarine(); break;

            case UnitType.Carrier: unit = new Carrier(); break;

            case UnitType.Transport: unit = new Transport(); break;

            case UnitType.Nuclear: unit = new Nuclear(); break;

            case UnitType.Diplomat: unit = new Diplomat(); break;

            case UnitType.Caravan: unit = new Caravan(); break;

            default: return(null);
            }
            unit.X = x;
            unit.Y = y;
            return(unit);
        }
Exemplo n.º 48
0
 public async Task AddCarrierAsync(Carrier carrier)
 => await _carrierRepository.AddCarrierAsync(carrier);
Exemplo n.º 49
0
 ///<summary>Returns true if Update(Carrier,Carrier) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(Carrier carrier, Carrier oldCarrier)
 {
     if (carrier.CarrierName != oldCarrier.CarrierName)
     {
         return(true);
     }
     if (carrier.Address != oldCarrier.Address)
     {
         return(true);
     }
     if (carrier.Address2 != oldCarrier.Address2)
     {
         return(true);
     }
     if (carrier.City != oldCarrier.City)
     {
         return(true);
     }
     if (carrier.State != oldCarrier.State)
     {
         return(true);
     }
     if (carrier.Zip != oldCarrier.Zip)
     {
         return(true);
     }
     if (carrier.Phone != oldCarrier.Phone)
     {
         return(true);
     }
     if (carrier.ElectID != oldCarrier.ElectID)
     {
         return(true);
     }
     if (carrier.NoSendElect != oldCarrier.NoSendElect)
     {
         return(true);
     }
     if (carrier.IsCDA != oldCarrier.IsCDA)
     {
         return(true);
     }
     if (carrier.CDAnetVersion != oldCarrier.CDAnetVersion)
     {
         return(true);
     }
     if (carrier.CanadianNetworkNum != oldCarrier.CanadianNetworkNum)
     {
         return(true);
     }
     if (carrier.IsHidden != oldCarrier.IsHidden)
     {
         return(true);
     }
     if (carrier.CanadianEncryptionMethod != oldCarrier.CanadianEncryptionMethod)
     {
         return(true);
     }
     if (carrier.CanadianSupportedTypes != oldCarrier.CanadianSupportedTypes)
     {
         return(true);
     }
     //SecUserNumEntry excluded from update
     //SecDateEntry not allowed to change
     //SecDateTEdit can only be set by MySQL
     if (carrier.TIN != oldCarrier.TIN)
     {
         return(true);
     }
     if (carrier.CarrierGroupName != oldCarrier.CarrierGroupName)
     {
         return(true);
     }
     if (carrier.ApptTextBackColor != oldCarrier.ApptTextBackColor)
     {
         return(true);
     }
     if (carrier.IsCoinsuranceInverted != oldCarrier.IsCoinsuranceInverted)
     {
         return(true);
     }
     if (carrier.TrustedEtransFlags != oldCarrier.TrustedEtransFlags)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 50
0
 void Start()
 {
     target = FindObjectOfType <Carrier>();
 }
Exemplo n.º 51
0
 protected void ODS_Carrier_Updating(object sender, ObjectDataSourceMethodEventArgs e)
 {
     carrier = (Carrier)e.InputParameters[0];
     carrier.Code = carrier.Code.Trim();
     carrier.Name = carrier.Name.Trim();
     carrier.Country = carrier.Country.Trim();
     carrier.PaymentTerm = carrier.PaymentTerm.Trim();
     carrier.TradeTerm = carrier.TradeTerm.Trim();
     carrier.ReferenceSupplier = carrier.ReferenceSupplier.Trim();
 }
Exemplo n.º 52
0
        public Carrier VisionInspect(HGAStatus hgaStatus, string CarrierID)
        {
            Carrier _carrier = new Carrier();

            if (Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
            {
                if (!HSTVision.Simulation)
                {
                    if (/*HSTMachine.Workcell.HSTSettings.Install.HGADetectionUsingVision && */ Machine.HSTMachine.Workcell.HSTSettings.Install.EnableVision)
                    {
                        if (_outputcamera != null)
                        {
                            if (_outputcamera.GrabManual(true))
                            {
                                if (_outputcameraVisionApp.RunToolBlock(_outputcamera.grabImage, CarrierID)) // return true if vision tool success
                                {
                                    _carrier.ImageFileName = _outputcameraVisionApp.ImageFileName();         //

                                    _carrier.Hga1.Hga_Status  = _outputcameraVisionApp.GetResult(0);
                                    _carrier.Hga2.Hga_Status  = _outputcameraVisionApp.GetResult(1);
                                    _carrier.Hga3.Hga_Status  = _outputcameraVisionApp.GetResult(2);
                                    _carrier.Hga4.Hga_Status  = _outputcameraVisionApp.GetResult(3);
                                    _carrier.Hga5.Hga_Status  = _outputcameraVisionApp.GetResult(4);
                                    _carrier.Hga6.Hga_Status  = _outputcameraVisionApp.GetResult(5);
                                    _carrier.Hga7.Hga_Status  = _outputcameraVisionApp.GetResult(6);
                                    _carrier.Hga8.Hga_Status  = _outputcameraVisionApp.GetResult(7);
                                    _carrier.Hga9.Hga_Status  = _outputcameraVisionApp.GetResult(8);
                                    _carrier.Hga10.Hga_Status = _outputcameraVisionApp.GetResult(9);
                                }
                            }
                            else
                            {
                                MessageBox.Show("Fail to acquire image");
                            }
                        }
                        else
                        {
                            MessageBox.Show("Output Camera not initialize...");
                        }
                    }
                    else
                    {
                        _carrier.Hga1.Hga_Status  = hgaStatus;
                        _carrier.Hga2.Hga_Status  = hgaStatus;
                        _carrier.Hga3.Hga_Status  = hgaStatus;
                        _carrier.Hga4.Hga_Status  = hgaStatus;
                        _carrier.Hga5.Hga_Status  = hgaStatus;
                        _carrier.Hga6.Hga_Status  = hgaStatus;
                        _carrier.Hga7.Hga_Status  = hgaStatus;
                        _carrier.Hga8.Hga_Status  = hgaStatus;
                        _carrier.Hga9.Hga_Status  = hgaStatus;
                        _carrier.Hga10.Hga_Status = hgaStatus;
                    }
                }
            }
            else
            {
                _carrier.Hga1.Hga_Status  = hgaStatus;
                _carrier.Hga2.Hga_Status  = hgaStatus;
                _carrier.Hga3.Hga_Status  = hgaStatus;
                _carrier.Hga4.Hga_Status  = hgaStatus;
                _carrier.Hga5.Hga_Status  = hgaStatus;
                _carrier.Hga6.Hga_Status  = hgaStatus;
                _carrier.Hga7.Hga_Status  = hgaStatus;
                _carrier.Hga8.Hga_Status  = hgaStatus;
                _carrier.Hga9.Hga_Status  = hgaStatus;
                _carrier.Hga10.Hga_Status = hgaStatus;
            }

            return(_carrier);
        }
Exemplo n.º 53
0
        public override void Initialise(Dictionary<string, object> input_dict)
        {
            // simulation domain inputs
            Get_From_Dictionary<double>(input_dict, "dz", ref dz_dens); dz_pot = dz_dens;
            Get_From_Dictionary(input_dict, "nz", ref nz_dens); nz_pot = nz_dens;

            // physics parameters are done by the base method
            base.Initialise(input_dict);
            Get_From_Dictionary<bool>(input_dict, "illuminated", ref illuminated, true);

            // check that the size of the domain [(nz_pot-1) * dz_pot] is not larger than the band structure
            if (layers[layers.Length - 1].Zmax - Geom_Tool.Get_Zmin(layers) < (Nz_Pot - 1) * Dz_Pot)
                throw new Exception("Error - the band structure provided is smaller than the simulation domain!\nUse nz = " + (int)Math.Ceiling((layers[layers.Length - 1].Zmax - Geom_Tool.Get_Zmin(layers)) / Dz_Pot) + " instead");
            // and check that the top of the domain is the surface (unless this check is overloaded)
            bool surface_override = false; Get_From_Dictionary<bool>(input_dict, "surface_check", ref surface_override, true);
            if (!surface_override && Geom_Tool.Find_Layer_Below_Surface(layers).Zmax - Geom_Tool.Get_Zmin(layers) - Nz_Pot * Dz_Pot != 0.0)
                throw new Exception("Error - the top of the domain is not the surface!\nUse the input \"surface_check\" to override");

            // calculate the top and bottom of the domain
            input_dict["zmin"] = Geom_Tool.Get_Zmin(layers);
            input_dict["zmax"] = Geom_Tool.Get_Zmin(layers) + dz_pot * nz_pot;

            // and split gate dimensions
            device_dimensions.Add("bottom_position", (double)input_dict["zmin"]);
            device_dimensions.Add("top_position", (double)input_dict["zmax"]);

            // check whether the bottom should be fixed
            if (input_dict.ContainsKey("bottom_V"))
                fix_bottom_V = true;

            // initialise the dictionary which contains the surface charges at each temperature
            surface_charge = new Dictionary<double, double>();

            // double check whether you want to use FlexPDE
            if (input_dict.ContainsKey("use_FlexPDE"))
                using_flexPDE = (bool)input_dict["use_FlexPDE"];

            // Initialise potential solver
            pois_solv = new OneD_PoissonSolver(this, using_flexPDE, input_dict);

            Initialise_DataClasses(input_dict);

            // if the input dictionary already has the dopent distribution, we don't need to recalculate it
            if (input_dict.ContainsKey("Dopent_Density"))
                dopents_calculated = true;

            // Get carrier type for DFT calculations (default is electron)
            if (input_dict.ContainsKey("carrier_type"))
                carrier_type = (Carrier)Enum.Parse(typeof(Carrier), (string)input_dict["carrier_type"]);

            Console.WriteLine("Experimental parameters initialised");
        }
Exemplo n.º 54
0
 /// <summary>
 /// Writes the log entry according to the setting of the Log MonoBehaviour instance.
 /// </summary>
 public static void Write(string message, LogRecordType type = LogRecordType.Message, bool disallowMirrorToConsole = false)
 {
     Carrier.WriteToLog(message, type, disallowMirrorToConsole);
 }
Exemplo n.º 55
0
		///<summary>Only for creating the IN1 segment(s).</summary>
		public static string GenerateFieldIN1(HL7Def def,string fieldName,int sequenceNum,PatPlan patplanCur,InsSub inssubCur,InsPlan insplanCur,Carrier carrierCur,int patplanCount,Patient patSub) {
			switch(fieldName) {
				#region Carrier
				case "carrier.addressCityStateZip":
					if(carrierCur==null) {
						return "";
					}
					return gConcat(def.ComponentSeparator,carrierCur.Address,carrierCur.Address2,carrierCur.City,carrierCur.State,carrierCur.Zip);
				case "carrier.CarrierName":
					if(carrierCur==null) {
						return "";
					}
					return carrierCur.CarrierName;
				case "carrier.ElectID":
					if(carrierCur==null) {
						return "";
					}
					return carrierCur.ElectID;
				case "carrier.Phone":
					//Example: ^WPN^PH^^^800^3635432
					if(carrierCur==null) {
						return "";
					}
					string carrierPh=gXTN(carrierCur.Phone,10);
					if(carrierPh=="") {
						return "";
					}
					return gConcat(def.ComponentSeparator,"","WPN","PH","","",carrierPh.Substring(0,3),carrierPh.Substring(3));//carrierPh guaranteed to be 10 digits or blank
				#endregion Carrier
				#region InsPlan
				case "insplan.cob":
					if(insplanCur==null) {
						return "";
					}
					if(patplanCount>1) {
						return "CO";
					}
					return "IN";
				case "insplan.coverageType":
					if(insplanCur==null) {
						return "";
					}
					if(insplanCur.IsMedical) {
						return "M";
					}
					return "D";
				case "insplan.empName":
					if(insplanCur==null) {
						return "";
					}
					return Employers.GetName(insplanCur.EmployerNum);//will return empty string if EmployerNum=0 or not found
				case "insplan.GroupName":
					if(insplanCur==null) {
						return "";
					}
					return insplanCur.GroupName;
				case "insplan.GroupNum":
					if(insplanCur==null) {
						return "";
					}
					return insplanCur.GroupNum;
				case "insplan.planNum":
					//Example: 2.16.840.1.113883.3.4337.1486.6566.7.1234
					//If OID for insplan is not set, then it will be ODInsPlan.1234 (where 1234=PlanNum)
					if(insplanCur==null) {
						return "";
					}
					OIDInternal insplanOid=OIDInternals.GetForType(IdentifierType.InsPlan);//returns root+".7" or whatever they have set in their oidinternal table for type InsPlan
					string insplanOidRoot="ODInsPlan";
					if(insplanOid!=null && insplanOid.IDRoot!="") {
						insplanOidRoot=insplanOid.IDRoot;
					}
					return insplanOidRoot+"."+insplanCur.PlanNum;//tack on "."+PlanNum for extension
				case "insplan.PlanType":
					if(insplanCur==null) {
						return "";
					}
					if(insplanCur.PlanType=="p") {
						return "PPO Percentage";
					}
					if(insplanCur.PlanType=="f") {
						return "Medicaid or Flat Copay";
					}
					if(insplanCur.PlanType=="c") {
						return "Capitation";
					}
					return "Category Percentage";
				#endregion InsPlan
				#region InsSub
				case "inssub.AssignBen":
					if(inssubCur==null) {
						return "";
					}
					if(inssubCur.AssignBen) {
						return "Y";
					}
					return "N";
				case "inssub.DateEffective":
					if(inssubCur==null || inssubCur.DateEffective==DateTime.MinValue) {
						return "";
					}
					return gDTM(inssubCur.DateEffective,8);
				case "inssub.DateTerm":
					if(inssubCur==null || inssubCur.DateTerm==DateTime.MinValue) {
						return "";
					}
					return gDTM(inssubCur.DateTerm,8);
				case "inssub.ReleaseInfo":
					if(inssubCur==null) {
						return "";
					}
					if(inssubCur.ReleaseInfo) {
						return "Y";
					}
					return "N";
				case "inssub.subAddrCityStateZip":
					if(patSub==null) {
						return "";
					}
					return gConcat(def.ComponentSeparator,patSub.Address,patSub.Address2,patSub.City,patSub.State,patSub.Zip);
				case "inssub.subBirthdate":
					if(patSub==null) {
						return "";
					}
					return gDTM(patSub.Birthdate,8);
				case "inssub.SubscriberID":
					if(inssubCur==null) {
						return "";
					}
					return inssubCur.SubscriberID;
				case "inssub.subscriberName":
					if(patSub==null) {
						return "";
					}
					return gConcat(def.ComponentSeparator,patSub.LName,patSub.FName,patSub.MiddleI);
				#endregion InsSub
				#region PatPlan
				case "patplan.Ordinal":
					if(patplanCur==null) {
						return "";
					}
					return patplanCur.Ordinal.ToString();
				case "patplan.policyNum":
					if(patplanCur==null || inssubCur==null) {
						return "";
					}
					if(patplanCur.PatID!="") {
						return patplanCur.PatID;
					}
					return inssubCur.SubscriberID;
				case "patplan.subRelationToPat":
					//SEL-Self, SPO-Spouse, DOM-LifePartner, CHD-Child (PAR-Parent), EME-Employee (EMR-Employer)
					//DEP-HandicapDep (GRD-Guardian), DEP-Dependent, OTH-SignifOther (OTH-Other), OTH-InjuredPlantiff
					//We store relationship to subscriber and they want subscriber's relationship to patient, therefore
					//Relat.Child will return "PAR" for Parent, Relat.Employee will return "EMR" for Employer, and Relat.HandicapDep and Relat.Dependent will return "GRD" for Guardian
					//Example: |PAR^Parent|
					if(patplanCur==null) {
						return "";
					}
					if(patplanCur.Relationship==Relat.Self) {
						return gConcat(def.ComponentSeparator,"SEL","Self");
					}
					if(patplanCur.Relationship==Relat.Spouse) {
						return gConcat(def.ComponentSeparator,"SPO","Spouse");
					}
					if(patplanCur.Relationship==Relat.LifePartner) {
						return gConcat(def.ComponentSeparator,"DOM","Life Partner");
					}
					if(patplanCur.Relationship==Relat.Child) {
						return gConcat(def.ComponentSeparator,"PAR","Parent");
					}
					if(patplanCur.Relationship==Relat.Employee) {
						return gConcat(def.ComponentSeparator,"EMR","Employer");
					}
					if(patplanCur.Relationship==Relat.Dependent || patplanCur.Relationship==Relat.HandicapDep) {
						return gConcat(def.ComponentSeparator,"GRD","Guardian");
					}
					//if Relat.SignifOther or Relat.InjuredPlaintiff or any others
					return gConcat(def.ComponentSeparator,"OTH","Other");
				#endregion PatPlan
				case "sequenceNum":
					return sequenceNum.ToString();
				default:
					return "";
			}
		}
Exemplo n.º 56
0
        ///<summary>Returns null if there is no HL7Def enabled or if there is no outbound DFT defined for the enabled HL7Def.</summary>
        public static MessageHL7 GenerateDFT(List <Procedure> listProcs, EventTypeHL7 eventType, Patient pat, Patient guar, long aptNum, string pdfDescription, string pdfDataString)
        {
            //In \\SERVERFILES\storage\OPEN DENTAL\Programmers Documents\Standards (X12, ADA, etc)\HL7\Version2.6\V26_CH02_Control_M4_JAN2007.doc
            //On page 28, there is a Message Construction Pseudocode as well as a flowchart which might help.
            MessageHL7 msgHl7 = new MessageHL7(MessageTypeHL7.DFT);
            HL7Def     hl7Def = HL7Defs.GetOneDeepEnabled();

            if (hl7Def == null)
            {
                return(null);
            }
            //find a DFT message in the def
            HL7DefMessage hl7DefMessage = null;

            for (int i = 0; i < hl7Def.hl7DefMessages.Count; i++)
            {
                if (hl7Def.hl7DefMessages[i].MessageType == MessageTypeHL7.DFT && hl7Def.hl7DefMessages[i].InOrOut == InOutHL7.Outgoing)
                {
                    hl7DefMessage = hl7Def.hl7DefMessages[i];
                    //continue;
                    break;
                }
            }
            if (hl7DefMessage == null)           //DFT message type is not defined so do nothing and return
            {
                return(null);
            }
            if (PrefC.GetBool(PrefName.ShowFeaturePatientClone))
            {
                pat = Patients.GetOriginalPatientForClone(pat);
            }
            Provider       prov         = Providers.GetProv(Patients.GetProvNum(pat));
            Appointment    apt          = Appointments.GetOneApt(aptNum);
            List <PatPlan> listPatPlans = PatPlans.Refresh(pat.PatNum);

            for (int i = 0; i < hl7DefMessage.hl7DefSegments.Count; i++)
            {
                int repeatCount = 1;
                if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.FT1)
                {
                    repeatCount = listProcs.Count;
                }
                else if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.IN1)
                {
                    repeatCount = listPatPlans.Count;
                }
                //for example, countRepeat can be zero in the case where we are only sending a PDF of the TP to eCW, and no procs.
                //or the patient does not have any current insplans for IN1 segments
                for (int j = 0; j < repeatCount; j++)           //FT1 is optional and can repeat so add as many FT1's as procs in procList, IN1 is optional and can repeat as well, repeat for the number of patplans in patplanList
                {
                    if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.FT1 && listProcs.Count > j)
                    {
                        prov = Providers.GetProv(listProcs[j].ProvNum);
                    }
                    Procedure proc = null;
                    if (listProcs.Count > j)                   //procList could be an empty list
                    {
                        proc = listProcs[j];
                    }
                    PatPlan patPlanCur = null;
                    InsPlan insPlanCur = null;
                    InsSub  insSubCur  = null;
                    Carrier carrierCur = null;
                    Patient subscriber = null;
                    if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.IN1)
                    {
                        patPlanCur = listPatPlans[j];
                        insSubCur  = InsSubs.GetOne(patPlanCur.InsSubNum);
                        insPlanCur = InsPlans.RefreshOne(insSubCur.PlanNum);
                        carrierCur = Carriers.GetCarrier(insPlanCur.CarrierNum);
                        subscriber = Patients.GetPat(insSubCur.Subscriber);
                    }
                    SegmentHL7 seg = new SegmentHL7(hl7DefMessage.hl7DefSegments[i].SegmentName);
                    seg.SetField(0, hl7DefMessage.hl7DefSegments[i].SegmentName.ToString());
                    for (int f = 0; f < hl7DefMessage.hl7DefSegments[i].hl7DefFields.Count; f++)
                    {
                        string fieldName = hl7DefMessage.hl7DefSegments[i].hl7DefFields[f].FieldName;
                        if (fieldName == "")                       //If fixed text instead of field name just add text to segment
                        {
                            seg.SetField(hl7DefMessage.hl7DefSegments[i].hl7DefFields[f].OrdinalPos, hl7DefMessage.hl7DefSegments[i].hl7DefFields[f].FixedText);
                        }
                        else
                        {
                            string fieldValue = "";
                            if (hl7DefMessage.hl7DefSegments[i].SegmentName == SegmentNameHL7.IN1)
                            {
                                fieldValue = FieldConstructor.GenerateFieldIN1(hl7Def, fieldName, j + 1, patPlanCur, insSubCur, insPlanCur, carrierCur, listPatPlans.Count, subscriber);
                            }
                            else
                            {
                                fieldValue = FieldConstructor.GenerateField(hl7Def, fieldName, MessageTypeHL7.DFT, pat, prov, proc, guar, apt, j + 1, eventType,
                                                                            pdfDescription, pdfDataString, MessageStructureHL7.DFT_P03, seg.Name);
                            }
                            seg.SetField(hl7DefMessage.hl7DefSegments[i].hl7DefFields[f].OrdinalPos, fieldValue);
                        }
                    }
                    msgHl7.Segments.Add(seg);
                }
            }
            return(msgHl7);
        }
Exemplo n.º 57
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string  assignmentInstructions = null;
            Carrier carrier              = null;
            bool    isSuccess            = true;
            Leads   lead                 = null;
            string  lossPerilDescription = null;

            CRM.Data.Entities.LeadPolicy policy = collectPolicyDataFromUI();
            int policyID = 0;

            lblMessage.Text = string.Empty;

            using (TransactionScope scope = new TransactionScope()) {
                try {
                    // save lead/claim
                    lead = saveLead();

                    // save carrier
                    carrier = saveCarrier();

                    // save carrier contact
                    saveContact(carrier.CarrierID);

                    // save policy
                    policy.LeadId = lead.LeadId;

                    if (carrier != null)
                    {
                        policy.CarrierID = carrier.CarrierID;
                    }

                    policyID = LeadPolicyManager.Save(policy);

                    //saveCoverages(policyID);

                    // save assingment instructions in comments
                    if (!string.IsNullOrEmpty(txtAssignmentInstructions.Text))
                    {
                        assignmentInstructions = "<div><b>Assignment Instructions</b></div><div>" + this.txtAssignmentInstructions.Text.Trim() + "</div>";
                        saveComments(assignmentInstructions, (int)policy.PolicyType, lead.LeadId);
                    }

                    // save loss Peril Description in comments
                    if (!string.IsNullOrEmpty(this.txtLossPerilDescription.Text))
                    {
                        lossPerilDescription = "<div><b>Loss/Peril Description</b></div><div>" + this.txtLossPerilDescription.Text.Trim() + "</div>";
                        saveComments(lossPerilDescription, (int)policy.PolicyType, lead.LeadId);
                    }

                    // save final comments
                    saveComments(txtComments.Text.Trim(), (int)policy.PolicyType, lead.LeadId);

                    uploadFile(fileUpload1, lead.LeadId, txtfileUpload1.Text);
                    uploadFile(fileUpload2, lead.LeadId, txtfileUpload2.Text);
                    uploadFile(fileUpload3, lead.LeadId, txtfileUpload3.Text);
                    uploadFile(fileUpload4, lead.LeadId, txtfileUpload4.Text);
                    uploadFile(fileUpload5, lead.LeadId, txtfileUpload5.Text);

                    // complete transaction and alert user
                    scope.Complete();

                    //lblMessage.Text = "Data has been submitted successfully.";
                    //lblMessage.CssClass = "ok";
                    isSuccess = true;
                }
                catch (Exception ex) {
                    lblMessage.Text     = "Unable to submit data due to error.";
                    lblMessage.CssClass = "error";

                    isSuccess = false;
                }

                // reload page
                if (isSuccess)
                {
                    Response.Redirect("~/Protected/Intake/form.aspx");
                }
            }
        }
Exemplo n.º 58
0
 public void CarrierChanged(Carrier entity, UpdateOperations operation)
 {
     CheckIsAdminOrSystem();
 }
Exemplo n.º 59
0
        private Vehicle BuildVehicle(Vehicle vehicle, Driver driver, Carrier carrier, double distanceFromGivenPosition = 0, 
            bool includePicture = true)
        {
            //the idea is remove reference for improve 
            //client work without $ref
            var created = new Vehicle
            {
                VehicleId = vehicle.VehicleId,
                CarrierId = vehicle.CarrierId,
                Picture = includePicture ? vehicle.Picture : null,
                DriverId = vehicle.DriverId,
                LicensePlate = vehicle.LicensePlate,
                DistanceFromGivenPosition = distanceFromGivenPosition,
                Make = vehicle.Make,
                Latitude = vehicle.Latitude,
                Longitude = vehicle.Longitude,
                Model = vehicle.Model,
                Seats = vehicle.Seats,
                Type = vehicle.Type,
                VehicleStatus = vehicle.VehicleStatus,
                Rate = vehicle.Rate,
                RatingAvg = vehicle.RatingAvg,
                TotalRides = vehicle.TotalRides,
                DeviceId = vehicle.DeviceId,
                Driver = driver == null ? null : new Driver()
                {
                    DriverId = driver.DriverId,
                    Name = driver.Name,
                    Phone = driver.Phone
                },
                Carrier = carrier == null ? null : new Carrier()
                {
                    Picture = carrier.Picture
                },
            };

            return created;
        }
Exemplo n.º 60
0
        ///<summary>Sends data for Patient.Cur to an export file and then launches an exe to notify PT.  If patient exists, this simply opens the patient.  If patient does not exist, then this triggers creation of the patient in PT Dental.  If isUpdate is true, then the export file and exe will have different names. In PT, update is a separate programlink with a separate button.</summary>
        public static void SendData(Program ProgramCur, Patient pat, bool isUpdate)
        {
            //ArrayList ForProgram=ProgramProperties.GetForProgram(ProgramCur.ProgramNum);
            //ProgramProperty PPCur=ProgramProperties.GetCur(ForProgram, "InfoFile path");
            //string infoFile=PPCur.PropertyValue;
            if (!Directory.Exists(dir))
            {
                MessageBox.Show(dir + " does not exist.  PT Dental doesn't seem to be properly installed on this computer.");
                return;
            }
            if (pat == null)
            {
                MessageBox.Show("No patient is selected.");
                return;
            }
            if (!File.Exists(dir + "\\" + exportAddExe))
            {
                MessageBox.Show(dir + "\\" + exportAddExe + " does not exist.  PT Dental doesn't seem to be properly installed on this computer.");
                return;
            }
            if (!File.Exists(dir + "\\" + exportUpdateExe))
            {
                MessageBox.Show(dir + "\\" + exportUpdateExe + " does not exist.  PT Dental doesn't seem to be properly installed on this computer.");
                return;
            }
            string filename = dir + "\\" + exportAddCsv;

            if (isUpdate)
            {
                filename = dir + "\\" + exportUpdateCsv;
            }
            using (StreamWriter sw = new StreamWriter(filename, false)){               //overwrites if it already exists.
                sw.WriteLine("PAT_PK,PAT_LOGFK,PAT_LANFK,PAT_TITLE,PAT_FNAME,PAT_MI,PAT_LNAME,PAT_CALLED,PAT_ADDR1,PAT_ADDR2,PAT_CITY,PAT_ST,PAT_ZIP,PAT_HPHN,PAT_WPHN,PAT_EXT,PAT_FAX,PAT_PAGER,PAT_CELL,PAT_EMAIL,PAT_SEX,PAT_EDOCS,PAT_STATUS,PAT_TYPE,PAT_BIRTH,PAT_SSN,PAT_NOCALL,PAT_NOCORR,PAT_DISRES,PAT_LSTUPD,PAT_INSNM,PAT_INSGPL,PAT_INSAD1,PAT_INSAD2,PAT_INSCIT,PAT_INSST,PAT_INSZIP,PAT_INSPHN,PAT_INSEXT,PAT_INSCON,PAT_INSGNO,PAT_EMPNM,PAT_EMPAD1,PAT_EMPAD2,PAT_EMPCIT,PAT_EMPST,PAT_EMPZIP,PAT_EMPPHN,PAT_REFLNM,PAT_REFFNM,PAT_REFMI,PAT_REFPHN,PAT_REFEML,PAT_REFSPE,PAT_NOTES,PAT_FPSCAN,PAT_PREMED,PAT_MEDS,PAT_FTSTUD,PAT_PTSTUD,PAT_COLLEG,PAT_CHRTNO,PAT_OTHID,PAT_RESPRT,PAT_POLHLD,PAT_CUSCD,PAT_PMPID");
                sw.Write(",");                                                         //PAT_PK  Primary key. Long alphanumeric. We do not use.
                sw.Write(",");                                                         //PAT_LOGFK Internal PT logical, it can be ignored.
                sw.Write(",");                                                         //PAT_LANFK Internal PT logical, it can be ignored.
                sw.Write(",");                                                         //PAT_TITLE We do not have this field yet
                sw.Write(Tidy(pat.FName) + ",");                                       //PAT_FNAME
                sw.Write(Tidy(pat.MiddleI) + ",");                                     //PAT_MI
                sw.Write(Tidy(pat.LName) + ",");                                       //PAT_LNAME
                sw.Write(Tidy(pat.Preferred) + ",");                                   //PAT_CALLED Nickname
                sw.Write(Tidy(pat.Address) + ",");                                     //PAT_ADDR1
                sw.Write(Tidy(pat.Address2) + ",");                                    //PAT_ADDR2
                sw.Write(Tidy(pat.City) + ",");                                        //PAT_CITY
                sw.Write(Tidy(pat.State) + ",");                                       //PAT_ST
                sw.Write(Tidy(pat.Zip) + ",");                                         //PAT_ZIP
                sw.Write(TelephoneNumbers.FormatNumbersOnly(pat.HmPhone) + ",");       //PAT_HPHN No punct
                sw.Write(TelephoneNumbers.FormatNumbersOnly(pat.WkPhone) + ",");       //PAT_WPHN
                sw.Write(",");                                                         //PAT_EXT
                sw.Write(",");                                                         //PAT_FAX
                sw.Write(",");                                                         //PAT_PAGER
                sw.Write(TelephoneNumbers.FormatNumbersOnly(pat.WirelessPhone) + ","); //PAT_CELL
                sw.Write(Tidy(pat.Email) + ",");                                       //PAT_EMAIL
                if (pat.Gender == PatientGender.Female)
                {
                    sw.Write("Female");
                }
                else if (pat.Gender == PatientGender.Male)
                {
                    sw.Write("Male");
                }
                sw.Write(",");                            //PAT_SEX might be blank if unknown
                sw.Write(",");                            //PAT_EDOCS Internal PT logical, it can be ignored.
                sw.Write(pat.PatStatus.ToString() + ","); //PAT_STATUS Any text allowed
                sw.Write(pat.Position.ToString() + ",");  //PAT_TYPE Any text allowed
                if (pat.Birthdate.Year > 1880)
                {
                    sw.Write(pat.Birthdate.ToString("MM/dd/yyyy"));                    //PAT_BIRTH MM/dd/yyyy
                }
                sw.Write(",");
                sw.Write(Tidy(pat.SSN) + ",");              //PAT_SSN No punct
                if (pat.PreferContactMethod == ContactMethod.DoNotCall ||
                    pat.PreferConfirmMethod == ContactMethod.DoNotCall ||
                    pat.PreferRecallMethod == ContactMethod.DoNotCall)
                {
                    sw.Write("1");
                }
                sw.Write(",");                //PAT_NOCALL T if no call
                sw.Write(",");                //PAT_NOCORR No correspondence HIPAA
                sw.Write(",");                //PAT_DISRES Internal PT logical, it can be ignored.
                sw.Write(",");                //PAT_LSTUPD Internal PT logical, it can be ignored.
                List <PatPlan> patPlanList = PatPlans.Refresh(pat.PatNum);
                Family         fam         = Patients.GetFamily(pat.PatNum);
                List <InsSub>  subList     = InsSubs.RefreshForFam(fam);
                List <InsPlan> planList    = InsPlans.RefreshForSubList(subList);
                PatPlan        patplan     = null;
                InsSub         sub         = null;
                InsPlan        plan        = null;
                Carrier        carrier     = null;
                Employer       emp         = null;
                if (patPlanList.Count > 0)
                {
                    patplan = patPlanList[0];
                    sub     = InsSubs.GetSub(patplan.InsSubNum, subList);
                    plan    = InsPlans.GetPlan(sub.PlanNum, planList);
                    carrier = Carriers.GetCarrier(plan.CarrierNum);
                    if (plan.EmployerNum != 0)
                    {
                        emp = Employers.GetEmployer(plan.EmployerNum);
                    }
                }
                if (plan == null)
                {
                    sw.Write(",");                    //PAT_INSNM
                    sw.Write(",");                    //PAT_INSGPL Ins group plan name
                    sw.Write(",");                    //PAT_INSAD1
                    sw.Write(",");                    //PAT_INSAD2
                    sw.Write(",");                    //PAT_INSCIT
                    sw.Write(",");                    //PAT_INSST
                    sw.Write(",");                    //PAT_INSZIP
                    sw.Write(",");                    //PAT_INSPHN
                }
                else
                {
                    sw.Write(Tidy(carrier.CarrierName) + ",");                         //PAT_INSNM
                    sw.Write(Tidy(plan.GroupName) + ",");                              //PAT_INSGPL Ins group plan name
                    sw.Write(Tidy(carrier.Address) + ",");                             //PAT_INSAD1
                    sw.Write(Tidy(carrier.Address2) + ",");                            //PAT_INSAD2
                    sw.Write(Tidy(carrier.City) + ",");                                //PAT_INSCIT
                    sw.Write(Tidy(carrier.State) + ",");                               //PAT_INSST
                    sw.Write(Tidy(carrier.Zip) + ",");                                 //PAT_INSZIP
                    sw.Write(TelephoneNumbers.FormatNumbersOnly(carrier.Phone) + ","); //PAT_INSPHN
                }
                sw.Write(",");                                                         //PAT_INSEXT
                sw.Write(",");                                                         //PAT_INSCON Ins contact person
                if (plan == null)
                {
                    sw.Write(",");
                }
                else
                {
                    sw.Write(Tidy(plan.GroupNum) + ",");                  //PAT_INSGNO Ins group number
                }
                if (emp == null)
                {
                    sw.Write(",");                    //PAT_EMPNM
                }
                else
                {
                    sw.Write(Tidy(emp.EmpName) + ","); //PAT_EMPNM
                }
                sw.Write(",");                         //PAT_EMPAD1
                sw.Write(",");                         //PAT_EMPAD2
                sw.Write(",");                         //PAT_EMPCIT
                sw.Write(",");                         //PAT_EMPST
                sw.Write(",");                         //PAT_EMPZIP
                sw.Write(",");                         //PAT_EMPPHN

                /*we don't support employer info yet.
                 * sw.Write(Tidy(emp.Address)+",");//PAT_EMPAD1
                 * sw.Write(Tidy(emp.Address2)+",");//PAT_EMPAD2
                 * sw.Write(Tidy(emp.City)+",");//PAT_EMPCIT
                 * sw.Write(Tidy(emp.State)+",");//PAT_EMPST
                 * sw.Write(Tidy(emp.State)+",");//PAT_EMPZIP
                 * sw.Write(TelephoneNumbers.FormatNumbersOnly(emp.Phone)+",");//PAT_EMPPHN*/
                Referral referral = Referrals.GetReferralForPat(pat.PatNum);              //could be null
                if (referral == null)
                {
                    sw.Write(",");                    //PAT_REFLNM
                    sw.Write(",");                    //PAT_REFFNM
                    sw.Write(",");                    //PAT_REFMI
                    sw.Write(",");                    //PAT_REFPHN
                    sw.Write(",");                    //PAT_REFEML Referral source email
                    sw.Write(",");                    //PAT_REFSPE Referral specialty. Customizable, so any allowed
                }
                else
                {
                    sw.Write(Tidy(referral.LName) + ",");                //PAT_REFLNM
                    sw.Write(Tidy(referral.FName) + ",");                //PAT_REFFNM
                    sw.Write(Tidy(referral.MName) + ",");                //PAT_REFMI
                    sw.Write(referral.Telephone + ",");                  //PAT_REFPHN
                    sw.Write(Tidy(referral.EMail) + ",");                //PAT_REFEML Referral source email
                    if (referral.PatNum == 0 && !referral.NotPerson)     //not a patient, and is a person
                    {
                        sw.Write(Defs.GetName(DefCat.ProviderSpecialties, referral.Specialty));
                    }
                    sw.Write(",");            //PAT_REFSPE Referral specialty. Customizable, so any allowed
                }
                sw.Write(",");                //PAT_NOTES No limits.  We won't use this right now for exports.
                //sw.Write(",");//PAT_NOTE1-PAT_NOTE10 skipped
                sw.Write(",");                //PAT_FPSCAN Internal PT logical, it can be ignored.
                if (pat.Premed)
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                        //PAT_PREMED F or T
                sw.Write(Tidy(pat.MedUrgNote) + ","); //PAT_MEDS The meds that they must premedicate with.
                if (pat.StudentStatus == "F")         //fulltime
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                //PAT_FTSTUD T/F
                if (pat.StudentStatus == "P") //parttime
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                         //PAT_PTSTUD
                sw.Write(Tidy(pat.SchoolName) + ",");  //PAT_COLLEG Name of college
                sw.Write(Tidy(pat.ChartNumber) + ","); //PAT_CHRTNO
                sw.Write(pat.PatNum.ToString() + ","); //PAT_OTHID The primary key in Open Dental ************IMPORTANT***************
                if (pat.PatNum == pat.Guarantor)
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");                                    //PAT_RESPRT Responsible party checkbox T/F
                if (plan != null && pat.PatNum == sub.Subscriber) //if current patient is the subscriber on their primary plan
                {
                    sw.Write("1");
                }
                else
                {
                    sw.Write("0");
                }
                sw.Write(",");               //PAT_POLHLD Policy holder checkbox T/F
                sw.Write(",");               //PAT_CUSCD Web sync folder, used internally this can be ignored.
                sw.Write("");                //PAT_PMPID Practice Management Program ID. Can be ignored
                sw.WriteLine();
            }
            try{
                if (isUpdate)
                {
                    Process.Start(dir + "\\" + exportUpdateExe);                //already validated to exist
                }
                else
                {
                    Process.Start(dir + "\\" + exportAddExe);                //already validated to exist
                }
                //MessageBox.Show("done");
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }