Example #1
0
        protected virtual int ExecuteAction(MyCompany.Data.Objects.MaterialNumber theMaterialNumber, MyCompany.Data.Objects.MaterialNumber original_MaterialNumber, string lastCommandName, string commandName, string dataView)
        {
            ActionArgs args = new ActionArgs();

            args.Controller      = "MaterialNumber";
            args.View            = dataView;
            args.Values          = CreateFieldValues(theMaterialNumber, original_MaterialNumber);
            args.LastCommandName = lastCommandName;
            args.CommandName     = commandName;
            ActionResult result = ControllerFactory.CreateDataController().Execute("MaterialNumber", dataView, args);

            result.RaiseExceptionIfErrors();
            result.AssignTo(theMaterialNumber);
            return(result.RowsAffected);
        }
Example #2
0
        protected virtual FieldValue[] CreateFieldValues(MyCompany.Data.Objects.MaterialNumber theMaterialNumber, MyCompany.Data.Objects.MaterialNumber original_MaterialNumber)
        {
            List <FieldValue> values = new List <FieldValue>();

            values.Add(new FieldValue("AutoId", original_MaterialNumber.AutoId, theMaterialNumber.AutoId, true));
            values.Add(new FieldValue("SoldtoParty", original_MaterialNumber.SoldtoParty, theMaterialNumber.SoldtoParty));
            values.Add(new FieldValue("ShiptoParty", original_MaterialNumber.ShiptoParty, theMaterialNumber.ShiptoParty));
            values.Add(new FieldValue("CustomerItemNumber", original_MaterialNumber.CustomerItemNumber, theMaterialNumber.CustomerItemNumber));
            values.Add(new FieldValue("MassPartsIDFlag", original_MaterialNumber.MassPartsIDFlag, theMaterialNumber.MassPartsIDFlag));
            values.Add(new FieldValue("ExpansionKey1", original_MaterialNumber.ExpansionKey1, theMaterialNumber.ExpansionKey1));
            values.Add(new FieldValue("ExpansionKey2", original_MaterialNumber.ExpansionKey2, theMaterialNumber.ExpansionKey2));
            values.Add(new FieldValue("ExpansionKey3", original_MaterialNumber.ExpansionKey3, theMaterialNumber.ExpansionKey3));
            values.Add(new FieldValue("VaridityDateTo", original_MaterialNumber.VaridityDateTo, theMaterialNumber.VaridityDateTo));
            values.Add(new FieldValue("ValiditydateFrom", original_MaterialNumber.ValiditydateFrom, theMaterialNumber.ValiditydateFrom));
            values.Add(new FieldValue("PLANT", original_MaterialNumber.PLANT, theMaterialNumber.PLANT));
            values.Add(new FieldValue("MaterialNumber", original_MaterialNumber.MaterialNumber_, theMaterialNumber.MaterialNumber_));
            values.Add(new FieldValue("UnitCode", original_MaterialNumber.UnitCode, theMaterialNumber.UnitCode));
            return(values.ToArray());
        }
Example #3
0
 public virtual int Delete(MyCompany.Data.Objects.MaterialNumber theMaterialNumber)
 {
     return(ExecuteAction(theMaterialNumber, theMaterialNumber, "Select", "Delete", DeleteView));
 }
Example #4
0
 public virtual int Insert(MyCompany.Data.Objects.MaterialNumber theMaterialNumber)
 {
     return(ExecuteAction(theMaterialNumber, new MaterialNumber(), "New", "Insert", InsertView));
 }
Example #5
0
 public virtual int Update(MyCompany.Data.Objects.MaterialNumber theMaterialNumber)
 {
     return(Update(theMaterialNumber, SelectSingle(theMaterialNumber.AutoId)));
 }
Example #6
0
 public virtual int Update(MyCompany.Data.Objects.MaterialNumber theMaterialNumber, MyCompany.Data.Objects.MaterialNumber original_MaterialNumber)
 {
     return(ExecuteAction(theMaterialNumber, original_MaterialNumber, "Edit", "Update", UpdateView));
 }
Example #7
0
 public List <MyCompany.Data.Objects.MaterialNumber> Select(MyCompany.Data.Objects.MaterialNumber qbe)
 {
     return(Select(qbe.AutoId, qbe.SoldtoParty, qbe.ShiptoParty, qbe.CustomerItemNumber, qbe.MassPartsIDFlag, qbe.ExpansionKey1, qbe.ExpansionKey2, qbe.ExpansionKey3, qbe.VaridityDateTo, qbe.ValiditydateFrom, qbe.PLANT, qbe.MaterialNumber_, qbe.UnitCode));
 }
Example #8
0
 public static List <MyCompany.Data.Objects.MaterialNumber> Select(MyCompany.Data.Objects.MaterialNumber qbe)
 {
     return(new MaterialNumberFactory().Select(qbe));
 }