private static Locator getEntityByModel(LocatorModel model)
        {
            if (model == null) return null;

            Locator entity = new Locator();
            if (model.Id == 0)
            {
                entity.CompanyId = AuthenticationHelper.CompanyId.Value;
                entity.CreateBy = AuthenticationHelper.UserId;
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                entity.CompanyId = model.CompanyId;
                entity.CreateBy = model.CreateBy;
                entity.CreateDate = model.CreateDate;
            }

            entity.Description = model.Description;
            entity.Id = model.Id;
            entity.SOBId = model.SOBId;
            entity.Status = model.Status;
            entity.UpdateBy = AuthenticationHelper.UserId;
            entity.UpdateDate = DateTime.Now;
            return entity;
        }
 public string Update(Locator entity)
 {
     Locator originalEntity = this.Context.Locators.Find(entity.Id);
     this.Context.Entry(originalEntity).CurrentValues.SetValues(entity);
     this.Context.Entry(originalEntity).State = EntityState.Modified;
     this.Commit();
     return entity.Id.ToString();
 }
 public LocatorModel(Locator entity)
 {
     this.CompanyId = entity.CompanyId;
     this.CreateBy = entity.CreateBy;
     this.CreateDate = entity.CreateDate;
     this.Description = entity.Description;
     this.Id = entity.Id;
     this.SOBId = entity.SOBId;
     this.Status = entity.Status;
     this.UpdateBy = entity.UpdateBy;
     this.UpdateDate = entity.UpdateDate;
 }
 public string Insert(Locator entity)
 {
     this.Context.Locators.Add(entity);
     this.Commit();
     return entity.Id.ToString();
 }
 public string Update(Locator entity)
 {
     return this.repository.Update(entity);
 }
 public string Insert(Locator entity)
 {
     return this.repository.Insert(entity);
 }