public HttpResponseMessage talimatturleriDelete(talimattanim talimat) { AcekaResult acekaResult = null; if (talimat != null) { talimat.degistiren_carikart_id = Tools.PersonelId; //buraya sistemi açan kullanıcı bilgisi gelecek talimat.degistiren_tarih = DateTime.Now; // Kayıtın Silindiği Tarih Bilgisi Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("talimatturu_id", talimat.talimatturu_id); fields.Add("degistiren_carikart_id", talimat.degistiren_carikart_id); fields.Add("degistiren_tarih", talimat.degistiren_tarih); fields.Add("statu", 0); fields.Add("kayit_silindi", 1); acekaResult = CrudRepository.Update("talimat", new string[] { "talimatturu_id" }, fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful - talimatturu_id = " + acekaResult.RetVal.ToString() })); } else { return(null); } }
public HttpResponseMessage PersonelParametreinsert(Personel_Parametre_Model per) { AcekaResult acekaResult = null; if (per != null) { if (per.carikart_id.acekaToLong() > 0) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("carikart_id", per.carikart_id); fields.Add("cari_parametre_1", per.cari_parametre_1); fields.Add("cari_parametre_2", per.cari_parametre_2); fields.Add("cari_parametre_3", per.cari_parametre_3); fields.Add("cari_parametre_4", per.cari_parametre_4); fields.Add("cari_parametre_5", per.cari_parametre_5); fields.Add("cari_parametre_6", per.cari_parametre_6); fields.Add("cari_parametre_7", per.cari_parametre_7); acekaResult = CrudRepository.Update("carikart", "carikart_id", fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } else { return(Request.CreateResponse(HttpStatusCode.NoContent, acekaResult)); } } else { return(Request.CreateResponse(HttpStatusCode.NoContent, new Models.AnonymousModels.NotFound { message = "No Record" })); } }
public HttpResponseMessage PersonelParametreput(takvim t) { AcekaResult acekaResult = null; if (t != null) { if (t.tarih.Date.acekaToString().Length.acekaToInt() > 0) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("tarih", t.tarih); fields.Add("tatil_turu", t.tatil_turu); fields.Add("aciklama", t.aciklama); acekaResult = CrudRepository.Update("takvim", "tarih", fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } else { return(Request.CreateResponse(HttpStatusCode.NotFound, new Models.AnonymousModels.NotFound { message = "No Record" })); } } else { return(Request.CreateResponse(HttpStatusCode.NotFound, new Models.AnonymousModels.NotFound { message = "No Record" })); } }
public HttpResponseMessage FiyatTalimatUpdate(stokkart_fiyat_talimat t) { AcekaResult acekaResult = new AcekaResult(); if (t != null) { t.degistiren_carikart_id = 0; Dictionary <string, object> fields_muh = new Dictionary <string, object>(); fields_muh.Add("fiyat", t.fiyat); fields_muh.Add("degistiren_carikart_id", 0); fields_muh.Add("stokkart_id", t.stokkart_id); fields_muh.Add("carikart_id", t.carikart_id); fields_muh.Add("talimatturu_id_1", t.talimatturu_id_1); fields_muh.Add("talimatturu_id_2", t.talimatturu_id_2); fields_muh.Add("talimatturu_id_3", t.talimatturu_id_3); fields_muh.Add("talimatturu_id_4", t.talimatturu_id_4); fields_muh.Add("talimatturu_id_5", t.talimatturu_id_5); fields_muh.Add("talimatturu_id_6", t.talimatturu_id_6); fields_muh.Add("talimatturu_id_7", t.talimatturu_id_7); fields_muh.Add("talimatturu_id_8", t.talimatturu_id_8); fields_muh.Add("talimatturu_id_9", t.talimatturu_id_9); fields_muh.Add("pb", t.pb); //acekaResult = CrudRepository<stokkart_fiyat_talimat>.Update(t, "stokkart_fiyat_talimat", new string[] { "stokkart_id", "carikart_id", "talimatturu_id_1", "talimatturu_id_2", "talimatturu_id_3", "talimatturu_id_4", "talimatturu_id_5", "talimatturu_id_6", "talimatturu_id_7", "talimatturu_id_8", "talimatturu_id_9", "pb" }); acekaResult = CrudRepository.Update("stokkart_fiyat_talimat", new string[] { "stokkart_id", "carikart_id", "talimatturu_id_1", "talimatturu_id_2", "talimatturu_id_3", "talimatturu_id_4", "talimatturu_id_5", "talimatturu_id_6", "talimatturu_id_7", "talimatturu_id_8", "talimatturu_id_9", "pb" }, fields_muh); return(Request.CreateResponse(HttpStatusCode.OK, acekaResult)); } return(null); }
public IHttpActionResult GTipPut(Models.GenelAyarlar.GtipModel.gtip_belge gtipModel) { AcekaResult acekaResult = null; if (gtipModel != null && gtipModel.belge_id > 0) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("belge_id", gtipModel.belge_id); fields.Add("stokkart_tipi_id", gtipModel.stokkart_tipi_id); fields.Add("stokalan_id_1", gtipModel.stokalan_id_1); fields.Add("stokalan_id_2", gtipModel.stokalan_id_2); fields.Add("stokalan_id_3", gtipModel.stokalan_id_3); fields.Add("stokalan_id_4", gtipModel.stokalan_id_4); fields.Add("degistiren_carikart_id", gtipModel.degistiren_carikart_id); fields.Add("degistiren_tarih", gtipModel.degistiren_tarih); fields.Add("gtip_genel", gtipModel.gtip_genel); fields.Add("gtip_bayan", gtipModel.gtip_bayan); fields.Add("aciklama", gtipModel.aciklama); fields.Add("birim", gtipModel.birim); fields.Add("adet", gtipModel.adet); fields.Add("kg", gtipModel.kg); fields.Add("birim_fob", gtipModel.birim_fob); fields.Add("toplam_fob", gtipModel.toplam_fob); fields.Add("pb", gtipModel.pb); string[] Wherefields = { "belge_id", "stokkart_tipi_id", "stokalan_id_1", "stokalan_id_2", "stokalan_id_3", "stokalan_id_4" }; acekaResult = CrudRepository.Update("gtip_belgedetay", Wherefields, fields); return(Ok(acekaResult)); } return(BadRequest()); }
public ActionResult Edit([Bind(Include = "ID,Title,Publisher,ReleaseTime,Content")] Infor infor) { if (ModelState.IsValid) { inforRepo.Update(infor); return(RedirectToAction("Index")); } return(View(infor)); }
public ActionResult Edit([Bind(Include = "ID,PowerID,Password,Name")] Member member) { if (ModelState.IsValid) { memberRepo.Update(member); return(RedirectToAction("Index")); } return(View(member)); }
public async Task <ApiResponse <string> > RequestRegistration(string email) { var response = new ApiResponse <string>(); using (var tx = _registrationRequestRepo.Context.Database.BeginTransaction()) { try { var isEmailAlreadyRegistered = _userRepo.List(i => i.Email == email).Any(); if (isEmailAlreadyRegistered) { response.Success = false; response.ErrorMesssage.Add(MtsResource.InvalidEmail); } if (response.Success) { var registrationRequest = _registrationRequestRepo.List(i => i.Email == email).FirstOrDefault(); string token = RandomGenerator.GenerateString(50); if (registrationRequest != null) { registrationRequest.Token = token; await _registrationRequestRepo.Update(registrationRequest); } else { await _registrationRequestRepo.Save(new Entity.RegistrationRequest { Email = email, Token = token, CreatedDate = DateTime.UtcNow, UpdatedDate = DateTime.UtcNow }); } _emailService.Send(new EmailBody { Content = GenerateRegistrationRequestBody(token, email), From = "*****@*****.**", To = email, Subject = "Registration Request" }); tx.Commit(); } } catch (Exception e) { response.Success = false; response.ErrorMesssage.Add(e.GetBaseException().Message); tx.Rollback(); } } return(response); }
public ActionResult Edit([Bind(Include = "ID, MemberId, FeatInfor, FeatLogRec")] Feature feature) { if (ModelState.IsValid) { featRepo.Update(feature); return(RedirectToAction("Index")); } return(View(feature)); }
public HttpResponseMessage PersonelIletisimPut(Personel_Carikart_genel_adres_Model per) { AcekaResult acekaResult = null; if (per != null) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("carikart_adres_id", per.carikart_adres_id); fields.Add("carikart_id", per.carikart_id); fields.Add("degistiren_carikart_id", per.degistiren_carikart_id); fields.Add("kayit_silindi", per.kayit_silindi); fields.Add("statu", per.statu); fields.Add("adres_tipi_id", per.adres_tipi_id); fields.Add("postakodu", per.postakodu); fields.Add("adres", per.adres); if (per.adrestanim != null) { fields.Add("adrestanim", per.adrestanim); } if (per.adresunvan != null) { fields.Add("adresunvan", per.adresunvan); } fields.Add("ulke_id ", per.ulke_id); fields.Add("sehir_id", per.sehir_id); fields.Add("ilce_id ", per.ilce_id); fields.Add("semt_id", per.semt_id); if (per.vergidairesi != null) { fields.Add("vergidairesi", per.vergidairesi); } if (per.vergino != null) { fields.Add("vergino", per.vergino); } fields.Add("tel1", per.tel1); fields.Add("tel2", per.tel2); fields.Add("fax", per.fax); fields.Add("email", per.email); fields.Add("websitesi", per.websitesi); fields.Add("yetkili_ad_soyad", per.yetkili_ad_soyad); fields.Add("yetkili_tel", per.yetkili_tel); fields.Add("faturaadresi", per.faturaadresi); acekaResult = CrudRepository.Update("carikart_genel_adres", "carikart_adres_id", fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } else { return(Request.CreateResponse(HttpStatusCode.NotFound, new Models.AnonymousModels.NotFound { message = "No Record" })); } }
public async Task <ActionResult> Update(StudentDto studentDto) { Student student = await repo.GetById(studentDto.Id); _mapper.Map(studentDto, student); bool result = await repo.Update(student); string message = result ? "Kayıt tamamlandı" : "Kayıt tamamlanmadı.."; return(Ok(message)); }
public static async Task UpdateRecord() { using (var tx = entities.Database.BeginTransaction()) { var record = await repo.Get(1); record.Name = "Test Editied"; await repo.Update(record); tx.Commit(); } }
public HttpResponseMessage talimatturleriUpdate(talimattanim talimat) { AcekaResult acekaResult = null; if (talimat != null) { talimat.degistiren_carikart_id = Tools.PersonelId; //buraya sistemi açan kullanıcı bilgisi gelecek talimat.degistiren_tarih = DateTime.Now; // Kayıtın Eklendiği Tarih Bilgisi Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("talimatturu_id", talimat.talimatturu_id); fields.Add("degistiren_carikart_id", talimat.degistiren_carikart_id); fields.Add("degistiren_tarih", talimat.degistiren_tarih); fields.Add("statu", talimat.statu); fields.Add("kod", talimat.kod); fields.Add("varsayilan", talimat.varsayilan); fields.Add("tanim", talimat.tanim); fields.Add("tanim_dil1", talimat.tanim_dil1); fields.Add("tanim_dil2", talimat.tanim_dil2); fields.Add("tanim_dil3", talimat.tanim_dil3); fields.Add("tanim_dil4", talimat.tanim_dil4); fields.Add("tanim_dil5", talimat.tanim_dil5); fields.Add("sira", talimat.sira); fields.Add("renk_rgb", talimat.renk_rgb); fields.Add("kesim", talimat.kesim); fields.Add("dikim", talimat.dikim); fields.Add("parca", talimat.parca); fields.Add("model", talimat.model); fields.Add("stokkart_tipi_id", 21); fields.Add("onayoto", 1); fields.Add("parcamodel_giris", talimat.parcamodel_giris); fields.Add("parcamodel_cikis", talimat.parcamodel_cikis); fields.Add("model_zorunlu", talimat.model_zorunlu); fields.Add("varsayilan_fasoncu", talimat.varsayilan_fasoncu); fields.Add("kdv_tevkifat", talimat.kdv_tevkifat); acekaResult = CrudRepository.Update("talimat", new string[] { "talimatturu_id" }, fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful - talimatturu_id = " + acekaResult.RetVal.ToString() })); } else { return(null); } }
public HttpResponseMessage Personel_GenelDelete(Personel_Model per) { AcekaResult acekaResult = null; if (per != null) { if (per.carikart_id.acekaToLong() > 0) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("carikart_id", per.carikart_id); fields.Add("degistiren_carikart_id", per.degistiren_carikart_id); fields.Add("statu", per.statu); fields.Add("cari_unvan", per.cari_unvan); fields.Add("ozel_kod", per.ozel_kod); fields.Add("giz_kullanici_adi", per.giz_kullanici_adi); fields.Add("giz_kullanici_sifre", per.giz_kullanici_sifre); fields.Add("kayit_silindi", 1); if (per.sube_carikart_id > 0) { fields.Add("sube_carikart_id", per.sube_carikart_id); } acekaResult = CrudRepository.Update("carikart", "carikart_id", fields); if (acekaResult != null && acekaResult.RetVal.acekaToInt() > 0 & (per.muh_masraf != null && per.muh_masraf.muh_kod.ToString().Length > 0)) { if (per.muh_masraf != null) { Dictionary <string, object> fields_muh = new Dictionary <string, object>(); fields_muh.Add("carikart_id", per.carikart_id); if (per.muh_masraf.sirket_id > 0) { fields_muh.Add("sirket_id", per.muh_masraf.sirket_id); } fields_muh.Add("degistiren_carikart_id", per.degistiren_carikart_id); fields_muh.Add("muh_kod", per.muh_masraf.muh_kod); string[] Wherefields = { "sirket_id", "carikart_id" }; acekaResult = CrudRepository.Delete("carikart_muhasebe", Wherefields, fields_muh); } } return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } } return(null); }
public async Task <dto.ApiResponse <bool> > UpdateProfile(dto.UserProfile model) { var apiResponse = new dto.ApiResponse <bool>(); try { var userentity = _mapper.Map <entity.User>(model); await _userRepo.Update(userentity); var addressEntity = _mapper.Map <entity.Address>(model.Address); await _addressRepo.Update(addressEntity); }catch (Exception e) { apiResponse.Success = false; apiResponse.ErrorMesssage.Add(MtsResource.ServiceInternalServerError); } return(apiResponse); }
public ActionResult EditConfirm(Models.user mvc) { UserDAL.user dal = repo.View(mvc.userId); dal.userId = mvc.userId; dal.userName = mvc.userName; dal.Phone = mvc.Phone; dal.Email = mvc.Email; dal.Password = mvc.Password; bool result = repo.Update(dal); if (result) { ViewBag.Msg = "Updated Successfully!"; } else { ViewBag.ErrorMsg = "Update Failed"; } return(View("EditUser")); }
public IHttpActionResult sistemayarlariput(Models.GenelAyarlar.SistemModel.SistemAyarlariModel sistemModel) { AcekaResult acekaResult = null; if (sistemModel != null && sistemModel.ayar != null) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("belge_id", sistemModel.ayaradi); fields.Add("ayar", sistemModel.ayar); string[] Wherefields = { "belge_id" }; acekaResult = CrudRepository.Update("gtip_belgedetay", Wherefields, fields); return(Ok(acekaResult)); } return(BadRequest()); }
public HttpResponseMessage PersonelCalismaYerleriUpdate(PersonelCariKartCalismaYeriModel per) { AcekaResult acekaResult = null; if (per != null) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("stokyeri_carikart_id", per.stokyeri_carikart_id); fields.Add("carikart_id", per.carikart_id); fields.Add("degistiren_carikart_id", per.degistiren_carikart_id); fields.Add("gorev_id", per.gorev_id); fields.Add("departman_id", per.departman_id); acekaResult = CrudRepository.Update("carikart_personel_calisma_yerleri", new string[] { "carikart_id" }, fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } else { return(null); } }
public HttpResponseMessage PersonelIletisimDelete(Personel_Carikart_genel_adres_Model per) { AcekaResult acekaResult = null; if (per != null) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("carikart_adres_id", per.carikart_adres_id); fields.Add("carikart_id", per.carikart_id); fields.Add("degistiren_carikart_id", per.degistiren_carikart_id); fields.Add("kayit_silindi", 1); acekaResult = CrudRepository.Update("carikart_genel_adres", "carikart_adres_id", fields); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } else { return(Request.CreateResponse(HttpStatusCode.NotFound, new Models.AnonymousModels.NotFound { message = "No Record" })); } }
public async Task <ApiResponse <LoginDetail> > AuthenticateUser(UserLogin model) { var response = new ApiResponse <LoginDetail>(); var userDetail = _userRepo.List(i => i.Email == model.Email).FirstOrDefault(); var loginLog = new Entity.LoginLog(model.IpAddress); if (userDetail != null && !userDetail.IsActive) { response.Success = false; response.ErrorMesssage.Add(MtsResource.AccountLocked); loginLog.Success = false; } if (response.Success) { if (userDetail == null || !_crypto.CheckMatch(userDetail.Password, model.Password)) { response.Success = false; response.ErrorMesssage.Add(MtsResource.EmailPasswordNotFound); if (userDetail != null) { loginLog.Success = false; loginLog.UserId = userDetail.Id; userDetail.ErrorCount += 1; if (userDetail.ErrorCount == _config.MaxLoginErrorCount) { await DeactivateUser(userDetail); } } } if (response.Success) { var userBusiness = _userBusinessRepo.List(i => i.UserId == userDetail.Id).FirstOrDefault(); if (userBusiness != null) { string chip = $"{model.Email}:{model.Password}"; loginLog.UserId = userDetail.Id; userDetail.ErrorCount = 0; await _userRepo.Update(userDetail); response.DataResponse = new LoginDetail() { BusinessId = userBusiness.BusinessId, Id = userDetail.Id, Name = $"{userDetail.FirstName} {userDetail.LastName}", RefreshToken = $"{_crypto.EncryptString(chip, _config.EncryptionKey)}.{_crypto.CalculateHash(chip)}", AccessToken = RandomGenerator.GenerateString(16) }; } else { response.Success = false; response.ErrorMesssage.Add(MtsResource.EmailPasswordNotFound); } } } await _loginLogRepo.Save(loginLog); return(response); }
public HttpResponseMessage Personel_GenelPut(Personel_Model personel) { AcekaResult acekaResult = null; if (personel != null) { if (personel.carikart_id > 0) { Dictionary <string, object> fields = new Dictionary <string, object>(); fields.Add("carikart_id", personel.carikart_id); fields.Add("degistiren_carikart_id", Tools.PersonelId); fields.Add("statu", personel.statu); fields.Add("cari_unvan", personel.cari_unvan); fields.Add("ozel_kod", personel.ozel_kod); fields.Add("giz_kullanici_adi", personel.giz_kullanici_adi); fields.Add("giz_kullanici_sifre", personel.giz_kullanici_sifre); // fields.Add("statu", personel.statu); if (personel.sube_carikart_id > 0) { fields.Add("sube_carikart_id", personel.sube_carikart_id); } acekaResult = CrudRepository.Update("carikart", "carikart_id", fields); if (acekaResult != null && acekaResult.RetVal != null) { personelRepository = new PersonelRepository(); var person = personelRepository.Getir(personel.carikart_id); if (person != null) { if (person.muh_masraf.carikart_id_m > 0 && (personel.muh_masraf != null && personel.muh_masraf.muh_kod != null && personel.muh_masraf.muh_kod.ToString().Length > 0)) { person.muh_masraf.carikart_id_m = person.carikart_id; Dictionary <string, object> fields_muh = new Dictionary <string, object>(); if (personel.muh_masraf.sirket_id > 0) { fields_muh.Add("sirket_id", personel.muh_masraf.sirket_id); } if (personel.muh_masraf.sene > 0) { fields_muh.Add("sene", personel.muh_masraf.sene); } fields_muh.Add("carikart_id", personel.carikart_id); fields_muh.Add("degistiren_carikart_id", personel.degistiren_carikart_id); fields_muh.Add("muh_kod", personel.muh_masraf.muh_kod); AcekaResult acekaResult2 = null; acekaResult2 = CrudRepository.Update("carikart_muhasebe", "carikart_id", fields_muh); } else if (personel.muh_masraf != null && personel.muh_masraf.muh_kod != null && personel.muh_masraf.muh_kod.ToString().Length > 0) { personel.muh_masraf.carikart_id = person.carikart_id; string[] not_include2 = { "sirket_adi", "muh_kod_adi", "masraf_merkezi_adi", "sene", "masraf_merkezi_id", "degistiren_tarih", "masraf_merkezi_id" }; AcekaResult acekaResult2 = null; acekaResult2 = CrudRepository <carikart_muhasebe_personel_Model> .Insert(personel.muh_masraf, "carikart_muhasebe", not_include2); } if (personel.parametre != null) { personel.parametre.carikart_id = person.carikart_id; PersonelParametreput(personel.parametre); } if (personel.iletisim != null) { //personelRepository = new PersonelRepository(); //var o = personelRepository.PersonelAdresBul(person.carikart_id); var o = personel.iletisim.carikart_adres_id; personel.iletisim.carikart_id = person.carikart_id; //if (o.carikart_adres_id > 0) if (personel.iletisim.carikart_adres_id > 0) { personel.iletisim.carikart_adres_id = personel.iletisim.carikart_adres_id;; PersonelIletisimPut(personel.iletisim); } else { PersonelIletisimPost(personel.iletisim); } //var pSonuc = PersonelIletisimGetir(personel.carikart_id); // personel.iletisim.carikart_id = person.carikart_id; // if(pSonuc != null && pSonuc.IsSuccessStatusCode) // { // var ii = ((HttpResponseMessage)pSonuc.Content).TryGetContentValue("carikart_adres_id"); // PersonelIletisimPut(personel.iletisim); // } // else // { // PersonelIletisimPost(personel.iletisim); // } } } } return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } } return(null); }