/// <summary> /// Add note /// </summary> /// <param name="teambooking"></param> /// <returns></returns> public static int AddNote(TeamBooking_Allot teambooking,int noteGroup) { int result; TMSDataLibrary.TeamBooking_Allot _objteam = new TMSDataLibrary.TeamBooking_Allot(); result = _objteam.AddNote(teambooking.BookingId, teambooking.Note, teambooking.Sender, noteGroup); return result; }
/// <summary> /// Allot vehicle /// </summary> /// <param name="teambooking"></param> /// <returns></returns> public static int AllotVehicle(TeamBooking_Allot teambooking) { int result; TMSDataLibrary.TeamBooking_Allot _objteam = new TMSDataLibrary.TeamBooking_Allot(); result = _objteam.AllotVehicle(teambooking.VehicleId,teambooking.BookingId,teambooking.DriverId); return result; }
/// <summary> /// Get BookingId by BookingNo /// </summary> /// <returns>datatable for UserInfo</returns> public static TeamBooking_Allot GetBookingId(string bookinNo) { DataTable dt = new DataTable(); TeamBooking_Allot team = new TeamBooking_Allot(); TMSDataLibrary.TeamBooking_Allot _team = new TMSDataLibrary.TeamBooking_Allot(); dt = _team.GetBookingId(bookinNo); if (dt.Rows.Count > 0) { team.BookingId = Convert.ToInt32(dt.Rows[0]["BookingId"]); } return team; }
/// <summary> /// Get RegistrationNo ,Vehicle Id /// </summary> /// <returns></returns> public static TeamBooking_Allot GetRegistrationNo(int bookinid) { DataTable dt = new DataTable(); TeamBooking_Allot team = new TeamBooking_Allot(); TMSDataLibrary.TransporterBooking_Allot _team = new TMSDataLibrary.TransporterBooking_Allot(); dt = _team.GetRequirementDetails(bookinid); if (dt.Rows.Count > 0) { team.RegistrationNo = dt.Rows[0][CONSTS.TransporterBooking_AllotMethodsColumnIndex.RegistrationNo].ToString(); team.VehicleId = Convert.ToInt32(dt.Rows[0][CONSTS.TransporterBooking_AllotMethodsColumnIndex.VehicleTypeId]); } return team; }
protected void lbtnAddNote_Click(object sender, EventArgs e) { AddNote("You", txtNote.InnerText, System.DateTime.Now.ToString()); var oTeamBookingAllot = new TeamBooking_Allot(); oTeamBookingAllot.BookingId = _bookingId; if (txtNote.InnerText != "") { oTeamBookingAllot.Note = txtNote.InnerText; oTeamBookingAllot.Sender = CONSTANT.UserType.Customer.ToString(); var result = TeamBooking_AllotMethods.AddNote(oTeamBookingAllot, 2); txtNote.InnerText = ""; } }
/// <summary> /// Get Vehicle List /// </summary> /// <returns></returns> public static List<TeamBooking_Allot> GetVehicleList(int transporterid, int vehicleTypeId) { List<TeamBooking_Allot> vehicleList = new List<TeamBooking_Allot>(); TMSDataLibrary.TransporterBooking_Allot _team = new TMSDataLibrary.TransporterBooking_Allot(); DataTable dt = _team.GetVehicleList(transporterid, vehicleTypeId); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { TeamBooking_Allot _Team = new TeamBooking_Allot(); _Team.RegistrationNo = (dt.Rows[i][CONSTS.TransporterBooking_AllotMethodsColumnIndex.Registration]).ToString(); _Team.VehicleId = Convert.ToInt32(dt.Rows[i][CONSTS.TransporterBooking_AllotMethodsColumnIndex.TransporterVehicleId]); vehicleList.Add(_Team); } } return vehicleList; }
//TODO: Un-proper casing for method name private void fillUserInfo(int bookingId) { //if (BookingId.Value != null) //{ // show user informations teambooking = TeamBooking_AllotMethods.GetUserInfo(bookingId); if (teambooking != null) { lblUserName.Text = teambooking.FirstName; lblUserNumber.Text = teambooking.Mobile; lblEmailId.Text = teambooking.Email; } //show Booking information FormView1.DataSource = TeamBooking_AllotMethods.GetBookingInfo(bookingId); FormView1.DataBind(); //show list of best Match Transporter List grdTransporter.DataSource = TeamBooking_AllotMethods.GetTransporterList(bookingId); grdTransporter.DataBind(); makeGridResponsible(); // show previous Note FillNote(); grdNoteResponsible(); //} }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["BookingNo"] != null) { var test = Request.QueryString["BookingNo"]; teambooking = TeamBooking_AllotMethods.GetBookingId(Request.QueryString["BookingNo"]); if (teambooking != null) { BookingId.Value = Convert.ToString(teambooking.BookingId); fillUserInfo(Convert.ToInt32(teambooking.BookingId)); if (Request.QueryString["PrePage"] != null) { if (Request.QueryString["PrePage"].ToString() == "AllBooking") { pnlReasonText.Visible = false; pnlTransporterList.Visible = false; pnlAllotManually.Visible = false; } pblTransporterDetails.Visible = true; getTransporterDetails(Convert.ToInt32(BookingId.Value)); } } } } }
/// <summary> /// Get UserInformation by BookingId /// </summary> /// <returns>datatable for UserInfo</returns> public static TeamBooking_Allot GetUserInfo(int bookinid) { DataTable dt = new DataTable(); TeamBooking_Allot team = new TeamBooking_Allot(); TMSDataLibrary.TeamBooking_Allot _team = new TMSDataLibrary.TeamBooking_Allot(); dt = _team.GetUserInfo(bookinid); if (dt.Rows.Count > 0) { team.FirstName = dt.Rows[0][CONSTS.TeamBooking_AllotMethodsColumnIndex.FirstName].ToString(); team.Mobile = dt.Rows[0][CONSTS.TeamBooking_AllotMethodsColumnIndex.Mobile].ToString(); team.Email = dt.Rows[0][CONSTS.TeamBooking_AllotMethodsColumnIndex.Email].ToString(); } return team; }
protected void chkDetails_CheckedChanged(object sender, EventArgs e) { CheckBox chk = (CheckBox)sender; if (chk.Checked) { GridViewRow gvr = (GridViewRow)chk.NamingContainer; var bookingId = Convert.ToInt32(((Label)gvr.FindControl("lblBookingId")).Text); var userId = Convert.ToInt32(((HiddenField)gvr.FindControl("hdfUserId")).Value); if (bookingId != 0 && userId != 0) { //Get Customer Details FrmCustomerDetails.DataSource = TransporterBooking_AllotMethods.GetCustomerInfo(bookingId, userId); FrmCustomerDetails.DataBind(); //Get Requirement Details frmRequirement.DataSource = TransporterBooking_AllotMethods.GetRequirementDetails(bookingId); frmRequirement.DataBind(); //Get Vehicle Number teambooking = TransporterBooking_AllotMethods.GetRegistrationNo(bookingId); if (teambooking != null) { lblVehicleNumber.Text = teambooking.RegistrationNo; ValueHiddenField.Value = Convert.ToString(teambooking.VehicleId); FillVehicle(); } else { ValidatePopup("Try Again"); return; } } else { ValidatePopup("Try Again"); return; } ValueHiddenField.Value = Convert.ToString(bookingId); pnlUserInformation.Visible = true; pnlRequirementDetails.Visible = true; pnlVehicleInformation.Visible = true; pnlNotes.Visible = true; pnlMessage.Visible = true; FillNote(); fillMessage(); } ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "ShowModal()", true); makeGridResponsible(); grdNoteResponsible(); }
//TODO: Move this code in Business logic. Prepeare a List<Booking> & use it. private void FillBookingDetail(DataTable booking) { _bookingId = Convert.ToInt32(booking.Rows[0][0].ToString()); lblFromCity.InnerText = booking.Rows[0][3].ToString(); lblToCity.InnerText = booking.Rows[0][4].ToString(); lblBookingNo.InnerText = booking.Rows[0][1].ToString(); lblSchdDate.InnerText = booking.Rows[0][5].ToString(); lblBookingDate.InnerText = booking.Rows[0][6].ToString(); lblMaterialType.InnerText = booking.Rows[0][10].ToString(); lblTruckType.InnerText = booking.Rows[0][9].ToString(); lblDistance.InnerText = booking.Rows[0][12].ToString(); lblQuotes.InnerText = booking.Rows[0]["Quotes"].ToString(); lblAmount.InnerText = booking.Rows[0]["Amount"].ToString(); int status = Convert.ToInt32(booking.Rows[0][2].ToString()); GetTransporterDetails(); //Get Customer Details FrmCustomerDetails.DataSource = TransporterBooking_AllotMethods.GetCustomerInfo(_bookingId, _user.UserId); FrmCustomerDetails.DataBind(); //Get Vehicle Number _teambooking = TransporterBooking_AllotMethods.GetRegistrationNo(_bookingId); if (_teambooking != null) { lblVehicleNumber.Text = _teambooking.RegistrationNo; ValueHiddenField.Value = Convert.ToString(_teambooking.VehicleId); FillVehicle(); } }
private void AddNote() { var oTeamBookingAllot = new TeamBooking_Allot(); oTeamBookingAllot.BookingId = _bookingId; if (txtNote.Text != "") { oTeamBookingAllot.Note = txtNote.Text; oTeamBookingAllot.Sender = CONSTANT.UserType.Customer.ToString(); var result = TeamBooking_AllotMethods.AddNote(oTeamBookingAllot, 2); FillNotes(); txtNote.Text = ""; ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "ShowModal()", true); MakeGridNoteResponsible(); makeGridResponsible(); } else { ValidatePopup("Please Enter Note"); return; } }
private void AddNote() { var oTeamBookingAllot = new TeamBooking_Allot(); oTeamBookingAllot.BookingId = _bookingId; if (txtNote.Text != "") { oTeamBookingAllot.Note = txtNote.Text; } else { ValidatePopup("Please Enter Note"); return; } oTeamBookingAllot.Sender = CONSTANT.UserType.Customer.ToString(); var result = TeamBooking_AllotMethods.AddNote(oTeamBookingAllot, 2); FillNotes(); txtNote.Text = ""; MakeGridResponsible(); // makeGridResponsible(); }