public async Task <ActionResult> Insert(StudentDto studentDto) { Student student = _mapper.Map <Student>(studentDto); bool result = await repo.Insert(student); string message = result ? "Kayıt tamamlandı" : "Kayıt tamamlanmadı.."; return(Ok(message)); }
public HttpResponseMessage FiyatTalimat(stokkart_fiyat_talimat t) { AcekaResult acekaResult = new AcekaResult(); if (t != null) { t.degistiren_carikart_id = 0; acekaResult = CrudRepository <stokkart_fiyat_talimat> .Insert(t, "stokkart_fiyat_talimat", new string[] { "degistiren_tarih" }); return(Request.CreateResponse(HttpStatusCode.OK, acekaResult)); } return(null); }
public HttpResponseMessage Personel_Genel(Personel_Model per) { AcekaResult acekaResult = null; personelRepository = new PersonelRepository(); if (per != null && per.carikart_id == 0) { per.carikart_turu_id = 2; per.carikart_tipi_id = 21; acekaResult = CrudRepository <Personel_Model> .Insert(per, "carikart", new string[] { "degistiren_tarih", "carikart_tipi_adi", "carikart_id", "carikart_turu_adi" }); if (acekaResult != null && acekaResult.ErrorInfo == null) { //var person = personelRepository.Getir(acekaResult.RetVal.acekaToLong()); long carikartId = acekaResult.RetVal.acekaToLong(); if (per.muh_masraf != null && per.muh_masraf.carikart_id == 0) { per.muh_masraf.carikart_id = acekaResult.RetVal.acekaToLong(); var muhmasraf = CrudRepository <carikart_muhasebe_personel_Model> .Insert(per.muh_masraf, "carikart_muhasebe", new string[] { "sirket_adi", "muh_kod_adi", "masraf_merkezi_adi", "masraf_merkezi_id", "degistiren_tarih", "masraf_merkezi_id" }); } if (per.iletisim != null && per.iletisim.carikart_id == 0) { per.iletisim.carikart_id = carikartId; PersonelIletisimPost(per.iletisim); } if (per.parametre != null && per.parametre.carikart_id == 0) { per.parametre.carikart_id = carikartId; PersonelParametreinsert(per.parametre); } return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful", ret_val = carikartId.ToString() })); } else { return(Request.CreateResponse(HttpStatusCode.InternalServerError, acekaResult.ErrorInfo.Message)); } } else { return(Request.CreateResponse(HttpStatusCode.InternalServerError, acekaResult.ErrorInfo.Message)); } }
public HttpResponseMessage GTipPost(Models.GenelAyarlar.GtipModel.gtip_belge gtipModel) { AcekaResult acekaResult = null; var model = new Models.GenelAyarlar.GtipModel.gtip_belge { acan_carikart_id = Tools.PersonelId, belge_id = gtipModel.belge_id, acan_tarih = DateTime.Now, belgeno = gtipModel.belgeno, belge_tarihi = gtipModel.belge_tarihi, bitis_tarihi = gtipModel.bitis_tarihi, carikart_id = gtipModel.carikart_id, cari_unvan = gtipModel.cari_unvan, degistiren_carikart_id = Tools.PersonelId, degistiren_tarih = DateTime.Now, aciklama = gtipModel.aciklama, adet = gtipModel.adet, birim = gtipModel.birim, birim_fob = gtipModel.birim_fob, gtip_bayan = gtipModel.gtip_bayan, gtip_genel = gtipModel.gtip_genel, kg = gtipModel.kg, pb = gtipModel.pb, stokalan_id_1 = gtipModel.stokalan_id_1, stokalan_id_2 = gtipModel.stokalan_id_2, stokalan_id_3 = gtipModel.stokalan_id_3, stokalan_id_4 = gtipModel.stokalan_id_4, stokkart_tipi_id = gtipModel.stokkart_tipi_id, toplam_fob = gtipModel.toplam_fob }; acekaResult = CrudRepository <Models.GenelAyarlar.GtipModel.gtip_belge> .Insert(model, "gtip_belge", new string[] { "stokkart_tipi_id", "stokalan_id_1", "stokalan_id_2", "stokalan_id_3", "stokalan_id_4", "gtip_genel", "gtip_bayan", "aciklama", "birim", "adet", "kg", "birim_fob", "toplam_fob", "pb" }); acekaResult = CrudRepository <Models.GenelAyarlar.GtipModel.gtip_belge> .Insert(model, "gtip_belgedetay", new string[] { "carikart_id", "belgeno", "belge_tarihi", "bitis_tarihi", "cari_unvan" }); if (acekaResult == null || acekaResult.ErrorInfo != null) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, new Models.AnonymousModels.NotFound { message = acekaResult.ErrorInfo.Message })); } return(null); }
public HttpResponseMessage Personel_CalismaYerleri(PersonelCariKartCalismaYeriModel per) { AcekaResult acekaResult = null; if (per != null) { acekaResult = CrudRepository <PersonelCariKartCalismaYeriModel> .Insert(per, "carikart_personel_calisma_yerleri", new string[] { "degistiren_tarih", "gorev_adi", "departman_adi", "stokyeri_carikart_adi" }); //return Request.CreateResponse(HttpStatusCode.OK, acekaResult); return(Request.CreateResponse(HttpStatusCode.OK, new Models.AnonymousModels.Successful { message = "successful" })); } else { return(null); } }
public IHttpActionResult TalimatTurleriTanim(talimattanim talimat) { AcekaResult acekaResult = null; if (talimat == null) { return(BadRequest()); } talimattanim talimatlar = new talimattanim { degistiren_carikart_id = Tools.PersonelId, degistiren_tarih = DateTime.Now, kayit_silindi = false, statu = true, kod = talimat.kod, varsayilan = talimat.varsayilan, tanim = talimat.tanim, sira = talimat.sira, renk_rgb = talimat.renk_rgb, kesim = talimat.kesim, dikim = talimat.dikim, parca = talimat.parca, model = talimat.model, //onayoto = true, parcamodel_giris = talimat.parcamodel_giris, parcamodel_cikis = talimat.parcamodel_cikis, model_zorunlu = talimat.model_zorunlu, varsayilan_fasoncu = talimat.varsayilan_fasoncu, kdv_tevkifat = talimat.kdv_tevkifat }; acekaResult = CrudRepository <talimattanim> .Insert(talimatlar, "talimat", new string[] { "talimatturu_id", "cari_unvan", "onayoto", "storkart_tipi_id", "storkart_tipleri" }); if (acekaResult == null || acekaResult.ErrorInfo != null) { return(InternalServerError(new Exception(acekaResult.ErrorInfo.Message))); } return(Ok(acekaResult)); }
public HttpResponseMessage PersonelIletisimPost(Personel_Carikart_genel_adres_Model per) { AcekaResult acekaResult = null; if (per != null) { per.adres_tipi_id = "II"; per.statu = true; if (per.degistiren_carikart_id == 0) { per.degistiren_carikart_id = Tools.PersonelId; } acekaResult = CrudRepository <Personel_Carikart_genel_adres_Model> .Insert(per, "carikart_genel_adres", new string[] { "degistiren_tarih", "carikart_adres_id" }); return(Request.CreateResponse(HttpStatusCode.OK, acekaResult)); } else { return(Request.CreateResponse(HttpStatusCode.NoContent, new Models.AnonymousModels.NotFound { message = "No Record" })); } }
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); }