protected void Button1_Click(object sender, EventArgs e) { dml ob = new dml(); if (Session["username"] == null) { Session["flag"] = "1"; //Session["temp"] = HttpContext.Current.Request.Url.AbsoluteUri; Response.Redirect("WebForm7.aspx"); } else { //ob.booking_details(bookingid,userid ,modelid, colorid, submodelid, System.DateTime.Today, price, "T", bal_a); string bookingid = ob.inc1(); string price = ob.getprice(modelid, submodelid, colorid); bal = Int32.Parse(price) - Int32.Parse(Label4.Text); string bal_a = Convert.ToString(bal); string j = username; Session["submodel_id"] = submodelid; Session["colorid"] = colorid; Session["bookingid"] = bookingid; //Session["userid"] = userid; Session["modelid"] = modelid; Session["balalance"] = bal_a; Session["Adv"] = Int32.Parse(Label4.Text); Response.Redirect("Payment.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dml ob = new dml(); Label2.Font.Italic = true; Label3.Font.Italic = true; Label4.Font.Italic = true; Label5.Font.Italic = true; Label6.Font.Italic = true; Label7.Font.Italic = true; Label2.Font.Bold = true; Label3.Font.Bold = true; Label4.Font.Bold = true; Label5.Font.Bold = true; Label6.Font.Bold = true; Label7.Font.Bold = true; DataTable dt = new DataTable(); dt = ob.getCompanyDetails(); if (dt.Rows.Count > 0) { Label2.Text = dt.Rows[0]["COMPANY_NAME"].ToString(); Label3.Text = dt.Rows[0]["ADDRESS"].ToString(); Label4.Text = dt.Rows[0]["MOBILE_CONTACT_NO"].ToString(); Label5.Text = dt.Rows[0]["LAND_CONTACT_NO"].ToString(); Label6.Text = dt.Rows[0]["E_MAIL"].ToString(); Label7.Text = dt.Rows[0]["WEB_ADDRESS"].ToString(); } } }
protected void Button1_Click(object sender, EventArgs e) { if (Session["username"] != null) { Button bt = (Button)sender; string s = bt.CommandName; dml ob = new dml(); ob.ad_delete(s); Response.Redirect(HttpContext.Current.Request.Url.AbsoluteUri); //DataTable dt = new DataTable(); //dt = ob.get_posted_ads(userid); //if (dt.Rows.Count > 0) //{ // Label1.Text = "Your Ads"; // DataList1.DataSource = dt; // DataList1.DataBind(); //} //else //{ // Label1.Text = "Oops!!! Seems like you haven't posted any ads"; //} } else { Session["flag"] = "1"; Response.Redirect("WebForm7.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //username = (string)Session["username1"]; //userid = (string)Session["userid1"]; string modelid = Request.QueryString["modelid"]; if (modelid != "") { dml ob = new dml(); DataTable dt = new DataTable(); DataTable dt1 = new DataTable(); dt = ob.getModelPhotos(modelid); dt1 = ob.getModelVideo(modelid); if (dt1.Rows.Count > 0) { videoplayer.Src = dt1.Rows[0]["VIDEO_LINK"].ToString(); } if (dt.Rows.Count > 0) { img1.Src = "http://localhost:49447/Images/" + dt.Rows[0]["MODEL_PHOTO1"].ToString(); img2.Src = "http://localhost:49447/Images/" + dt.Rows[0]["MODEL_PHOTO2"].ToString(); img3.Src = "http://localhost:49447/Images/" + dt.Rows[0]["MODEL_PHOTO3"].ToString(); img4.Src = "http://localhost:49447/Images/" + dt.Rows[0]["MODEL_PHOTO4"].ToString(); } DataList1.DataSource = ob.getsubmodeldetails(modelid); DataList1.DataBind(); } } }
protected void Button1_Click(object sender, EventArgs e) { if (Session["username"] == null) { Session["flag"] = "1"; Response.Redirect("WebForm7.aspx"); } else { dml ob = new dml(); /*SMS Sending * SMS.APIType = SMSGateway.Site2SMS; * SMS.MashapeKey = "7DFfOImpRmmshfYB7oUmXMcnoFmMp1PSxMyjsnbzIaH9U6gpYb"; * SMS.Username = "******"; * SMS.Password = "******"; * SMS.SendSms("9495528982", "This Is Testing Jesus"); * end*/ userid = (string)Session["userid"]; bookingid = (string)Session["bookingid"]; modelid = (string)Session["modelid"]; balance = (string)Session["balalance"]; ob.booking_details(bookingid, userid, modelid, colorid, submodelid, System.DateTime.Today, Label6.Text, "B", balance, TextBox4.Text, TextBox5.Text, TextBox6.Text); if (RadioButtonList1.SelectedIndex == 0) { ob.payment_method(RadioButtonList1.SelectedValue.ToString(), userid, bookingid, TextBox2.Text); } if (RadioButtonList1.SelectedIndex == 1) { ob.payment_method(RadioButtonList1.SelectedValue.ToString(), userid, bookingid, RadioButtonList2.SelectedItem.ToString()); } Response.Redirect("WebForm2.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { submodelid = Request.QueryString["submodelid"]; string colorname = (string)Session["colorname"]; colorid = (string)Session["colorid"]; //username = (string)Session["username3"]; //userid = (string)Session["userid3"]; if (submodelid != "") { dml ob = new dml(); modelid = ob.getmodel_id(submodelid); DataTable dt = new DataTable(); dt = ob.getsubmodel_details(submodelid); if (dt.Rows.Count > 0) { Image1.ImageUrl = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE"].ToString(); Label1.Text = dt.Rows[0]["SUBMODEL_NAME"].ToString(); Label4.Text = dt.Rows[0]["ADV_AMOUNT"].ToString(); } Label6.Text = (string)colorname; } } }
protected void Button1_Click(object sender, EventArgs e) { dml ob=new dml(); string email = TextBox1.Text; DataTable dt = new DataTable(); dt = ob.check1(TextBox1.Text); if(dt.Rows.Count>0) { //send Mail using (MailMessage mm = new MailMessage("*****@*****.**", dt.Rows[0]["USER_NAME"].ToString())) { mm.Subject = "Your CarSales Portal Password"; mm.Body = "Your password is: " + dt.Rows[0]["PASSWORD"].ToString(); mm.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("*****@*****.**","indiaismycountry"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(mm); ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Email Sent.Please Check your Email');", true); TextBox1.Text = ""; } } else { Response.Write("<script>alert('Wrong Email Address');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Panel1.Visible = false; Panel2.Visible = false; for (int i = 2017; i < 2050; i++) { DropDownList2.Items.Add(i.ToString()); } submodelid = (string)Session["submodel_id"]; colorid = (string)Session["colorid"]; dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.get_detials(submodelid, colorid); if (dt.Rows.Count > 0) { Label2.Text = dt.Rows[0]["MODEL_NAME"].ToString(); Label3.Text = dt.Rows[0]["SUBMODEL_NAME"].ToString(); Label4.Text = dt.Rows[0]["TYPE_NAME"].ToString(); Label5.Text = dt.Rows[0]["COLOR_NAME"].ToString(); Label6.Text = dt.Rows[0]["PRICE"].ToString(); double d = Double.Parse(dt.Rows[0]["EXPECTED_DAYS"].ToString()); Label7.Text = Convert.ToString(Session["Adv"]); DateTime expdate = System.DateTime.Today.AddDays(d); Label1.Text = expdate.ToString("dd/MM/yyyy"); } RadioButtonList1.DataSource = ob.getPaymentDetails(); RadioButtonList1.DataTextField = "METHOD_NAME"; RadioButtonList1.DataValueField = "METHOD_ID"; RadioButtonList1.DataBind(); } }
protected void Button2_Click(object sender, EventArgs e) { dml ob = new dml(); DataList1.DataSource = ob.get_datalist_search_oldcar(TextBox1.Text); DataList1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dml ob = new dml(); DataList1.DataSource = ob.get_datalist_adview(); DataList1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dml ob = new dml(); DataList1.DataSource = ob.get_new_modeldetails(); DataList1.DataBind(); } }
protected void Button1_Click(object sender, EventArgs e) { if (Session["username"] == null) { Session["flag"] = "1"; Response.Redirect("WebForm7.aspx"); } else { dml ob = new dml(); string adid = ob.inc3(); string userid = (string)Session["userid"]; string extension = ""; string extension1 = ""; string id = Guid.NewGuid().ToString(); if (FileUpload1.HasFile) { if (FileUpload1.PostedFile.ContentLength <= 2048000000) { extension = id + Path.GetExtension(FileUpload1.FileName); if (FileUpload1.PostedFile.ContentType == "image/jpeg") { //fileName = Path.GetFileName(FileUpload2.PostedFile.FileName); FileUpload1.PostedFile.SaveAs(Server.MapPath("~/IMG/") + extension); } } } string id1 = Guid.NewGuid().ToString(); if (FileUpload2.HasFile) { if (FileUpload2.PostedFile.ContentLength <= 2048000000) { extension1 = id1 + Path.GetExtension(FileUpload2.FileName); if (FileUpload2.PostedFile.ContentType == "image/jpeg") { //fileName = Path.GetFileName(FileUpload2.PostedFile.FileName); FileUpload2.PostedFile.SaveAs(Server.MapPath("~/IMG/") + extension1); } } } ob.adpost_details(adid, userid, TextBox1.Text, TextBox2.Text, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text, TextBox7.Text, TextBox8.Text, TextBox9.Text, extension, extension1); TextBox1.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; TextBox7.Text = ""; TextBox8.Text = ""; TextBox9.Text = ""; Response.Redirect("AdPosting.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string search1 = (string)Session["search1"]; string search2 = (string)Session["search2"]; string search3 = (string)Session["search3"]; dml ob = new dml(); DataList1.DataSource = ob.get_datalist_searchColor(search1, search2, search3); DataList1.DataBind(); } }
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList1.SelectedValue == "0") { Label2.Text = "XXX"; } Button1.CommandArgument = DropDownList1.SelectedItem.ToString(); dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.getsubmodeldetails_label(DropDownList1.SelectedValue.ToString(), submodelid); if (dt.Rows.Count > 0) { Label2.Text = dt.Rows[0]["PRICE"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Button1.Enabled = false; string bookingid = Request.QueryString["bookingid"]; dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.get_booking_etails(bookingid); if (dt.Rows.Count > 0) { Image1.ImageUrl = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE"].ToString(); Image2.ImageUrl = "http://localhost:49447/Images/" + dt.Rows[0]["MODEL_PICTURE"].ToString(); Label1.Text = dt.Rows[0]["MODEL_NAME"].ToString(); Label2.Text = dt.Rows[0]["SUBMODEL_NAME"].ToString(); Label3.Text = dt.Rows[0]["TYPE_NAME"].ToString(); Label4.Text = dt.Rows[0]["AMOUNT"].ToString(); int paid = Int32.Parse(dt.Rows[0]["AMOUNT"].ToString()) - Int32.Parse(dt.Rows[0]["BALANCE_AMOUNT"].ToString()); Label5.Text = paid.ToString(); Label6.Text = dt.Rows[0]["BALANCE_AMOUNT"].ToString(); DateTime bookingdate = Convert.ToDateTime(dt.Rows[0]["BOOKING_DATE"].ToString()); Label7.Text = bookingdate.ToString("dd-MM-yyyy"); double day = Double.Parse(dt.Rows[0]["EXPECTED_DAYS"].ToString()); DateTime expdate = bookingdate.AddDays(day); if (dt.Rows[0]["STATUS"].ToString() == "B") { Label10.Text = "Not Issued"; Label8.Text = expdate.ToString("dd-MM-yyyy"); Button1.Enabled = true; } if (dt.Rows[0]["STATUS"].ToString() == "I") { DateTime issuedate = Convert.ToDateTime(dt.Rows[0]["ISSUE_DATE"].ToString()); Label8.Text = issuedate.ToString("dd-MM-yyyy"); Label10.Text = "Issued"; Button1.Enabled = false; } if (dt.Rows[0]["STATUS"].ToString() == "C") { Label10.Text = "Cancelled"; Label8.Text = "--"; Button1.Enabled = false; } } } }
protected void Page_Load(object sender, EventArgs e) { url = HttpContext.Current.Request.Url.AbsoluteUri; Session["url"] = url; if (!IsPostBack) { dml ob = new dml(); DropDownList1.DataSource = ob.getcolordetails(); DropDownList2.DataSource = ob.getmodeldetails(); DropDownList3.DataSource = ob.getpricedetails(); DropDownList1.DataTextField = "COLOR_NAME"; DropDownList2.DataTextField = "MODEL_NAME"; DropDownList3.DataTextField = "PRICE"; DropDownList1.DataValueField = "COLOR_NAME"; DropDownList2.DataValueField = "MODEL_NAME"; DropDownList3.DataValueField = "PRICE"; DropDownList1.DataBind(); DropDownList2.DataBind(); DropDownList3.DataBind(); } if (Session["username"] != null) { //Response.ClearHeaders(); //Response.AddHeader("Cache-Control", "no-cache, no-store, max-age=0, must-revalidate"); //Response.AddHeader("Pragma", "no-cache"); LinkButton12.Visible = true; LinkButton4.Visible = false; LinkButton5.Visible = false; LinkButton10.Visible = true; LinkButton8.Visible = true; Label1.Text = "Welcome" + " " + Session["username"].ToString(); } else { LinkButton12.Visible = false; LinkButton10.Visible = false; LinkButton4.Visible = true; LinkButton5.Visible = true; LinkButton8.Visible = false; Label1.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dml ob = new dml(); string userid = Request.QueryString["userid"]; DataTable dt = new DataTable(); dt = ob.get_booked(userid); if (dt.Rows.Count > 0) { Label1.Text = "Booked Cars"; DataList1.DataSource = dt; DataList1.DataBind(); } else { Label1.Text = "Oops!!! Seems Like You Don't Have Bookings"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //username = (string)Session["username"]; //userid = (string)Session["userid"]; dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.sliderimages(); if (dt.Rows.Count > 0) { img1.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE1"].ToString(); img2.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE2"].ToString(); img3.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE3"].ToString(); img4.Src = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE4"].ToString(); } DataList1.DataSource = ob.getmodeldetails(); DataList1.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dml ob = new dml(); DataTable dt = new DataTable(); userid = Request.QueryString["userid"]; dt = ob.get_posted_ads(userid); if (dt.Rows.Count > 0) { Label1.Text = "Your Ads"; DataList1.DataSource = dt; DataList1.DataBind(); } else { Label1.Text = "Oops!!! Seems like you haven't posted any ads"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //username = (string)Session["username2"]; //userid = (string)Session["userid2"]; submodelid = Request.QueryString["submodelid"]; if (submodelid == null) { submodelid = (string)Session["submodel_id"]; } Button1.CommandName = submodelid; if (submodelid != "") { dml ob = new dml(); DataTable dt = new DataTable(); DataTable dt1 = new DataTable(); DropDownList1.DataSource = ob.getsubmodeldetails_drop(submodelid); DropDownList1.DataTextField = "COLOR_NAME"; DropDownList1.DataValueField = "Expr1"; DropDownList1.DataBind(); dt = ob.getsubmodeldetails_1(submodelid); if (dt.Rows.Count > 0) { Image1.ImageUrl = "http://localhost:49447/Images/" + dt.Rows[0]["PICTURE"].ToString(); Label1.Text = dt.Rows[0]["SUBMODEL_NAME"].ToString(); } dt1 = ob.getfeatures(submodelid); Label6.Text = "<ul type='square'>"; if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { Label6.Text = Label6.Text + "<li>" + dt1.Rows[i]["FEATURE_NAME"].ToString() + "</li>"; } } Label6.Text = Label6.Text + "</ul>"; } } }
protected void Button2_Click(object sender, EventArgs e) { dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.check1(TextBox4.Text); if (dt.Rows.Count > 0) { ClientScript.RegisterStartupScript(GetType(), "alert", "alert('UserName Alredy Exist!');", true); TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; } else { string userid = ob.inc2(); ob.user_details(userid, TextBox6.Text, TextBox5.Text, TextBox4.Text, TextBox3.Text); TextBox3.Text = ""; TextBox4.Text = ""; TextBox5.Text = ""; TextBox6.Text = ""; } }
protected void Button1_Click(object sender, EventArgs e) { dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.check(TextBox2.Text, TextBox1.Text); if (dt.Rows.Count > 0) { TextBox1.Text = ""; TextBox2.Text = ""; Session["username"] = dt.Rows[0]["FIRST_NAME"].ToString(); Session["userid"] = dt.Rows[0]["USER_ID"].ToString(); if (Session["url"] != null) { string url = (string)Session["url"]; if (url == "http://localhost:52193/WebForm7.aspx") { Response.Redirect("WebForm2.aspx"); } else if (Session["adpost"] != null) { Response.Redirect("AdPosting.aspx"); } else { Response.Redirect(url); } } } else { } TextBox1.Text = ""; TextBox2.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string adid = Request.QueryString["adid"]; dml ob = new dml(); DataTable dt = new DataTable(); dt = ob.get_addetails(adid); if (dt.Rows.Count > 0) { Label1.Text = dt.Rows[0]["NAME"].ToString(); Label2.Text = dt.Rows[0]["CONTACT_NO"].ToString(); Label3.Text = dt.Rows[0]["COMPANY"].ToString(); Label4.Text = dt.Rows[0]["MODEL"].ToString(); Label5.Text = dt.Rows[0]["SUB_MODEL"].ToString(); Label6.Text = dt.Rows[0]["FUEL_TYPE"].ToString(); Label7.Text = dt.Rows[0]["YEAR"].ToString(); Label8.Text = dt.Rows[0]["KILOMETER"].ToString(); Label9.Text = dt.Rows[0]["EXPECTED_PRICE"].ToString(); Image1.ImageUrl = "~/IMG/" + dt.Rows[0]["PICTURE"].ToString(); Image2.ImageUrl = "~/IMG/" + dt.Rows[0]["PICTURE1"].ToString(); } } }