Example #1
0
        public static ICollection Update(DBCommand cmd, ICollection instance, decimal?value, decimal?offset)
        {
            instance.Offset = offset;
            instance.Value  = value;

            return(cmd.Update("Collection", instance));
        }
Example #2
0
        public static ICase Update(DBCommand cmd, ICase instance, string type, string text)
        {
            instance.Type = type;
            instance.Text = text;

            return(cmd.Update("Case", instance));
        }
Example #3
0
        public static IUser Update(DBCommand cmd, IUser instance, string name, string password, UserRole?role)
        {
            instance.Name     = name;
            instance.Password = password;
            instance.Role     = role;

            return(cmd.Update("User", instance));
        }
Example #4
0
        public static ICustomer Update(DBCommand cmd, ICustomer instance, string id, string name, string sex, string phone, string address)
        {
            instance.ID      = id;
            instance.Name    = name;
            instance.Sex     = sex;
            instance.Phone   = phone;
            instance.Address = address;

            return(cmd.Update("Customer", instance));
        }
Example #5
0
        public static IApplication Update(DBCommand cmd, IApplication instance, string id,
                                          string customerId, string region, DateTime?dateApplied,
                                          DateTime?dateTraved, string offNoteNo, DateTime?offNoteDate, string remark)
        {
            instance.ID          = id;
            instance.CustomerID  = customerId;
            instance.Region      = region;
            instance.DateApplied = dateApplied;
            instance.DateTraved  = dateTraved;
            instance.OffNoteDate = offNoteDate;
            instance.OffNoteNo   = offNoteNo;
            instance.Remark      = remark;

            return(cmd.Update("Application", instance));
        }
Example #6
0
        private static IApplication UpdateApplication(DBCommand cmd, IApplication instance, IDictionary <IAttributeDefinition, object> changes)
        {
            if (!(instance is ApplicationProxy))
            {
                Debug.Assert(false, "The given instance is not proxy type.");
            }

            var entity  = instance as ApplicationProxy;
            var orginal = entity.Original as ApplicationProxy;

            foreach (IAttributeDefinition attr in changes.Keys)
            {
                orginal.SetValue(attr, changes[attr]);
            }

            if (entity.customerId == orginal.customerId && entity.customer != null)
            {
                orginal.customer = cmd.Update("Customer", entity.customer) as ICustomer;
            }

            return(entity);
        }
Example #7
0
        public static IStatus Update(DBCommand cmd, IStatus instance, string value)
        {
            instance.Value = value;

            return(cmd.Update("Status", instance));
        }