public static UserModel ToUserModel(this CompanyDE from, UserModel dest = null) { var to = dest ?? new UserModel(); if (to.Id <= 0) { to.Id = from.Id; to.IsActive = true; } else { to.IsActive = from.IsActive; //to.ModifiedDate = DateTime.Now; } // to.LastName = from.bas.LastName; ////to.Email = from.Email; ////to.Password = from.Password; ////to.FirstName = from.Name; /////////////////////////// ////to.MobilePhone = from.ContactNo; //to.Logo = from.Logo; //to.CompanyName = from.CompanyName; //to.AddressId = from.AddressId; //to.UserImagePath = from.UserImagePath; //to.Biography = from.Biography; //to.CreatedById = from.CreatedById; //to.CreatedDate = from.CreatedDate; ////////////////////////////// //to.Salt = from.Salt; //salt to.IsActive = from.IsActive; return(to); }
public static CompanyDE Translate(this CompanyMD from, CompanyDE dest = null) { var to = dest ?? new CompanyDE(); if (to.Id <= 0) { to.Id = from.Id; to.IsActive = true; } else { to.IsActive = from.IsActive; //to.ModifiedDate = DateTime.Now; } to.Name = from.Name; //to.Password = from.Password; //to.Email = from.Email; //to.ContactNo = from.ContactNo; to.Logo = from.Logo; //to.Salt = from.Salt; //to.PasswordForgetKey = from.PasswordForgetKey; to.ImagePath = from.ImagePath; return(to); }
public static CompanyDE Translate(this CompanySignUpModel from, CompanyDE dest = null) { var to = dest ?? new CompanyDE(); if (to.Id <= 0) { to.Id = from.Id; to.IsActive = true; } else { to.IsActive = from.IsActive; //to.ModifiedDate = DateTime.Now; } to.Name = from.CompanyName; ////to.Email = from.Email; ////to.Password = from.Password; ////to.ContactNo = from.Phone; //to.Logo = from.Logo; //to.CompanyName = from.CompanyName; //to.AddressId = from.AddressId; //to.UserImagePath = from.UserImagePath; //to.Biography = from.Biography; //to.CreatedById = from.CreatedById; //to.CreatedDate = from.CreatedDate; //to.IsActive = from.IsActive; return(to); }
public Company Post([FromBody] Company model) { // POST: api/User // this post method insert the new row or update the current row if there is a record with same ID CompanyDE de = new CompanyDE(); Company sonuc = de.AddCompany(model, model.User); return(sonuc); }
public IEnumerable <Company> Get(int id) { // GET: api/Company //HttpContext.RiseError(new InvalidOperationException("Test")); Company model = new Company(); CompanyDE de = new CompanyDE(); return(de.GetCompany(id)); }
public IActionResult Delete(int id) { // DELETE: api/ApiWithActions/5 CompanyDE de = new CompanyDE(); bool sonuc = de.DeleteCompany(id); if (sonuc) { return(Ok()); } else { return(NotFound()); } }
public IActionResult Put([FromBody] Company model) { // POST: api/Company // this post method insert the new row or update the current row if there is a record with same ID CompanyDE de = new CompanyDE(); bool sonuc = de.UpdateCompany(model); if (sonuc) { return(Ok()); } else { return(NotFound()); } }
public static CompanyMD Translate(this CompanyDE from) { var to = new CompanyMD(); to.Id = from.Id; to.Name = from.Name; //to.Password = from.Password; //to.Email = from.Email; //to.ContactNo = from.ContactNo; to.Logo = from.Logo; //to.Salt = from.Salt; //to.PasswordForgetKey = from.PasswordForgetKey; to.ImagePath = from.ImagePath; return(to); }