public async Task <IActionResult> Edit(int id, [Bind("ID,Postcode,City,State")] SAddress sAddress) { if (id != sAddress.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sAddress); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SAddressExists(sAddress.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sAddress)); }
public async Task <IActionResult> Create([Bind("ID,Postcode,City,State")] SAddress sAddress) { if (ModelState.IsValid) { _context.Add(sAddress); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(sAddress)); }
internal void Encode(AsnWriter writer, Asn1Tag tag) { writer.PushSequence(tag); writer.PushSequence(new Asn1Tag(TagClass.ContextSpecific, 0)); writer.PushSequence(); for (int i = 0; i < TicketInfo.Length; i++) { TicketInfo[i]?.Encode(writer); } writer.PopSequence(); writer.PopSequence(new Asn1Tag(TagClass.ContextSpecific, 0)); if (Asn1Extension.HasValue(Nonce)) { writer.PushSequence(new Asn1Tag(TagClass.ContextSpecific, 1)); writer.WriteInteger(Nonce.Value); writer.PopSequence(new Asn1Tag(TagClass.ContextSpecific, 1)); } if (Asn1Extension.HasValue(Timestamp)) { writer.PushSequence(new Asn1Tag(TagClass.ContextSpecific, 2)); writer.WriteGeneralizedTime(Timestamp.Value); writer.PopSequence(new Asn1Tag(TagClass.ContextSpecific, 2)); } if (Asn1Extension.HasValue(USec)) { writer.PushSequence(new Asn1Tag(TagClass.ContextSpecific, 3)); writer.WriteInteger(USec.Value); writer.PopSequence(new Asn1Tag(TagClass.ContextSpecific, 3)); } if (Asn1Extension.HasValue(SAddress)) { writer.PushSequence(new Asn1Tag(TagClass.ContextSpecific, 4)); SAddress?.Encode(writer); writer.PopSequence(new Asn1Tag(TagClass.ContextSpecific, 4)); } if (Asn1Extension.HasValue(RAddress)) { writer.PushSequence(new Asn1Tag(TagClass.ContextSpecific, 5)); RAddress?.Encode(writer); writer.PopSequence(new Asn1Tag(TagClass.ContextSpecific, 5)); } writer.PopSequence(tag); }
public bool UpdateAddress(SAddress obj) { bool status; int i; try { i = packXprezObj.UpdateAddress(obj.CustId, obj.AddressId, obj.BuildingNo, obj.StreetNo, obj.Locality, obj.Pincode); if (i == 1) { status = true; } else { status = false; } } catch (Exception) { status = false; } return(status); }
public void WritePacket(Packet packet) { packet.WriteUInt32(Id); packet.WriteUTF8String(Misc.GetTaxiTypeString(Type)); packet.WriteUTF8String(Misc.GetOrderStatusString(Status)); packet.WriteUInt32((uint)Time.UnixTimeFromDataTime(Date)); packet.WriteUTF8String(SAddress.ToString()); packet.WriteUTF8String(EAddress.ToString()); packet.WriteUTF8String(Owner.Username); if (Driver != null) { packet.WriteUInt8(1); packet.WriteUTF8String(Driver.Username); packet.WriteUTF8String(Driver.ToDriver().Car.Model); packet.WriteUTF8String(Driver.ToDriver().Car.Color); packet.WriteUTF8String(Driver.ToDriver().Car.Number); packet.WriteUTF8String(Misc.GetTaxiTypeString(Driver.ToDriver().Car.Type)); } else { packet.WriteUInt8(0); } }