Exemplo n.º 1
0
 public int DeleteProductionCategory(EditProductionCategory model)
 {
     int result = 1;
     ProductionCategory efModel = model.EditProductionCategoryToEF();
     try
     {
         _repository.Update(efModel);
     }
     catch
     {
         result = 0;
     }
     return result;
 }
Exemplo n.º 2
0
 public int AddProductionCategory(EditProductionCategory model)
 {
     int result = 1;
     ProductionCategory EFModel = model.EditProductionCategoryToEF();
     try
     {
         _repository.Create(EFModel);
     }
     catch
     {
         result = 0;
     }
     return result;
 }
Exemplo n.º 3
0
        public static EditProductionCategory EFToEditProductionCategory(this ProductionCategory model)
        {
            EditProductionCategory result = new EditProductionCategory();
            result.Id = model.Id.ToString();
            result.Code = model.Code;
            result.Name = model.Name;
            result.Unit = model.Unit;
            result.Cost = model.Cost.ToString();
            result.Profit = model.Profit.ToString();
            result.CreateDate = model.CreateDate.ToString();
            result.DeleteMark = model.DeleteMark;

            return result;
        }
Exemplo n.º 4
0
        public string Add(string code, string name, string unit, string cost, string profit)
        {
            string result = "";

            EditProductionCategory editModel = new EditProductionCategory();
            editModel.Code = code;
            editModel.Name = name;
            editModel.Unit = unit;
            editModel.Cost = cost;
            editModel.Profit = profit;
            editModel.CreateDate = DateTime.Now.ToString();
            editModel.DeleteMark = false;

            result = _service.AddProductionCategory(editModel).ToString();

            return result;
        }
Exemplo n.º 5
0
        public string Delete(string id, string code, string name, string unit, string cost, string profit, string createDate)
        {
            string result = "";

            EditProductionCategory editModel = new EditProductionCategory();
            editModel.Id = id;
            editModel.Code = code;
            editModel.Name = name;
            editModel.Unit = unit;
            editModel.Cost = cost;
            editModel.Profit = profit;
            editModel.CreateDate = createDate;
            editModel.DeleteMark = true;

            result = _service.DeleteProductionCategory(editModel).ToString();

            return result;
        }