Esempio n. 1
0
        protected virtual FieldValue[] CreateFieldValues(MyCompany.Data.Objects.Customer theCustomer, MyCompany.Data.Objects.Customer original_Customer)
        {
            List <FieldValue> values = new List <FieldValue>();

            values.Add(new FieldValue("CustomerId", original_Customer.CustomerId, theCustomer.CustomerId, true));
            values.Add(new FieldValue("Code", original_Customer.Code, theCustomer.Code));
            values.Add(new FieldValue("Name", original_Customer.Name, theCustomer.Name));
            values.Add(new FieldValue("Code2", original_Customer.Code2, theCustomer.Code2));
            values.Add(new FieldValue("Code3", original_Customer.Code3, theCustomer.Code3));
            values.Add(new FieldValue("LocationCode", original_Customer.LocationCode, theCustomer.LocationCode));
            values.Add(new FieldValue("PlantCode", original_Customer.PlantCode, theCustomer.PlantCode));
            values.Add(new FieldValue("AddressCode", original_Customer.AddressCode, theCustomer.AddressCode));
            values.Add(new FieldValue("Contact", original_Customer.Contact, theCustomer.Contact));
            values.Add(new FieldValue("Address", original_Customer.Address, theCustomer.Address));
            values.Add(new FieldValue("City", original_Customer.City, theCustomer.City));
            values.Add(new FieldValue("State", original_Customer.State, theCustomer.State));
            values.Add(new FieldValue("Country", original_Customer.Country, theCustomer.Country));
            values.Add(new FieldValue("ZIPCode", original_Customer.ZIPCode, theCustomer.ZIPCode));
            values.Add(new FieldValue("Phone", original_Customer.Phone, theCustomer.Phone));
            values.Add(new FieldValue("Mobile", original_Customer.Mobile, theCustomer.Mobile));
            values.Add(new FieldValue("Fax", original_Customer.Fax, theCustomer.Fax));
            values.Add(new FieldValue("Email", original_Customer.Email, theCustomer.Email));
            values.Add(new FieldValue("Remark", original_Customer.Remark, theCustomer.Remark));
            values.Add(new FieldValue("CreateBy", original_Customer.CreateBy, theCustomer.CreateBy));
            values.Add(new FieldValue("CreateDate", original_Customer.CreateDate, theCustomer.CreateDate));
            values.Add(new FieldValue("UpdateBy", original_Customer.UpdateBy, theCustomer.UpdateBy));
            values.Add(new FieldValue("UpdateDate", original_Customer.UpdateDate, theCustomer.UpdateDate));
            return(values.ToArray());
        }
Esempio n. 2
0
        protected virtual int ExecuteAction(MyCompany.Data.Objects.Customer theCustomer, MyCompany.Data.Objects.Customer original_Customer, string lastCommandName, string commandName, string dataView)
        {
            ActionArgs args = new ActionArgs();

            args.Controller      = "Customer";
            args.View            = dataView;
            args.Values          = CreateFieldValues(theCustomer, original_Customer);
            args.LastCommandName = lastCommandName;
            args.CommandName     = commandName;
            ActionResult result = ControllerFactory.CreateDataController().Execute("Customer", dataView, args);

            result.RaiseExceptionIfErrors();
            result.AssignTo(theCustomer);
            return(result.RowsAffected);
        }
Esempio n. 3
0
 public virtual int Delete(MyCompany.Data.Objects.Customer theCustomer)
 {
     return(ExecuteAction(theCustomer, theCustomer, "Select", "Delete", DeleteView));
 }
Esempio n. 4
0
 public virtual int Insert(MyCompany.Data.Objects.Customer theCustomer)
 {
     return(ExecuteAction(theCustomer, new Customer(), "New", "Insert", InsertView));
 }
Esempio n. 5
0
 public virtual int Update(MyCompany.Data.Objects.Customer theCustomer)
 {
     return(Update(theCustomer, SelectSingle(theCustomer.CustomerId)));
 }
Esempio n. 6
0
 public virtual int Update(MyCompany.Data.Objects.Customer theCustomer, MyCompany.Data.Objects.Customer original_Customer)
 {
     return(ExecuteAction(theCustomer, original_Customer, "Edit", "Update", UpdateView));
 }
Esempio n. 7
0
 public List <MyCompany.Data.Objects.Customer> Select(MyCompany.Data.Objects.Customer qbe)
 {
     return(Select(qbe.CustomerId, qbe.Code, qbe.Name, qbe.Code2, qbe.Code3, qbe.LocationCode, qbe.PlantCode, qbe.AddressCode, qbe.Contact, qbe.Address, qbe.City, qbe.State, qbe.Country, qbe.ZIPCode, qbe.Phone, qbe.Mobile, qbe.Fax, qbe.Email, qbe.CreateBy, qbe.CreateDate, qbe.UpdateBy, qbe.UpdateDate));
 }
Esempio n. 8
0
 public static List <MyCompany.Data.Objects.Customer> Select(MyCompany.Data.Objects.Customer qbe)
 {
     return(new CustomerFactory().Select(qbe));
 }