private void btnSave_Click(object sender, EventArgs e) { RTOAllotmentBL obj = new RTOAllotmentBL(); //RTOId int rtoId = 0; if (ddlRTO.SelectedIndex != -1) { var rtoITEM = (ComboboxItem)ddlRTO.SelectedItem; rtoId = Convert.ToInt32(rtoITEM.Value); } int _amount = 0; if (txtAmount.Text != "") { _amount = Convert.ToInt32(txtAmount.Text); } //Populate dto RTOAllotmentDTO dto = new RTOAllotmentDTO() { VehicleBookingId = Convert.ToInt32(lblVehicleBookingId.Text), RTOInfoID = rtoId, TempRegNo = txtTempRegNo.Text, RegNo = txtRegNo.Text, RegDate = Convert.ToDateTime(dtRegDate.Text), Amount = _amount, AgentName = txtAgentName.Text, RCBookNo = txtRCBookNo.Text, RCDeliveredDate = Convert.ToDateTime(dtRCDeliveredDate.Text), Remark = txtRemarks.Text, CreatedBy = GlobalSetup.Userid, CreatedDate = DateTime.Now, ModifiedBy = GlobalSetup.Userid, ModifiedDate = DateTime.Now }; if (_mode == "EDIT") { dto.VehicleBookingRTOAllotmentID = _rtoAllotmentId; } int rtoallotmentId = obj.SaveRTOAllotment(dto, _mode); lblRTOAllotmentId.Text = rtoallotmentId.ToString(); this.Close(); }
private void PopulateRTO() { RTOAllotmentBL bl = new RTOAllotmentBL(); var rAllot = bl.GetRTOAllotment(_rtoAllotmentId); //RTO if (rAllot.RTOInfoID != 0) { ComboboxItem rtoItem = new ComboboxItem(); rtoItem.Text = rAllot.RTOName; rtoItem.Value = rAllot.RTOInfoID; ddlRTO.Text = rtoItem.Text; } lblVehicleBookingId.Text = _vehicleBookingId.ToString(); txtTempRegNo.Text = rAllot.TempRegNo; txtRegNo.Text = rAllot.RegNo; dtRegDate.Text = rAllot.RegDate.ToString(); txtAmount.Text = (rAllot.Amount ?? 0).ToString(); txtAgentName.Text = rAllot.AgentName; txtRCBookNo.Text = rAllot.RCBookNo; dtRCDeliveredDate.Text = rAllot.RCDeliveredDate.ToString(); txtRemarks.Text = rAllot.Remark; }