Exemple #1
0
        private void GetBooking(User user)
        {
            _oBooking = PostMethods.GetBooking(user.UserId, "Feedback");

            if (_oBooking != null && _oBooking.BookingId != 0)
            {
                lblFromCity.Text = _oBooking.FromCityName;
                lblToCity.Text = _oBooking.ToCityName;
                lblSchdDate.Text = _oBooking.SchdDate.ToString("dd-MM-yyy HH:MM");
                lblTransportName.Text = _oBooking.TransporterVehicle.Transporter.TransportName;
                lblContactName.Text = _oBooking.TransporterVehicle.Transporter.FullName;
                lblContactNo.Text = _oBooking.TransporterVehicle.Transporter.Mobile;
                lblVehicleNo.Text = _oBooking.TransporterVehicle.RegistrationNo;
                Response.Cookies["transporterId"].Value = "";
                Response.Cookies["transporterId"].Value = _oBooking.TransporterVehicle.TransporterId.ToString();
                //Response.Cookies["transporterId"].Expires = DateTime.Now.AddMinutes(5);
                Response.Cookies["bookingId"].Value = "";
                Response.Cookies["bookingId"].Value = _oBooking.BookingId.ToString();
                //Response.Cookies["bookingId"].Expires = DateTime.Now.AddMinutes(5);
                GetRating(_oBooking.TransporterVehicle.TransporterId);
            }
            else
            {
                Response.Redirect("~\\Transporter\\TransporterDashboard.aspx");
            }
        }
Exemple #2
0
 public FeedbackAndRating()
 {
     _ratingId = 0;
     FeedbackText = "";
     TransporterId = 0;
     _bookingId = 0;
     _transporter = new Transporter();
     _booking = new Booking();
 }
Exemple #3
0
 protected void btnStart_Click(object sender, EventArgs e)
 {
     TMSLibrary.Booking objBooking = new TMSLibrary.Booking();
     objBooking.BookingId = _bookingId;
     objBooking.Status = 6;
     TMSLibrary.PostMethods.UpdateStatus(objBooking);
     GetTransporterDetails(1);
     btnStart.Visible = false;
     btnCompleted.Visible = true;
 }
Exemple #4
0
 protected void btnCompleted_Click(object sender, EventArgs e)
 {
     TMSLibrary.Booking objBooking = new TMSLibrary.Booking();
     objBooking.BookingId = _bookingId;
     objBooking.Status = 2;
     TMSLibrary.PostMethods.UpdateStatus(objBooking);
     GetTransporterDetails(1);
     btnCompleted.Visible = false;
     Response.Redirect("~\\Customer\\Feedback.aspx");
 }
Exemple #5
0
 /// <summary>
 /// Add Customer Requirement(Post)
 /// </summary>
 /// <param name="post">Post</param>
 /// <returns>status</returns>
 public static int AddBooking(Booking book)
 {
     int result;
     var bookingNo = "";
     var _objpost = new TMSDataLibrary.Post();
     result = _objpost.AddBooking(book.UserId, book.MaterialTypeId, book.TrucktypeId,
         book.NumberOfTrucks, book.LoadType, book.Status, book.FromCityId, book.ToCityId,
         book.FromAddress, book.ToAddress, book.Weight, book.SchdDate, book.BookingDate,
         book.Distance, book.Quotes, out bookingNo, book.LoadService, book.FromPinCode.PincodeId, book.ToPinCode.PincodeId);
     book.BookingNo = bookingNo;
     return result;
 }
Exemple #6
0
 protected void btnAccept_Click(object sender, EventArgs e)
 {
     TMSLibrary.Booking objBook = new TMSLibrary.Booking();
     //objBook.UserId = ((User)Session["userinfo"]).UserId;
     objBook.BookingId = _bookingId;
     objBook.Status = 1;
     TMSLibrary.PostMethods.UpdateStatus(objBook);
     GetBookingDetails(1);
     pnkTransporterName.Visible = false;
     pnlTransporterDetails.Visible = true;
     FrmTransporterDetails.Visible = true;
 }
Exemple #7
0
 protected void lbtnaccepttransporter_Click(object sender, EventArgs e)
 {
     TMSLibrary.Booking objBook = new TMSLibrary.Booking();
     objBook.UserId = ((User)Session["userinfo"]).UserId;
     objBook.BookingId = _bookingId;
     objBook.Status = 1;
     TMSLibrary.PostMethods.UpdateStatus(objBook);
     GetTransporterDetails(1);
     pnltransporternotification.Visible = false;
     pnltransporteraccept.Visible = true;
     pnlStatus.Visible = false;
     pnlDeclineReason.Visible = false;
     pnltransporterdecline.Visible = false;
     //pnlMessage.Visible = true;
     //fillMessage();
 }
Exemple #8
0
        protected void btnDecline_Click(object sender, EventArgs e)
        {
            TMSLibrary.Booking objBook = new TMSLibrary.Booking();
            objBook = TMSLibrary.PostMethods.MaxBookingDetailId(_bookingId);
            if (objBook != null)
            {
                objBook.DeclineReason = txtreason.Text;
                objBook.BookingId = objBook.BookingId;

            }
            TMSLibrary.PostMethods.Declinereason(objBook);
            //objBook.UserId = ((User)Session["userinfo"]).UserId;
            objBook.BookingId = _bookingId;
            objBook.Status = 5;
            TMSLibrary.PostMethods.UpdateStatus(objBook);
            GetBookings();
            GetBookingDetails(3);
        }
Exemple #9
0
 /// <summary>
 /// Gets a single booking on the basis of Id and Type Passed.
 /// </summary>
 /// <param name="id"></param>
 /// <param name="type">Pass type to filter bookings on the basis. Type - UserId, BookingId</param>
 /// <returns></returns>
 public static Booking GetBooking(int id, string type)
 {
     var post = new TMSDataLibrary.Post();
     var oBooking = new Booking();
     var dt = post.GetBooking(id, type);
     if (dt.Rows.Count > 0)
     {
         var row = dt.Rows[0];
         oBooking.BookingId = Convert.ToInt32(row["BookingId"]);
         oBooking.FromCityName = row["FromCityName"].ToString();
         oBooking.ToCityName = row["ToCityName"].ToString();
         oBooking.TransporterVehicle.RegistrationNo = row["RegistrationNo"].ToString();
         oBooking.SchdDate = Convert.ToDateTime(row["SchdDate"]);
         oBooking.TransporterVehicle.TransporterId = Convert.ToInt32(row["TransporterId"]);
         oBooking.TransporterVehicle.Transporter.TransportName = row["TransportName"].ToString();
         oBooking.TransporterVehicle.Transporter.FirstName = row["FirstName"].ToString();
         oBooking.TransporterVehicle.Transporter.LastName = row["LastName"].ToString();
         oBooking.TransporterVehicle.Transporter.Mobile = row["Mobile"].ToString();
     }
     return oBooking;
 }
Exemple #10
0
        protected void grdBooking_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            TMSLibrary.Booking book = new TMSLibrary.Booking();
            Label lblBookingId = (Label)grdBooking.Rows[e.RowIndex].FindControl("lblBookingId");
            if (lblBookingId.Text != "")
            {
                book.BookingId = Convert.ToInt32(lblBookingId.Text);
            }
            else
            {
                ValidatePopup("Please try Again");
            }

            book.Status = (int)TMSLibrary.CONSTANT.Status.Cancel;
            int result = TMSLibrary.PostMethods.UpdateStatus(book);
            if (result == -1)
            {
                fillgrdRecentPost();
                ValidatePopup("Cancel Your Booking");
                return;

            }
            else
            {
                ValidatePopup("Please try Again");
                return;

            }
        }
        protected void lbkAddBooking_Click(object sender, EventArgs e)
        {
            Page objpreviouspage = (Page)Session["previousPage"];
            if (objpreviouspage != null)
            {
                string txtFromCity = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlfromCity")).SelectedItem.Text;
                string txtFromCityId = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlfromCity")).SelectedItem.Value;
                string txtToCity = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlToCity")).SelectedItem.Text;
                string txtToCityId = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlToCity")).SelectedItem.Value;
                string txtFromAddress = ((TextBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$txtPickupAddress")).Text.Trim();
                string txtToAddress = ((TextBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$txtDeliveryAddress")).Text.Trim();
                string txtSchdDate = ((TextBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$txtScheduleDate")).Text.Trim();
                string ddlMaterialType = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlMaterialType")).SelectedItem.Value;
                string ddlTruckType = ((TextBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$txtvehicleTypeId")).Text.Trim();
                string ddlFromPinCode = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlFromPinCode")).SelectedItem.Value;
                string ddlToPinCode = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlToPinCode")).SelectedItem.Value;
                string ddlWeight = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlWeight")).SelectedItem.Text;
                string ddlNoOfTruck = ((DropDownList)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$ddlNoOfTruck")).SelectedItem.Text;
                CheckBox chkLoading = (CheckBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$chkLoading");
                CheckBox chkUnloading = (CheckBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$chkUnloading");
                string txtQuotes = ((TextBox)objpreviouspage.FindControl("ctl00$ContentPlaceHolder2$txtQuotes")).Text.Trim();
                TMSLibrary.Booking book = new TMSLibrary.Booking();

                if (_user.UserId != 0)
                {
                    book.UserId = _user.UserId;
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                if (txtFromCity != "")
                {
                    if (txtFromCityId != "0")
                    {
                        book.FromCityId = Convert.ToInt32(txtFromCityId);
                    }

                }
                else
                {
                    ValidatePopup("Please try Again");
                }

                if (txtToCity != "")
                {
                    if (txtToCityId != "0")
                    {
                        book.ToCityId = Convert.ToInt32(txtToCityId);
                    }
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                //lblDistance.InnerText
                if (txtSchdDate != "")
                {
                    book.SchdDate = Convert.ToDateTime(txtSchdDate);
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                if (ddlWeight != "")
                {
                    if (ddlWeight != "0")
                    {
                        book.Weight = Convert.ToString(ddlWeight);
                    }
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                if (ddlNoOfTruck != "")
                {
                    book.NumberOfTrucks = Convert.ToInt16(ddlNoOfTruck);
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                if (ddlMaterialType != "")
                {
                    if (ddlMaterialType != "0")
                    {
                        book.MaterialTypeId = Convert.ToInt16(ddlMaterialType);
                    }
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                if (ddlTruckType != "")
                {
                    if (ddlTruckType != "0")
                    {
                        book.TrucktypeId = Convert.ToInt16(ddlTruckType);
                    }
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                if (txtFromAddress != "")
                {
                    book.FromAddress = txtFromAddress;
                }
                else
                {
                    ValidatePopup("Please Enter From Address");
                }
                if (txtToAddress != "")
                {
                    book.ToAddress = txtToAddress;
                }
                else
                {
                    ValidatePopup("Please Enter From Address");
                }
                if (lblDistance.InnerText != "")
                {
                    if (lblDistance.InnerText.Contains("km"))
                    {
                        book.Distance = Convert.ToDecimal(lblDistance.InnerText.Replace("km", ""));
                    }
                    else if (lblDistance.InnerText.Contains("m"))
                    {
                        book.Distance = Convert.ToDecimal(lblDistance.InnerText.Replace("m", ""));
                    }
                }
                else
                {
                    ValidatePopup("Please try Again");
                }
                //if (load.Text != null)
                //{
                //    if (load.SelectedIndex != 2)
                //    {
                //        book.LoadType = (int)CONSTANT.LoadType.FullLoad;
                //    }
                //    else
                //    {
                //        book.LoadType = (int)CONSTANT.LoadType.PartLoad;
                //    }
                //}
                //else
                //{ ValidatePopup("Please try Again"); }
                book.LoadType = (int)CONSTANT.LoadType.FullLoad;
                if (txtQuotes != "")
                {
                    book.Quotes = Convert.ToDecimal(txtQuotes);
                }
                //var lstLoadService = new List<int>();
                int loadService = 0;
                if (!chkLoading.Checked && !chkUnloading.Checked)
                    loadService = 0;
                if (chkLoading.Checked)
                    loadService = 1;
                //   lstLoadService.Add(0);
                if (chkUnloading.Checked)
                    loadService = 2;
                if (chkLoading.Checked && chkUnloading.Checked)
                    loadService = 3;
                //   lstLoadService.Add(1);

                book.LoadService = loadService;
                book.FromPinCode.PincodeId = Convert.ToInt32(ddlFromPinCode);
                book.ToPinCode.PincodeId = Convert.ToInt32(ddlToPinCode);
                book.BookingDate = DateTime.Today;
                book.Status = (int)CONSTANT.Status.Unconfirm;
                int result = PostMethods.AddBooking(book);
                if (result == -1)
                {

                    var user = Session["UserInfo"] as User;
                    if (user != null)
                    {
                        SMS.SendSMS(user.UserName, "");
                        var url = String.Format(@"ThankYou.aspx?bNo={0}&frm={1}&to={2}&dis={3}&schd={4}&urnm={5}", book.BookingNo, txtFromCity, txtToCity, lblDistance.InnerText, book.SchdDate, _user.UserName);
                        Response.Redirect(url);
                    }
                }
                else
                {
                    ValidatePopup("Please try Again");

                }
            }
            ClearInputs(Page.Controls);
        }
Exemple #12
0
        private void Addbooking()
        {
            TMSLibrary.Booking book = new TMSLibrary.Booking();
            if (ddlUserName.SelectedIndex != 0)
            {
                book.UserId = Convert.ToInt32(ddlUserName.SelectedValue);
            }
            else
            {
                ValidatePopup("try again");
                return;

            }
            if (txtFromCityId.Text.Trim() != "")
            {
                book.FromCityId = Convert.ToInt32(txtFromCityId.Text);
            }
            else
            {
                ValidatePopup("Please Select From City");
                return;

            }
            if (txtToCityId.Text.Trim() != "")
            {
                book.ToCityId = Convert.ToInt32(txtToCityId.Text);
            }
            else
            {
                ValidatePopup("Please Enter To city");
                return;
            }
            if (txtScheduleDate.Text != "")
            {
                book.SchdDate = Convert.ToDateTime(txtScheduleDate.Text);
            }
            else
            {
                ValidatePopup("Please Enter To ScheduleDate");
                return;

            }
            if (ddlWeight.SelectedIndex != 0)
            {
                book.Weight = Convert.ToString(ddlWeight.SelectedItem);
            }
            else
            {
                ValidatePopup("Please provide weight");
                return;

            }
            if (ddlNoOfTruck.SelectedIndex != 0)
            {
                book.NumberOfTrucks = Convert.ToInt16(ddlNoOfTruck.Text);
            }
            else
            {
                ValidatePopup("Please provide Number Of Trucks");
                return;
            }
            if (ddlMaterialType.SelectedIndex != 0)
            {
                book.MaterialTypeId = Convert.ToInt16(ddlMaterialType.SelectedValue);
            }
            else
            {
                ValidatePopup("Please provide a MaterialType");
                return;
            }
            if (ddlTruckType.SelectedIndex != 0)
            {
                book.TrucktypeId = Convert.ToInt16(ddlTruckType.SelectedValue);
            }
            else
            {
                ValidatePopup("Please provide Truck Type");
                return;
            }
            if (txtFromAddress.Text != "")
            {
                book.FromAddress = txtFromAddress.Text;
            }
            else
            {
                ValidatePopup("Please provide From Address");
                return;
            }
            if (txtToAddress.Text != "")
            {
                book.ToAddress = txtToAddress.Text;
            }
            else
            {
                ValidatePopup("Please provide To Address");
                return;
            }
            if (ddlload.SelectedIndex != 0)
            {
                if (ddlload.SelectedIndex != 2)
                {
                    book.LoadType = (int)CONSTANT.LoadType.FullLoad;
                }
                else
                {
                    book.LoadType = (int)CONSTANT.LoadType.PartLoad;
                }
            }
            else
            {
                ValidatePopup("Please provide Load Type");
                return;
            }
            _distance = CalculateDistance(txtFromCity.Text, txtToCity.Text);
            if (_distance.Contains("km"))
            {
                book.Distance = Convert.ToDecimal(_distance.Replace("km", ""));
            }
            else if (_distance.Contains("m"))
            {
                book.Distance = Convert.ToDecimal(_distance.Replace("m", ""));
            }
            if (txtQuotes.Text != "")
            {
                book.Quotes = Convert.ToDecimal(txtQuotes.Text);
            }

            int loadService = 0;

            if (!chkLoading.Checked && !chkUnloading.Checked)
                loadService = 0;
            if (chkLoading.Checked)
                loadService = 1;
            //   lstLoadService.Add(0);
            if (chkUnloading.Checked)
                loadService = 2;
            if (chkLoading.Checked && chkUnloading.Checked)
                loadService = 3;
            book.LoadService = loadService;
            book.BookingDate = DateTime.Today;

            var fromPin = ddlFromPinCode.SelectedItem.Value;
            var toPin = ddlToPinCode.SelectedItem.Value;
            if (fromPin.Trim() != "" && fromPin != "0")
                book.FromPinCode.PincodeId = Convert.ToInt32(fromPin);
            if (toPin.Trim() != "" && toPin != "0")
                book.ToPinCode.PincodeId = Convert.ToInt32(toPin);

            int result = PostMethods.AddBooking(book);
            if (result == -1)
            {
                ValidatePopup("Booking  Success");
                return;

            }
            else
            {
                ValidatePopup("Please try Again");
                return;
            }
        }
Exemple #13
0
        /// <summary>
        /// MaxbookingId
        /// </summary>
        /// <param name="bookingid"></param>
        /// <returns></returns>
        public static Booking MaxBookingDetailId(int bookingid)
        {
            var post = new TMSDataLibrary.Post();

            var oBooking = new Booking();
            var dt = post.MaxBookingDetailId(bookingid);
            if (dt.Rows.Count > 0)
            {

                oBooking.BookingId = Convert.ToInt32(dt.Rows[0]["BookingDetailId"]);
            }
            return oBooking;
        }
Exemple #14
0
        /// <summary>
        /// store booking details to database
        /// </summary>
        private void Addbooking()
        {
            Page objpreviouspage = (Page)Session["previousPage"];
            if (objpreviouspage != null)
            {
                //ddlfromCity = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlfromCity");
                //ddlToCity = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlToCity");

                ScheduleDate = (TextBox)objpreviouspage.FindControl("ctl00$ContentSection$txtScheduleDate");
                ddlWeight = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlWeight");
                Truck = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlNoOfTruck");
                MaterialType = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlMaterialType");
                TruckType = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlTruckType");
                //load = (DropDownList)objpreviouspage.FindControl("ctl00$ContentSection$ddlload");
            }
            TMSLibrary.Booking book = new TMSLibrary.Booking();

            if (_user.UserId != 0)
            {
                book.UserId = _user.UserId;
            }
            else
            {
                ValidatePopup("Please try Again");

            }
            if (FromCity != null)
            {
                if (FromCity.CityId != 0)
                {
                    book.FromCityId = FromCity.CityId;
                }

            }
            else
            {
                ValidatePopup("Please try Again");
            }

            if (ToCity != null)
            {
                if (ToCity.CityId != 0)
                {
                    book.ToCityId = ToCity.CityId;
                }
            }
            else
            {
                ValidatePopup("Please try Again");
            }

            if (ScheduleDate.Text != null)
            {
                book.SchdDate = Convert.ToDateTime(ScheduleDate.Text);
            }
            else
            {
                ValidatePopup("Please try Again");
            }
            if (ddlWeight.Text != null)
            {
                if (ddlWeight.SelectedIndex != 0)
                {
                    book.Weight = Convert.ToString(ddlWeight.SelectedItem);
                }
            }
            else
            {
                ValidatePopup("Please try Again");
            }
            if (Truck.Text != null)
            {
                book.NumberOfTrucks = Convert.ToInt16(Truck.Text);
            }
            else
            {
                ValidatePopup("Please try Again");
            }
            if (MaterialType.Text != null)
            {
                if (MaterialType.SelectedIndex != 0)
                {
                    book.MaterialTypeId = Convert.ToInt16(MaterialType.SelectedValue);
                }
            }
            else
            {
                ValidatePopup("Please try Again");
            }
            if (TruckType.Text != null)
            {
                if (TruckType.SelectedIndex != 0)
                {
                    book.TrucktypeId = Convert.ToInt16(TruckType.SelectedValue);
                }
            }
            else
            {
                ValidatePopup("Please try Again");
            }
            if (txtFrom.Text != "")
            {
                book.FromAddress = txtFrom.Text;
            }
            else
            {
                ValidatePopup("Please Enter From Address");
            }
            if (txtTo.Text != "")
            {
                book.ToAddress = txtTo.Text;
            }
            else
            {
                ValidatePopup("Please Enter From Address");
            }
            if (lblDistance.Text != "")
            {
                if (lblDistance.Text.Contains("km"))
                {
                    book.Distance = Convert.ToDecimal(lblDistance.Text.Replace("km", ""));
                }
                else if (lblDistance.Text.Contains("m"))
                {
                    book.Distance = Convert.ToDecimal(lblDistance.Text.Replace("m", ""));
                }
            }
            else
            {
                ValidatePopup("Please try Again");
            }
            //if (load.Text != null)
            //{
            //    if (load.SelectedIndex != 2)
            //    {
            //        book.LoadType = (int)CONSTANT.LoadType.FullLoad;
            //    }
            //    else
            //    {
            //        book.LoadType = (int)CONSTANT.LoadType.PartLoad;
            //    }
            //}
            //else
            //{ ValidatePopup("Please try Again"); }
            book.LoadType = (int)CONSTANT.LoadType.FullLoad;
            if (txtQuotes.Text != "")
            {
                book.Quotes = Convert.ToDecimal(txtQuotes.Text);
            }
            //var lstLoadService = new List<int>();
            int loadService = 0;
            if (!chkLoading.Checked && !chkUnloading.Checked)
                loadService = 0;
            if (chkLoading.Checked)
                loadService = 1;
            //   lstLoadService.Add(0);
            if (chkUnloading.Checked)
                loadService = 2;
            if (chkLoading.Checked && chkUnloading.Checked)
                loadService = 3;
            //   lstLoadService.Add(1);

            book.LoadService = loadService;
            book.FromPinCode.PincodeId = Convert.ToInt32(ddlFromPinCode.SelectedItem.Value);
            book.ToPinCode.PincodeId = Convert.ToInt32(ddlToPinCode.SelectedItem.Value);
            book.BookingDate = DateTime.Today;
            book.Status = (int)CONSTANT.Status.Unconfirm;
            int result = PostMethods.AddBooking(book);
            if (result == -1)
            {

                var user = Session["UserInfo"] as User;
                if (user != null)
                {
                   SMS.SendSMS(user.UserName, "");
                    var url = String.Format(@"ConfirmOrder?bNo={0}", book.BookingNo);
                    Response.Redirect(url);
                }
            }
            else
            {
                ValidatePopup("Please try Again");

            }
            ClearInputs(Page.Controls);
        }
Exemple #15
0
 protected void btnStart_Click(object sender, EventArgs e)
 {
     TMSLibrary.Booking objBooking = new TMSLibrary.Booking();
     objBooking.BookingId = _bookingId;
     objBooking.Status = 6;
     TMSLibrary.PostMethods.UpdateStatus(objBooking);
     GetBookings();
     GetBookingDetails(1);
     btnStart.Visible = false;
     UpdatePanle1.Update();
 }
Exemple #16
0
        protected void lbtnConfermDecline_Click(object sender, EventArgs e)
        {
            TMSLibrary.Booking objBook = new TMSLibrary.Booking();
            objBook = TMSLibrary.PostMethods.MaxBookingDetailId(_bookingId);
            if (objBook != null)
            {
                objBook.DeclineReason = txtDeclineReason.Text;
                objBook.BookingId = objBook.BookingId;

            }
            TMSLibrary.PostMethods.Declinereason(objBook);
            //objBook.UserId = ((User)Session["userinfo"]).UserId;
            objBook.BookingId = _bookingId;
            objBook.Status = 5;
            TMSLibrary.PostMethods.UpdateStatus(objBook);

            pnltransporternotification.Visible = false;
            pnltransporteraccept.Visible = false;
            pnlStatus.Visible = false;
            pnlDeclineReason.Visible = false;
            pnltransporterdecline.Visible = true;
        }
Exemple #17
0
 /// <summary>
 /// Update status of booking 
 /// </summary>
 /// <param name="book"></param>
 /// <returns>no of update row</returns>
 public static int UpdateStatus(Booking book)
 {
     var objpost = new TMSDataLibrary.Post();
     var result = objpost.Updatestatus(book.Status, book.BookingId);
     return result;
 }
Exemple #18
0
        private void GetBooking(User user)
        {
            _oBooking = PostMethods.GetBooking(user.UserId, "Feedback");

            if (_oBooking != null && _oBooking.BookingId != 0)
            {
                lblFromCity.Text = _oBooking.FromCityName;
                lblToCity.Text = _oBooking.ToCityName;
                lblSchdDate.Text = _oBooking.SchdDate.ToString("dd-MM-yyy HH:MM");
                lblTransportName.Text = _oBooking.TransporterVehicle.Transporter.TransportName;
                lblContactName.Text = _oBooking.TransporterVehicle.Transporter.FullName;
                lblContactNo.Text = _oBooking.TransporterVehicle.Transporter.Mobile;
                lblVehicleNo.Text = _oBooking.TransporterVehicle.RegistrationNo;
                Response.Cookies["transporterId"].Value = "";
                Response.Cookies["transporterId"].Value = _oBooking.TransporterVehicle.TransporterId.ToString();
                //Response.Cookies["transporterId"].Expires = DateTime.Now.AddMinutes(5);
                Response.Cookies["bookingId"].Value = "";
                Response.Cookies["bookingId"].Value = _oBooking.BookingId.ToString();
                //Response.Cookies["bookingId"].Expires = DateTime.Now.AddMinutes(5);
                GetRating(_oBooking.TransporterVehicle.TransporterId);
            }
            else
            {
                Response.Redirect("~\\Customer\\Dashboard.aspx");
               // Response.Redirect("~\\Customer\\AddPost");
            }

            #region Commented Old Code

            //var con = new SqlConnection("Data Source=192.168.1.127; user id=sa; password=abcd1234; Initial Catalog=TMS");
            //var sql = "";
            //sql = sql + " select * from vwBooking where BookingId = (select min(BookingId) from Booking where Status='1'";
            //sql = sql + " and schdDate<getdate() and userid='" + user.UserId + "') ";
            //var cmd = new SqlCommand(sql, con);
            //con.Open();
            //var objReader = cmd.ExecuteReader();
            //if (objReader != null && objReader.HasRows)
            //{
            //    objReader.Read();
            //    _bookingId = Convert.ToInt32(objReader["BookingId"]);
            //    var from = objReader["FromCityName"].ToString();
            //    var to = objReader["ToCityName"].ToString();
            //    var vehicleNo = objReader["RegistrationNo"].ToString();
            //    var schdDate = Convert.ToDateTime(objReader["SchdDate"]);
            //    var transporterId = Convert.ToInt32(objReader["TransporterId"]);
            //    var transportName = objReader["TransportName"].ToString();
            //    var transporterName = objReader["FirstName"] + " " + objReader["LastName"];
            //    var mobileNo = objReader["Mobile"].ToString();

            //    lblFromCity.Text = from;
            //    lblToCity.Text = to;
            //    lblSchdDate.Text = schdDate.ToString("dd-MM-yyy HH:MM");
            //    lblTransportName.Text = transportName;
            //    lblContactName.Text = transporterName;
            //    lblContactNo.Text = mobileNo;
            //    lblVehicleNo.Text = vehicleNo;

            //    Response.Cookies["transporterId"].Value = transporterId.ToString();
            //    Response.Cookies["transporterId"].Expires = DateTime.Now.AddMinutes(5);
            //    Response.Cookies["bookingId"].Value = _bookingId.ToString();
            //    Response.Cookies["bookingId"].Expires = DateTime.Now.AddMinutes(5);
            //    objReader.Close();

            //    GetRating(transporterId);
            //}
            //else
            //{
            //    Response.Redirect("~\\Customer\\AddPost");
            //}

            #endregion
        }
Exemple #19
0
 /// <summary>
 /// Update Declinereason in BookingDeatils
 /// </summary>
 /// <param name="book"></param>
 /// <returns></returns>
 public static int Declinereason(Booking book)
 {
     var objpost = new TMSDataLibrary.Post();
     var result = objpost.Declinereason(book.BookingId, book.DeclineReason);
     return result;
 }