public async Task <IActionResult> Edit(int id, [Bind("EnterpriceId,Name,Tel,Address,Observations")] Enterprice enterprice) { if (id != enterprice.EnterpriceId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(enterprice); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EnterpriceExists(enterprice.EnterpriceId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(enterprice)); }
public int UpdateEnterpriceInfo0(Enterprice enterprice) { StringBuilder sql = new StringBuilder(); sql.Append("update Enterprice set Enterprice_FullName=@fullName,Enterprice_ShortName=@shortName,Enterprice_Url=@url,Enterprice_Introduction=@introduction,Enterprice_Location=@location,Enterprice_LocationCity=@locationCity,Enterprice_Scale=@scale where Enterprice_Email like @email"); SqlParameter[] par = { new SqlParameter("@fullName", SqlDbType.Text), new SqlParameter("@shortName", SqlDbType.Text), new SqlParameter("@url", SqlDbType.Text), new SqlParameter("@introduction", SqlDbType.Text), new SqlParameter("@location", SqlDbType.Text), new SqlParameter("@locationCity", SqlDbType.Text), new SqlParameter("@scale", SqlDbType.Text), new SqlParameter("@email", SqlDbType.Text) }; par[0].Value = enterprice.Enterprice_FullName; par[1].Value = enterprice.Enterprice_ShortName; par[2].Value = enterprice.Enterprice_Url; par[3].Value = enterprice.Enterprice_Introduction; par[4].Value = enterprice.Enterprice_Location; par[5].Value = enterprice.Enterprice_LocationCity; par[6].Value = enterprice.Enterprice_Scale; par[7].Value = enterprice.Enterprice_Email; return(Common.DbHelperSQL.ExecuteSql(sql.ToString(), par)); }
public Enterprice GetEnterpriceID(string email) { OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory(); OxcoderIDAL.EnterpriseInfoIDAL en = factory.getEnterpriseInstance(); Enterprice enterprice = en.GetEnterpriceID(email); return(enterprice); }
public override string ToString() { string info = Enterprice.GetInfo(UserName); if (info == null || info.Count() == 0) { return("Инофрмации о вас не обнаружено."); } return(Status + " " + info); }
public async Task <IActionResult> Create([Bind("EnterpriceId,Name,Tel,Address,Observations")] Enterprice enterprice) { if (ModelState.IsValid) { _context.Add(enterprice); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(enterprice)); }
public Enterprice GetEnterpriceID(string email) { StringBuilder sql = new StringBuilder(); sql.Append("select Enterprice_ID,Enterprice_FullName from [Enterprice] where Enterprice_Email like @email"); SqlParameter[] par = { new SqlParameter("@email", SqlDbType.Text) }; par[0].Value = email; SqlDataReader rd = Common.DbHelperSQL.ExecuteReader(sql.ToString(), par); Enterprice enterprice = new Enterprice(); if (rd.Read()) { enterprice.Enterprice_ID = rd["Enterprice_ID"].ToString(); enterprice.Enterprice_FullName = rd["Enterprice_FullName"].ToString(); } return(enterprice); }
public bool Add(string login, string password, string userName, ClassOfDriver qualification) { UserDriver driver = new UserDriver(login, password, userName); if (connector.Create(driver) != null) { bool result = Enterprice.AddDriver(userName, qualification); if (result) { return(true); } else { connector.Delete(driver.Id); return(false); } } else { return(false); } }
public List <string> GetWaybills(string UserName) { return(Enterprice.GetWaybillsByUserName(UserName)); }
public bool AddVan(double GasUse, int PassCapacity) { return(Enterprice.AddVan(GasUse, PassCapacity)); }
public bool AddTruck(double GasUse, double Capacity) { return(Enterprice.AddTruck(GasUse, Capacity)); }
public bool AddBus(double GasUse, double Capacity, int PassCapacity) { return(Enterprice.AddBus(GasUse, PassCapacity, Capacity)); }
public bool AddWayBill(double distance, DateTime dateTime, int carid, int driverid) { return(Enterprice.AddWayBill(distance, dateTime, carid, driverid)); }
public int UpdateEnterpriceInfo0(Enterprice enterprice) { OxcoderIFactory.IFactory factory = new OxcoderFactory.SqlSeverFactory(); OxcoderIDAL.EnterpriseInfoIDAL dalad = factory.getEnterpriseInstance(); return(dalad.UpdateEnterpriceInfo0(enterprice)); }
public string GetProfit(Waybill wb) { return(Enterprice.GetProfit(wb).ToString()); }
public Waybill Update(Waybill wb) { return(Enterprice.Update(wb)); }
public Drivers.Driver Update(Drivers.Driver driver) { return(Enterprice.Update(driver)); }
public bool Remove(Waybill wb) { return(Enterprice.Delete(wb)); }
public bool Remove(Car car) { return(Enterprice.Delete(car)); }
public string GetFullProfit() { return(Enterprice.GetFullProfit().ToString()); }
public Car Update(Car car) { return(Enterprice.Update(car)); }
public bool Remove(Drivers.Driver driver) { return(Enterprice.Delete(driver)); }
public string GetMostProfitDrivers(DateTime bottom, DateTime up, string carType) { return(Enterprice.GetMostProfitDriver(bottom, up, carType)); }