예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 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);
 }
예제 #4
0
        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);
        }
예제 #5
0
 public ContractShipmentTable(ContractShipment contractShipment, StoreCell storeCellFrom, Storehouse storehouseFrom)
 {
     this.contractShipment = contractShipment;
     this.storeCellFrom    = storeCellFrom;
     this.storehouseFrom   = storehouseFrom;
 }