public bool Execute() { if (EditFlag == "M") { using (var cmd = new CustomerUpdateRepository()) { cmd.Item = this.Item; return(cmd.Execute()); } } else { using (var cmd = new CustomerInsertRepository()) { cmd.Item = this.Item; return(cmd.Execute()); } } }
public bool Execute() { if (EditFlag == "M") // modifi - sua { this.Item._id = this.Item.CustomerId.ToObjectId(); using (var cmd = new CustomerUpdateRepository()) { cmd.Item = this.Item; return(cmd.Execute()); } } else { using (var cmd = new CustomerInsertRepository()) { cmd.Item = this.Item; return(cmd.Execute()); } } }