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()); }
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); }
public virtual int Delete(MyCompany.Data.Objects.Customer theCustomer) { return(ExecuteAction(theCustomer, theCustomer, "Select", "Delete", DeleteView)); }
public virtual int Insert(MyCompany.Data.Objects.Customer theCustomer) { return(ExecuteAction(theCustomer, new Customer(), "New", "Insert", InsertView)); }
public virtual int Update(MyCompany.Data.Objects.Customer theCustomer) { return(Update(theCustomer, SelectSingle(theCustomer.CustomerId))); }
public virtual int Update(MyCompany.Data.Objects.Customer theCustomer, MyCompany.Data.Objects.Customer original_Customer) { return(ExecuteAction(theCustomer, original_Customer, "Edit", "Update", UpdateView)); }
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)); }
public static List <MyCompany.Data.Objects.Customer> Select(MyCompany.Data.Objects.Customer qbe) { return(new CustomerFactory().Select(qbe)); }