public string UpdateSubItemRawMaterial(SubItemRawIndentModel model) { var Path = Server.MapPath("/xmlkot/SubItemRawMaterial.xml"); var Data = obj.UpdateSubItemRawMaterial(model, Path); return(Data); }
public SubItemRawIndentModel AddSubMenuRawIndent() { SubItemRawIndentModel model = new SubItemRawIndentModel(); model.lstofsubItems = GetListofSubItems(); model.lstofUnits = GetListofUnits(); model.lstofRawCategories = GetListofRawCategories(); return(model); }
public string UpdateSubItemRawMaterial(SubItemRawIndentModel model, string path) { int oulte = 99; //int unitid = Convert.ToInt32(model.Unit); XDocument xd = XDocument.Load(path); //var unit = _entities.Units.Where(x => x.UnitId == unitid).SingleOrDefault(); var newElement = new XElement("SubItems", new XElement("UserId", oulte), new XElement("RawCategoryId", model.RawMaterialCategoryId), new XElement("SubItemId", model.SubItemId), new XElement("RawMaterialId", model.RawMaterialId), new XElement("Unit", model.Unit), new XElement("Quantity", model.Quantity), new XElement("Portion", model.Portion) ); xd.Element("SubItem").Add(newElement); xd.Save(path); //} return(UpdateSubItemRawMaterial(model.SubItemId, path)); }