protected void RadComboShipmentKey_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e) { int id = int.Parse(this.RadComboShipmentKey.SelectedValue.Split(',')[0]); int shipmentid = int.Parse(this.RadComboShipmentKey.SelectedValue.Split(',')[1]); if (id > 0 && shipmentid > 0) { ViewState["DistributorClientAddress"] = id; ViewState["ShipmentID"] = shipmentid; DistributorClientAddressBO objDistributorClientAddress = new DistributorClientAddressBO(); objDistributorClientAddress.ID = id; objDistributorClientAddress.GetObject(); ShipmentModeBO objShipmentMode = new ShipmentModeBO(); objShipmentMode.ID = shipmentid; objShipmentMode.GetObject(); this.txtShipTo.Text = objDistributorClientAddress.CompanyName; this.txtShipmentMode.Text = objShipmentMode.Name; string state = (objDistributorClientAddress.State != null) ? objDistributorClientAddress.Suburb : string.Empty; this.lblShipmentKeyAddress.Text = objDistributorClientAddress.CompanyName + " , " + objDistributorClientAddress.Address + " , " + objDistributorClientAddress.Suburb + " " + state + " , " + objDistributorClientAddress.objCountry.ShortName + " , " + objDistributorClientAddress.PostCode; this.populateInvoiceOrders(0, id, true, shipmentid, false); } }
private void ProcessForm(int shipmentmodeId, bool isDelete) { try { using (TransactionScope ts = new TransactionScope()) { ShipmentModeBO objShipmentMode = new ShipmentModeBO(this.ObjContext); if (shipmentmodeId > 0) { //Update Data objShipmentMode.ID = shipmentmodeId; objShipmentMode.GetObject(); objShipmentMode.Name = this.txtShipmentModeName.Text; objShipmentMode.Description = this.txtDescription.Text; if (isDelete) { objShipmentMode.Delete(); } } else { objShipmentMode.Name = this.txtShipmentModeName.Text; objShipmentMode.Description = this.txtDescription.Text; objShipmentMode.Add(); } this.ObjContext.SaveChanges(); ts.Complete(); } } catch (Exception ex) { //throw ex; } }