Exemplo n.º 1
0
 public ActionResult DeletePartial(TypeOfMaterial typeofmtrl)
 {
     typeofmtrl.Status     = "InActive";
     typeofmtrl.ModifiedOn = DateTime.Now;
     _TypeOfMaterialService.UpdateTypeOfMaterial(typeofmtrl);
     return(RedirectToAction("UpdateDetails/" + typeofmtrl.MaterialId, "TypeOfMaterial"));
 }
Exemplo n.º 2
0
        public ActionResult UpdateDetails(int id)
        {
            TypeOfMaterial material = new TypeOfMaterial();

            material = _TypeOfMaterialService.GetMaterialDetailById(id);
            TempData["MaterialList"] = _TypeOfMaterialService.getAllTypeOfMaterial();
            return(View(material));
        }
Exemplo n.º 3
0
        public int InsertTypeofMaterial(TypeOfMaterial _typeofmaterial)
        {
            var parameters = new List <KeyValuePair <string, object> >()
            {
                new KeyValuePair <string, object>("mid", _typeofmaterial.mid),
                new KeyValuePair <string, object>("tmname", _typeofmaterial.tmname),
                new KeyValuePair <string, object>("comments", _typeofmaterial.comments),
            };

            return(_db.ExecuteNonQuery(_conn, "cons.insert_typeofmaterial", CommandType.StoredProcedure, parameters.AsEnumerable()));
        }
Exemplo n.º 4
0
        public ActionResult Create([ModelBinder(typeof(TypeOfMaterialCustomBinder))] TypeOfMaterial typeofmaterial)
        {
            MainApplication model = new MainApplication();

            model.TypeOfMaterialData = new TypeOfMaterial();
            var details = _TypeOfMaterialService.GetMaterialLast();
            int matval  = 0;
            int length  = 0;

            if (details != null)
            {
                matval = details.MaterialId;
                matval = matval + 1;
                length = matval.ToString().Length;
            }
            else
            {
                matval = 1;
                length = 1;
            }
            String MaterialCode = _utilityService.getName("TM", length, matval);

            model.TypeOfMaterialData.MaterialCode = MaterialCode;

            var materiallist = _TypeOfMaterialService.GetMaterialNames(typeofmaterial.MaterialName);

            if (materiallist.Count() != 0)
            {
                TempData["MaterialList"] = "error";
                return(RedirectToAction("Create"));
            }
            else
            {
                _TypeOfMaterialService.AddTypeOfMaterial(typeofmaterial);
            }

            var id         = _TypeOfMaterialService.GetMaterialLast().MaterialId;
            var MaterialId = Encode(id.ToString());

            return(RedirectToAction("CreateDetails/" + MaterialId, "TypeOfMaterial"));
        }
Exemplo n.º 5
0
 public int InsertTypeofMaterial(TypeOfMaterial _typeofmaterial)
 {
     return(_materialDAL.InsertTypeofMaterial(_typeofmaterial));
 }
 public void UpdateTypeOfMaterial(TypeOfMaterial typeOfMaterial)
 {
     _typeOfMaterialRepository.Update(typeOfMaterial);
     _unitOfWork.Commit();
 }
 public void AddTypeOfMaterial(TypeOfMaterial typeOfMaterial)
 {
     _typeOfMaterialRepository.Add(typeOfMaterial);
     _unitOfWork.Commit();
 }