protected virtual int ExecuteAction(MyCompany.Data.Objects.THMForcastMonthImport theTHMForcastMonthImport, MyCompany.Data.Objects.THMForcastMonthImport original_THMForcastMonthImport, string lastCommandName, string commandName, string dataView)
        {
            ActionArgs args = new ActionArgs();

            args.Controller      = "THMForcastMonthImport";
            args.View            = dataView;
            args.Values          = CreateFieldValues(theTHMForcastMonthImport, original_THMForcastMonthImport);
            args.LastCommandName = lastCommandName;
            args.CommandName     = commandName;
            ActionResult result = ControllerFactory.CreateDataController().Execute("THMForcastMonthImport", dataView, args);

            result.RaiseExceptionIfErrors();
            result.AssignTo(theTHMForcastMonthImport);
            return(result.RowsAffected);
        }
        protected virtual FieldValue[] CreateFieldValues(MyCompany.Data.Objects.THMForcastMonthImport theTHMForcastMonthImport, MyCompany.Data.Objects.THMForcastMonthImport original_THMForcastMonthImport)
        {
            List <FieldValue> values = new List <FieldValue>();

            values.Add(new FieldValue("AutoId", original_THMForcastMonthImport.AutoId, theTHMForcastMonthImport.AutoId, true));
            values.Add(new FieldValue("OrderBy", original_THMForcastMonthImport.OrderBy, theTHMForcastMonthImport.OrderBy));
            values.Add(new FieldValue("DeliveryDestination", original_THMForcastMonthImport.DeliveryDestination, theTHMForcastMonthImport.DeliveryDestination));
            values.Add(new FieldValue("CustomerMatCode", original_THMForcastMonthImport.CustomerMatCode, theTHMForcastMonthImport.CustomerMatCode));
            values.Add(new FieldValue("PartsDevision", original_THMForcastMonthImport.PartsDevision, theTHMForcastMonthImport.PartsDevision));
            values.Add(new FieldValue("CustomerPO", original_THMForcastMonthImport.CustomerPO, theTHMForcastMonthImport.CustomerPO));
            values.Add(new FieldValue("Key1", original_THMForcastMonthImport.Key1, theTHMForcastMonthImport.Key1));
            values.Add(new FieldValue("Key2", original_THMForcastMonthImport.Key2, theTHMForcastMonthImport.Key2));
            values.Add(new FieldValue("Key3", original_THMForcastMonthImport.Key3, theTHMForcastMonthImport.Key3));
            values.Add(new FieldValue("ReliabilityDevision", original_THMForcastMonthImport.ReliabilityDevision, theTHMForcastMonthImport.ReliabilityDevision));
            values.Add(new FieldValue("DeliveryDate", original_THMForcastMonthImport.DeliveryDate, theTHMForcastMonthImport.DeliveryDate));
            values.Add(new FieldValue("Quantity", original_THMForcastMonthImport.Quantity, theTHMForcastMonthImport.Quantity));
            values.Add(new FieldValue("Unit", original_THMForcastMonthImport.Unit, theTHMForcastMonthImport.Unit));
            values.Add(new FieldValue("PlngPeriod", original_THMForcastMonthImport.PlngPeriod, theTHMForcastMonthImport.PlngPeriod));
            values.Add(new FieldValue("SAPCode", original_THMForcastMonthImport.SAPCode, theTHMForcastMonthImport.SAPCode));
            values.Add(new FieldValue("FileId", original_THMForcastMonthImport.FileId, theTHMForcastMonthImport.FileId));
            values.Add(new FieldValue("StatusCode", original_THMForcastMonthImport.StatusCode, theTHMForcastMonthImport.StatusCode));
            return(values.ToArray());
        }
 public virtual int Delete(MyCompany.Data.Objects.THMForcastMonthImport theTHMForcastMonthImport)
 {
     return(ExecuteAction(theTHMForcastMonthImport, theTHMForcastMonthImport, "Select", "Delete", DeleteView));
 }
 public virtual int Insert(MyCompany.Data.Objects.THMForcastMonthImport theTHMForcastMonthImport)
 {
     return(ExecuteAction(theTHMForcastMonthImport, new THMForcastMonthImport(), "New", "Insert", InsertView));
 }
 public virtual int Update(MyCompany.Data.Objects.THMForcastMonthImport theTHMForcastMonthImport)
 {
     return(Update(theTHMForcastMonthImport, SelectSingle(theTHMForcastMonthImport.AutoId)));
 }
 public virtual int Update(MyCompany.Data.Objects.THMForcastMonthImport theTHMForcastMonthImport, MyCompany.Data.Objects.THMForcastMonthImport original_THMForcastMonthImport)
 {
     return(ExecuteAction(theTHMForcastMonthImport, original_THMForcastMonthImport, "Edit", "Update", UpdateView));
 }
 public List <MyCompany.Data.Objects.THMForcastMonthImport> Select(MyCompany.Data.Objects.THMForcastMonthImport qbe)
 {
     return(Select(qbe.AutoId, qbe.OrderBy, qbe.DeliveryDestination, qbe.CustomerMatCode, qbe.PartsDevision, qbe.CustomerPO, qbe.Key1, qbe.Key2, qbe.Key3, qbe.ReliabilityDevision, qbe.DeliveryDate, qbe.Quantity, qbe.Unit, qbe.PlngPeriod, qbe.SAPCode, qbe.FileId, qbe.StatusCode));
 }
 public static List <MyCompany.Data.Objects.THMForcastMonthImport> Select(MyCompany.Data.Objects.THMForcastMonthImport qbe)
 {
     return(new THMForcastMonthImportFactory().Select(qbe));
 }