public bool queryUpdateContractShipment(ContractShipment c) { if (LoginInfo.Position == 1 || LoginInfo.Position == 3) //Начальник или Кладовщик { using (DataBaseContext db = new DataBaseContext()) { try { ContractShipment contract = db.ContractShipments.Find(c.Id); contract.ProductId = c.ProductId; contract.Amount = c.Amount; contract.StoreCellFromId = c.StoreCellFromId; contract.Date = c.Date; db.SaveChanges(); } catch (Exception e) { return(false); } return(true); } } return(false); }
public ContractShipment queryFindContractShipmentById(int Id) { if (LoginInfo.Position == 1 || LoginInfo.Position == 3) //Начальник или Кладовщик { using (DataBaseContext db = new DataBaseContext()) { ContractShipment c = db.ContractShipments.Find(Id); c.StoreCellFromObj = c.StoreCellFromObj; return(c); } } return(null); }
public bool queryAddContractShipment(ContractShipment c) { if (LoginInfo.Position == 1 || LoginInfo.Position == 3) //Начальник или Кладовщик { using (DataBaseContext db = new DataBaseContext()) { try { db.ContractShipments.Add(c); db.SaveChanges(); } catch (Exception e) { return(false); } return(true); } } return(false); }
public bool queryDeleteContractShipment(int Id) { if (LoginInfo.Position == 1 || LoginInfo.Position == 3) //Начальник или Кладовщик { using (DataBaseContext db = new DataBaseContext()) { try { ContractShipment contract = db.ContractShipments.Find(Id); db.ContractShipments.Remove(contract); db.SaveChanges(); } catch (Exception e) { return(false); } return(true); } } return(false); }
public ContractShipmentTable(ContractShipment contractShipment, StoreCell storeCellFrom, Storehouse storehouseFrom) { this.contractShipment = contractShipment; this.storeCellFrom = storeCellFrom; this.storehouseFrom = storehouseFrom; }