Exemple #1
0
        public string UpdateSubItemRawMaterial(SubItemRawIndentModel model)
        {
            var Path = Server.MapPath("/xmlkot/SubItemRawMaterial.xml");
            var Data = obj.UpdateSubItemRawMaterial(model, Path);

            return(Data);
        }
Exemple #2
0
        public SubItemRawIndentModel AddSubMenuRawIndent()
        {
            SubItemRawIndentModel model = new SubItemRawIndentModel();

            model.lstofsubItems      = GetListofSubItems();
            model.lstofUnits         = GetListofUnits();
            model.lstofRawCategories = GetListofRawCategories();
            return(model);
        }
Exemple #3
0
        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));
        }