public ActionResult UpdateFlight(string FlightNum, string userype, string isDelete, string isEdit, string source, string dest, string arrdt, string arrti, string depdt, string depti, string amt, string seats) { if (isDelete == "True") { new Bal().deleteFlightDetails(FlightNum); } else { new Bal().updateFlightDetails(source, dest, arrdt, arrti, depdt, depti, amt, seats, FlightNum); } var model = new List<Add_New_FlightViewModel>(); DataTable dt = new Bal().getFlightDetails().Tables[0]; foreach (DataRow row in dt.Rows) { Add_New_FlightViewModel addFlight = new Add_New_FlightViewModel(); addFlight.txtfcompany = Convert.ToString(row["FlightCompany"]); addFlight.txtfno = Convert.ToString(row["FlightNumber"]); addFlight.txtsource = Convert.ToString(row["Source"]); addFlight.txtdestination = Convert.ToString(row["Destination"]); addFlight.txtarrdate = Convert.ToString(row["ArrivalDate"]); addFlight.txtArrivTime = Convert.ToString(row["Arrivaltime"]); addFlight.txtdepdate = Convert.ToString(row["DepatureDate"]); addFlight.txtdeptime = Convert.ToString(row["Deptime"]); addFlight.txtamt = Convert.ToString(row["PerSeatAmount"]); addFlight.txtnoofseats = Convert.ToString(row["NumberOfSeats"]); model.Add(addFlight); } return View(@"~\Views\Admin\View_Flight_Details.cshtml", model); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { flight_id_lbl.Text = Request.QueryString["FlightNumber"].ToString(); Session["FlightNumber"] = flight_id_lbl.Text; HttpCookie getcust_cook = Request.Cookies.Get("customer_id_cookie"); cid_lbl.Text = getcust_cook.Value.ToString(); Bal b = new Bal(); //customer DataTable dt1 = b.bookcustomer_info_bl(int.Parse(cid_lbl.Text)); txtcustname.Text = dt1.Rows[0]["Name"].ToString(); txtcustemail.Text = dt1.Rows[0]["Email"].ToString(); txtadd.Text = dt1.Rows[0]["Address"].ToString(); txtphn.Text = dt1.Rows[0]["Phone"].ToString(); txtbirthdate.Text = dt1.Rows[0]["Birthdate"].ToString(); //flight DataTable dt2 = b.bookflight_info_bl((flight_id_lbl.Text.ToString())); txtfname.Text = dt2.Rows[0]["FlightName"].ToString(); txtleavefrom.Text = dt2.Rows[0]["LeavingFrom"].ToString(); txtgoingto.Text = dt2.Rows[0]["Goingto"].ToString(); txtdepdate.Text = dt2.Rows[0]["DepartureDate"].ToString(); txtdeptime.Text = dt2.Rows[0]["DepartureTime"].ToString(); txtfare.Text = dt2.Rows[0]["Fare"].ToString(); txtnop.Text = Session["noofseats"].ToString(); txttf.Text = (Convert.ToInt32(txtfare.Text) * Convert.ToInt32(txtnop.Text)).ToString(); } }
private void btnCal_Click(object sender, EventArgs e) { frmEmployee emp = new frmEmployee(); double balanceDue = emp.getBalanceDue; double Bal; try { connect = new SqlConnection(connectionString); connect.Open(); string readQuery = @"SELECT * FROM Tab WHERE Cust_ID = '" + txtTabID.Text + "'"; command = new SqlCommand(readQuery, connect); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Bal = double.Parse(reader.GetValue(1).ToString()); Bal += balanceDue; listBox1.Items.Add("New Balance: " + Bal.ToString()); } connect.Close(); } catch (SqlException err) { MessageBox.Show(err.Message); } emp.ShowDialog(); }
public ActionResult Login(LoginViewModel model) { DataSet ds = new Bal().login(model.type, model.uname, model.pwd); if (ds.Tables[0].Rows.Count > 0) { if (model.type == "Admin") { Session["aname"] = model.uname; //return Redirect(@"~\Views\Admin\Add_New_Flight?userTyp=" + model.type); return RedirectToAction("Home", "Admin", new { userype = model.type }); } if (model.type == "Manager") { Session["mname"] = model.uname; return RedirectToAction("Home", "Manager", new { userype = model.type }); //return Redirect(@"~\Views\Manager\Add_New_Flight.cshtml"); } if (model.type == "User") { Session["uname"] = model.uname; Session["MobileNo"] = ds.Tables[0].Rows[0]["MobileNo"].ToString(); return RedirectToAction("Home", "Customer", new { userype = model.type }); } } return View(model); }
public ActionResult AddNewFlight(Add_New_FlightViewModel model) { int i = new Bal().AddFlight(model.txtfcompany, model.txtfno, model.txtsource, model.txtdestination, model.txtarrdate, model.txtArrivTime, model.txtdepdate, model.txtdeptime, model.txtamt, model.txtnoofseats); if (i > 0) TempData["message"] = "Flight Details Inserted Successfully"; return View(@"~\Views\Admin\Add_New_Flight.cshtml", model); }
public ActionResult FlighDetails() { var model = new List<Add_New_FlightViewModel>(); DataTable dt = new Bal().getFlightDetails().Tables[0]; foreach (DataRow row in dt.Rows) { Add_New_FlightViewModel addFlight = new Add_New_FlightViewModel(); addFlight.txtfcompany = Convert.ToString(row["FlightCompany"]); addFlight.txtfno = Convert.ToString(row["FlightNumber"]); addFlight.txtsource = Convert.ToString(row["Source"]); addFlight.txtdestination = Convert.ToString(row["Destination"]); addFlight.txtarrdate = Convert.ToString(row["ArrivalDate"]); addFlight.txtArrivTime = Convert.ToString(row["Arrivaltime"]); addFlight.txtdepdate = Convert.ToString(row["DepatureDate"]); addFlight.txtdeptime = Convert.ToString(row["Deptime"]); addFlight.txtamt = Convert.ToString(row["PerSeatAmount"]); addFlight.txtnoofseats = Convert.ToString(row["NumberOfSeats"]); model.Add(addFlight); } return View(@"~\Views\Admin\View_Flight_Details.cshtml", model); }
public ActionResult History() { var model = new List<ViewReservations>(); DataTable dt = new Bal().ViewReservation(Session["uname"].ToString()).Tables[0]; foreach (DataRow row in dt.Rows) { ViewReservations view = new ViewReservations(); view.bookingId = Convert.ToString(row["BookingID"]); view.bookingDate = Convert.ToString(row["BookingDate"]); view.company = Convert.ToString(row["FlightName"]); view.number = Convert.ToString(row["FlightNumber"]); view.source = Convert.ToString(row["Source"]); view.destination = Convert.ToString(row["Destination"]); view.arrivalDate = Convert.ToString(row["ArrivalDate"]); view.arrivTime = Convert.ToString(row["Arrivaltime"]); view.depDate = Convert.ToString(row["DepatureDate"]); view.depTime = Convert.ToString(row["Deptime"]); view.seats = Convert.ToString(row["NumberOfSeatsBooking"]); view.price = Convert.ToString(row["Price"]); view.amount = Convert.ToString(row["Amount"]); view.status = Convert.ToString(row["Status"]); model.Add(view); } return View(@"~\Views\Customer\ViewReservationdetails.cshtml", model); }
public ActionResult Payment(Payment model) { int i = new Bal().payment(Session["bookingid"].ToString(), Session["uname"].ToString(), Session["totalamountt"].ToString(), model.cardtype, model.cardno, model.cvv, model.cname, "Accepted", model.edate); if (i > 0) TempData["message"] = "Booking & Payment Successfully Completed"; return RedirectToAction("Home"); }
public ActionResult ChangePassword(ChangePasswordViewModel model) { int i = new Bal().ChangePassword(model.uname, model.old, model.newpwd); if (i > 0) TempData["message"] = "Password Update Successfully Completed"; return View(@"~\Views\Customer\ChangePassword.cshtml", model); }
public DataTable select_user(Bal b) { da = new SqlDataAdapter("select * from EmployeeMaster where EmpId=@id", con); da.SelectCommand.Parameters.AddWithValue("@id", b.EMPID); DT = new DataTable(); da.Fill(DT); return(DT); }
public DataTable select_project(Bal b) { da = new SqlDataAdapter("select * from ProjectMaster where ProjectId=@id", con); da.SelectCommand.Parameters.AddWithValue("@id", b.projectId); DT = new DataTable(); da.Fill(DT); return(DT); }
internal DataTable select_company(Bal b) { da = new SqlDataAdapter("select * from CompanyMaster where CompanyId=@id", con); da.SelectCommand.Parameters.AddWithValue("@id", b.COMPANYID); DT = new DataTable(); da.Fill(DT); return(DT); }
public ActionResult ManagerRegistration(ManagerRegistrationViewModel model) { string password = GeneratePassword(6); int i = new Bal().ManagerRegistration(model.txtfname, model.txlname, model.txtEmail, model.txtMob, model.ddlgender, model.ddlcountry, model.ddlstate, model.txtaddress, password); if (i > 0) TempData["message"] = "Registration Successfully Completed"; return View(@"~\Views\Admin\ManagerRegistration.cshtml", model); }
// #region // dropdwon binding // public ActionResult BookFlight(BookingFlightViewModel model) // { // DataTable dt = new Bal().getFlightCompany().Tables[0]; // model.flightNames = new List<SelectListItem>(); // List<SelectListItem> lst = new List<SelectListItem>(); // foreach (DataRow row in dt.Rows) // { // SelectListItem bookFlight = new SelectListItem(); // bookFlight.Text = Convert.ToString(row["FlightCompany"]); // bookFlight.Value = Convert.ToString(row["FlightCompany"]); // lst.Add(bookFlight); // model.flightNames.Add(bookFlight); // } // bookingid(); // return View(@"~\Views\Customer\BookFlight.cshtml", model); // } //#end public void bookingid() { SqlDataReader sdr = new Bal().getBookingId(); if (sdr.Read()) { int i = Convert.ToInt32(sdr[0].ToString()) + 1; Session["bookingid"] = "Booking0" + i.ToString(); } }
protected override void SiparisDuz(int spno, string t, string i, bool b, bool l) { TostSinif tost = null; IcecekSinif icecek = null; Iicindekiler ici = new KadikoySube(); List <SiparisSinif> temp = new List <SiparisSinif>(); if (t != null) { if (t.Equals("Kasarli")) { tost = new KasarliTost(ici); } else if (t.Equals("Ayvalik")) { tost = new AyvalikTostu(ici); } else { tost = new KarisikTost(ici); } temp.Add(tost); } if (i != null) { if (i.Equals("Oralet")) { icecek = new Oralet(); } else if (i.Equals("Ihlamur")) { icecek = new Ihlamur(); } else { icecek = new SiyahCay(); } if (b) { icecek = new Bal(icecek); } if (l) { icecek = new Limon(icecek); } temp.Add(icecek); } siparisler[spno][0] = null; siparisler[spno][0] = tost; siparisler[spno][1] = null; siparisler[spno][1] = icecek; }
public ActionResult Booking(BookingFlightViewModel model) { bookingid(); int i = new Bal().UserBooking(Session["bookingid"].ToString(), Session["uname"].ToString(), model.txtfcompany, model.txtfno, model.txtsource, model.txtdestination, model.txtbookingdate, model.txtarrdate, model.txtArrivTime, model.txtdepdate, model.txtdeptime, Convert.ToInt32(model.txtbookingseats), model.txtamt, model.txttotamt); if (i > 0) { TempData["message"] = "Flight Booking Completed\n Please Pay The Amount"; Session["totalamountt"] = model.txttotamt; //return View(@"~\Views\Customer\Payment.cshtml", model); return RedirectToAction("Payment"); } else return RedirectToAction("Message"); }
public ActionResult Search() { //now its working mama don't do any changes var model = new List<Add_New_FlightViewModel>(); if (Session["txtsource"] != null) { string from = Convert.ToString(Session["txtsource"]); string to = Convert.ToString(Session["txtdestination"]); DataTable dt = new Bal().SearchFlightDetails(from, to).Tables[0]; foreach (DataRow row in dt.Rows) { Add_New_FlightViewModel Flight = new Add_New_FlightViewModel(); Flight.txtfcompany = Convert.ToString(row["FlightCompany"]); Flight.txtfno = Convert.ToString(row["FlightNumber"]); Flight.txtsource = Convert.ToString(row["Source"]); Flight.txtdestination = Convert.ToString(row["Destination"]); Flight.txtarrdate = Convert.ToString(row["ArrivalDate"]); Flight.txtArrivTime = Convert.ToString(row["Arrivaltime"]); Flight.txtdepdate = Convert.ToString(row["DepatureDate"]); Flight.txtdeptime = Convert.ToString(row["Deptime"]); Flight.txtamt = Convert.ToString(row["PerSeatAmount"]); Flight.txtnoofseats = Convert.ToString(row["AvailableSeats"]); model.Add(Flight); } } else { DataTable dt = new Bal().getFlightDetails().Tables[0]; foreach (DataRow row in dt.Rows) { Add_New_FlightViewModel addFlight = new Add_New_FlightViewModel(); addFlight.txtfcompany = Convert.ToString(row["FlightCompany"]); addFlight.txtfno = Convert.ToString(row["FlightNumber"]); addFlight.txtsource = Convert.ToString(row["Source"]); addFlight.txtdestination = Convert.ToString(row["Destination"]); addFlight.txtarrdate = Convert.ToString(row["ArrivalDate"]); addFlight.txtArrivTime = Convert.ToString(row["Arrivaltime"]); addFlight.txtdepdate = Convert.ToString(row["DepatureDate"]); addFlight.txtdeptime = Convert.ToString(row["Deptime"]); addFlight.txtamt = Convert.ToString(row["PerSeatAmount"]); addFlight.txtnoofseats = Convert.ToString(row["AvailableSeats"]); model.Add(addFlight); } } return View(@"~\Views\Customer\SearchFlight.cshtml", model); }
public int insertnewmilestonedal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("Update [Unit-Target-Linktable] set [Actual-Date]='" + b._AActualeDate + "', [update date]='" + b._UupdateDate + "' where [Unit-Target-Linktable].id in (select c.id from [Unit-Target-Linktable] c left outer join dbo.Unit d on d.ID=c.UNIT left outer join dbo.Block e on e.ID=d.Block left outer join dbo.Projects s on s.ID=e.Project where s.[Project Name] like '" + b._PPojNName + "' and [Task details] like '" + b._Mmilestone + "'and d.[Unit No]='" + b._Uunit + "' and d.Floor='" + b._FForeName + "' and PlotNo like '" + b._PPlName + "' and e.Block like '" + b._BbocName + "')", con); int a = cmd.ExecuteNonQuery(); con.Close(); return(a); } catch { throw; } }
public int insertmilestonedalnull(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("Update [Unit-Target-Linktable] set [Actual-Date]=" + b._actualDatenull + ", [update date]='" + b._Udate + "' where [Unit-Target-Linktable].id in (select c.id from [Unit-Target-Linktable] c left outer join dbo.Unit d on d.ID=c.UNIT left outer join dbo.Block e on e.ID=d.Block left outer join dbo.Projects s on s.ID=e.Project where s.[Project Name] like '" + b._PName + "' and [Task details] like '" + b._MileName + "' and PlotNo like '" + b._PlName + "' and e.Block like '" + b._BName + "')", con); int a = cmd.ExecuteNonQuery(); con.Close(); return(a); } catch { throw; } }
public int linnkinfodal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("insert into [Unit-Target-Linktable](Unit,[Task details],[Actual-Date],[update date]) values(" + b._linkplot + ",'" + b._linkMilestone + "','" + b._linkActualDate + "','" + b._linkUpdatedate + "')", con); int a = cmd.ExecuteNonQuery(); con.Close(); return(a); } catch { throw; } }
public DataSet bindgridtargetdal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct a.[Project Name],b.Block,c.PlotNo,d.ID,d.[Task details],d.[Target-Date],d.[update date],d.Remarks from Projects a join Block b on a.ID=b.Project join Unit c on b.ID=c.Block join [Unit-Target-Linktable] d on c.ID=d.UNIT where a.[Project Name]='" + b._p1 + "' and b.Block='" + b._P2 + "' and c.PlotNo='" + b._p3 + "' and d.[Task details]='" + b._p4 + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public DataSet bindbalinkinfodal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct [Project Name] from Projects where ID in(select ProjectId from dbo.UserProjectMapping where UserId=" + b._sessionid + ")", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public DataSet bindmilestonedal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct [Task details] from [Unit-Target-Linktable] t join dbo.Unit u on u.ID=t.UNIT join Block b on b.ID=u.Block join Projects a on a.ID=b.Project where u.[Unit No]='" + b._newunit + "' and PlotNo='" + b._newplot + "' and a.[Project Name]='" + b._newProject + "' and b.Block='" + b._newblock + "' and u.Floor='" + b._newfloor + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public DataSet bindmilstonedal1(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct Label from [Task Master] t join dbo.Projects p on p.ID=t.ProjectID where p.[Project Name]='" + b._milestone1 + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public ActionResult Search2(Add_New_FlightViewModel s) { string fromstring = string.Empty; string tostring = string.Empty; string from=Request["txtsource"]; string to=Request["txtdestination"]; if (from!= ""&&from!=null) { Session["txtsource"] = from; fromstring = Session["txtsource"].ToString(); } if (to != "" && to != null) { Session["txtdestination"] = to; tostring = Session["txtdestination"].ToString(); } var model = new List<Add_New_FlightViewModel>(); if (fromstring != null && tostring != null) { DataTable dt = new Bal().SearchFlightDetails(s.txtsource, s.txtdestination).Tables[0]; foreach (DataRow row in dt.Rows) { Add_New_FlightViewModel Flight = new Add_New_FlightViewModel(); Flight.txtfcompany = Convert.ToString(row["FlightCompany"]); Flight.txtfno = Convert.ToString(row["FlightNumber"]); Flight.txtsource = Convert.ToString(row["Source"]); Flight.txtdestination = Convert.ToString(row["Destination"]); Flight.txtarrdate = Convert.ToString(row["ArrivalDate"]); Flight.txtArrivTime = Convert.ToString(row["Arrivaltime"]); Flight.txtdepdate = Convert.ToString(row["DepatureDate"]); Flight.txtdeptime = Convert.ToString(row["Deptime"]); Flight.txtamt = Convert.ToString(row["PerSeatAmount"]); Flight.txtnoofseats = Convert.ToString(row["NumberOfSeats"]); Flight.txtavailseats = Convert.ToString(row["AvailableSeats"]); model.Add(Flight); } } ViewBag.source = from; ViewBag.destination = to; //return View(@"~\Views\Customer\SearchFlight.cshtml", model); return RedirectToAction("Search"); }
public DataSet bindmilstonedal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct [Task details] from [Unit-Target-Linktable] a join dbo.Unit b on a.Unit=b.ID where b.PlotNo='" + b._milestonell + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public DataSet bindplotkdal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct a.PlotNo from dbo.Unit a join dbo.Block b on b.ID=a.Block join Projects p on p.ID=b.Project where p.[Project Name]='" + b._PPPname + "' and b.Block='" + b._blockid + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public DataSet bindblockdal(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct b.Block,b.ID from Block b join dbo.Projects p on p.ID=b.Project where p.[Project Name]='" + b._projectid + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
public DataSet bindunit(Bal b) { try { con.Open(); SqlCommand cmd = new SqlCommand("select distinct [Unit No] from dbo.Unit u join Block b on u.Block=b.ID join Projects p on p.ID=b.Project where u.PlotNo='" + b._NPlotName + "' and p.[Project Name] ='" + b._NprojectName + "' and b.Block = '" + b._NBlockName + "' and u.Floor= '" + b._NfloorName + "'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); con.Close(); return(ds); } catch { throw; } }
protected void Button1_Click(object sender, EventArgs e) { try { Bal b = new Bal(); int res = b.update_customer_bl(Convert.ToInt32(Txtcustid.Text), editname.Text, editemail.Text, editaddress.Text, editmobno.Text, Convert.ToDateTime(editdob.Text), editGender.Text, editpassword.Text); if (res > 0) //ie 1 row affected in SQL for Insertion { Response.Write("<script>alert('Customer Updated Successfully');window.location.href='CustomerFacility.aspx';</script>"); } } catch (Exception ex) { Response.Write(ex.Message); } }