Exemple #1
0
        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());
        }
Exemple #2
0
        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"
                }));
            }
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        public HttpResponseMessage FiyatTalimatDelete(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.Delete("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);
        }
Exemple #5
0
        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"
                }));
            }
        }
        /// <summary>
        /// CommandType = Text. INSERT Metodu otomatik oluştururlur.
        /// </summary>
        /// <param name="className">Generic T. Kayıt yapılacak tablo için gerekli class' dır</param>
        /// <param name="tableName">Tablo adı manuel belirtilmelidir.</param>
        /// <param name="excepts">Tabloda kullanılmak istenilmeyen alanlar string array olarak belirtilebilir. (Opsiyonel)</param>
        /// <returns></returns>
        public static AcekaResult Insert(T className, string tableName, string[] excepts = null)
        {
            //Adnan TÜRK 25.01.2017
            AcekaResult acekaResult = new AcekaResult();

            Type t = className.GetType();

            List <SqlParameter> parameterList = new List <SqlParameter>();
            string query  = "";
            string values = "";
            string fields = "";

            try
            {
                foreach (var per in t.GetProperties())
                {
                    //Class içerisinde tanımlı primitive (int, string, bool v.s) değişken tipleri ile Insert parametreleri oluşturuluyor!
                    if (per.PropertyType.FullName.Contains("System") && !per.PropertyType.FullName.Contains("System.Collections"))
                    {
                        var name  = per.Name;
                        var value = per.GetValue(className, null);

                        //Eğer Insert cümlesine dahil edilmeyecek field lar varsa kontrol control ediliyor.
                        if (excepts != null && Array.IndexOf(excepts, name) > -1)
                        {
                            continue;
                        }


                        fields += name + ",";
                        values += "@" + name + ",";

                        parameterList.Add(new SqlParameter("@" + name, value));
                    }
                }

                if (parameterList.Count > 0)
                {
                    //Insert query oluşturuluyor
                    fields = fields.TrimEnd(',');
                    values = values.TrimEnd(',');
                    query  = string.Format("INSERT INTO {0}({1}) values({2}) SELECT SCOPE_IDENTITY()", tableName, fields, values);

                    acekaResult.RetVal = SqlHelper.ExecuteScalar(ConnectionStrings.SqlConn, CommandType.Text, query, parameterList.ToArray());
                }
            }
            catch (Exception ex)
            {
                acekaResult.ErrorInfo = new ErrorInfo
                {
                    Message   = ex.Message,
                    Source    = ex.Source,
                    ErrorCode = ex.HResult.ToString(),
                    Location  = "namespace aceka.infrastructure.Repositories, Method public static AcekaResult Insert(T className, string tableName, string[] excepts = null)"
                };
            }
            return(acekaResult);
        }
        /// <summary>
        /// Delete metod
        /// </summary>
        /// <param name="className">Object</param>
        /// <param name="tableName">Tablo adı</param>
        /// <param name="keysForWhere">Where için gerekli parametreler</param>
        /// <param name="including">Delete cümlesine dahil edilmeyecek field lar kontrol ediliyor ve ekleniyor.</param>
        /// <returns></returns>
        public static AcekaResult Delete(T className, string tableName, string[] keysForWhere, string[] including)
        {
            //Adnan TÜRK 22.02.2017
            AcekaResult acekaResult = new AcekaResult();

            Type t = className.GetType();
            List <SqlParameter> parameterList = new List <SqlParameter>();
            string query = "";

            try
            {
                foreach (var per in t.GetProperties())
                {
                    //Class içerisinde tanımlı primitive (int, string, bool v.s) değişken tipleri ile Insert parametreleri oluşturuluyor!
                    if (per.PropertyType.FullName.Contains("System") && !per.PropertyType.FullName.Contains("System.Collections"))
                    {
                        var name  = per.Name;
                        var value = per.GetValue(className, null);
                        //Delete cümlesine dahil edilmeyecek field lar kontrol ediliyor ve ekleniyor.
                        if (including != null && Array.IndexOf(including, name) > -1)
                        {
                            parameterList.Add(new SqlParameter("@" + name, value));
                        }
                        else
                        {
                            continue;
                        }
                    }
                }
                //Where için AND kriterler oluşturuluyor
                string keyForWhere = "";
                for (int i = 0; i < keysForWhere.Length; i++)
                {
                    keyForWhere += keysForWhere[i] + " = @" + keysForWhere[i] + " AND ";
                }

                if (!string.IsNullOrEmpty(keyForWhere))
                {
                    keyForWhere = keyForWhere.Trim(new char[] { ' ', 'A', 'N', 'D', ' ' });
                }

                query = String.Format("DELETE FROM {0} WHERE {1}", tableName, keyForWhere);

                acekaResult.RetVal = SqlHelper.ExecuteNonQuery(ConnectionStrings.SqlConn, CommandType.Text, query, parameterList.ToArray());
            }
            catch (Exception ex)
            {
                acekaResult.ErrorInfo = new ErrorInfo
                {
                    Message   = ex.Message,
                    Source    = ex.Source,
                    ErrorCode = ex.HResult.ToString(),
                    Location  = "namespace aceka.infrastructure.Repositories, Method  public static AcekaResult Delete(T className, string tableName, string[] keysForWhere, string[] including)"
                };
            }

            return(acekaResult);
        }
Exemple #8
0
        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"
                }));
            }
        }
        /// <summary>
        /// CommandType = Text. Update Metodu otomatik oluştururlur.
        /// </summary>
        /// <param name="className">Generic T. Kayıt yapılacak tablo için gerekli class' dır</param>
        /// <param name="keyForWhere">Where için kullanılacak field</param>
        /// <param name="excepts">Tabloda kullanılmak istenilmeyen alanlar string array olarak belirtilebilir. (Opsiyonel)</param>
        /// <returns></returns>
        public static AcekaResult Update(T className, string keyForWhere, string[] excepts = null)
        {
            //Adnan TÜRK 27.01.2017
            AcekaResult acekaResult = new AcekaResult();

            Type t = className.GetType();
            List <SqlParameter> parameterList = new List <SqlParameter>();
            string query  = "";
            string fields = "";

            try
            {
                foreach (var per in t.GetProperties())
                {
                    //Class içerisinde tanımlı primitive (int, string, bool v.s) değişken tipleri ile Insert parametreleri oluşturuluyor!
                    if (per.PropertyType.FullName.Contains("System") && !per.PropertyType.FullName.Contains("System.Collections"))
                    {
                        var name  = per.Name;
                        var value = per.GetValue(className, null);
                        //Eğer Update cümlesine dahil edilmeyecek field lar varsa kontrol control ediliyor.
                        if (excepts != null && Array.IndexOf(excepts, name) > -1)
                        {
                            continue;
                        }
                        parameterList.Add(new SqlParameter("@" + name, value));
                        //Where kriterinde kullanılacak alan SET statement da dahil edilmiyor
                        if (keyForWhere == name)
                        {
                            continue;
                        }
                        fields += name + "= @" + name + ",";
                    }
                }

                if (parameterList.Count > 0)
                {
                    //Update query oluşturuluyor
                    fields = fields.TrimEnd(',');
                    query  = String.Format("UPDATE {0} SET {1} WHERE {2} = @{3}", t.Name, fields, keyForWhere, keyForWhere);

                    acekaResult.RetVal = SqlHelper.ExecuteNonQuery(ConnectionStrings.SqlConn, CommandType.Text, query, parameterList.ToArray());
                }
            }
            catch (Exception ex)
            {
                acekaResult.ErrorInfo = new ErrorInfo
                {
                    Message   = ex.Message,
                    Source    = ex.Source,
                    ErrorCode = ex.HResult.ToString(),
                    Location  = "namespace aceka.infrastructure.Repositories, Metod public static AcekaResult Update(T className, string keyForWhere, string[] excepts = null)"
                };
            }
            return(acekaResult);
        }
        /// <summary>
        /// CommandType = StoredProcedure. StoredProcedure için gerekli alanlar gönderilerek güncelleme işlemi yapılır.
        /// </summary>
        /// <param name="className">Generic T. Kayıt yapılacak tablo için gerekli class' dır</param>
        /// <param name="spName">StoredProcedure adı</param>
        /// <param name="recortMethodType">İşlemin tipi. ExecuteScalar, executeNonQuery v.s.</param>
        /// <param name="excepts">Tabloda kullanılmak istenilmeyen alanlar string array olarak belirtilebilir. (Opsiyonel)</param>
        /// <returns></returns>
        public static AcekaResult Update(T className, string spName, CustomEnums.RecortMethodType recortMethodType, string[] excepts = null)
        {
            //Adnan TÜRK 27.01.2017
            AcekaResult acekaResult = new AcekaResult();

            Type t = className.GetType();
            List <SqlParameter> parameterList = new List <SqlParameter>();

            try
            {
                foreach (var per in t.GetProperties())
                {
                    //Class içerisinde tanımlı primitive (int, string, bool v.s) değişken tipleri ile Insert parametreleri oluşturuluyor!
                    if (per.PropertyType.FullName.Contains("System") && !per.PropertyType.FullName.Contains("System.Collections"))
                    {
                        var name  = per.Name;
                        var value = per.GetValue(className, null);

                        //Eğer Update cümlesine dahil edilmeyecek field lar varsa kontrol control ediliyor.
                        if (excepts != null && Array.IndexOf(excepts, name) > -1)
                        {
                            continue;
                        }

                        parameterList.Add(new SqlParameter("@" + name, value));
                    }
                }

                if (parameterList.Count > 0)
                {
                    switch (recortMethodType)
                    {
                    case RecortMethodType.executeScalar:
                        acekaResult.RetVal = SqlHelper.ExecuteScalar(ConnectionStrings.SqlConn, CommandType.StoredProcedure, spName, parameterList.ToArray());
                        break;

                    case RecortMethodType.executeNonQuery:
                        acekaResult.RetVal = SqlHelper.ExecuteNonQuery(ConnectionStrings.SqlConn, CommandType.StoredProcedure, spName, parameterList.ToArray());
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                acekaResult.ErrorInfo = new ErrorInfo
                {
                    Message   = ex.Message,
                    Source    = ex.Source,
                    ErrorCode = ex.HResult.ToString(),
                    Location  = "namespace aceka.infrastructure.Repositories, Method public static AcekaResult Update(T className, string spName, CustomEnums.RecortMethodType recortMethodType, string[] excepts = null)"
                };
            }
            return(acekaResult);
        }
Exemple #11
0
        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);
        }
Exemple #12
0
        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);
            }
        }
Exemple #13
0
        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));
            }
        }
Exemple #14
0
        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);
        }
Exemple #15
0
        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);
        }
Exemple #16
0
        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);
            }
        }
Exemple #17
0
        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());
        }
Exemple #18
0
        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));
        }
Exemple #19
0
        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);
            }
        }
Exemple #20
0
        public HttpResponseMessage PersonelCalismaYerleriDelete(PersonelCariKartCalismaYeriModel per)
        {
            AcekaResult acekaResult = null;

            if (per.carikart_id > 0 && per.stokyeri_carikart_id > 0)
            {
                Dictionary <string, object> fields = new Dictionary <string, object>();
                fields.Add("stokyeri_carikart_id", per.stokyeri_carikart_id);
                fields.Add("carikart_id", per.carikart_id);

                acekaResult = CrudRepository.Delete("carikart_personel_calisma_yerleri", new string[] { "stokyeri_carikart_id", "carikart_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!"
                }));
            }
        }
Exemple #21
0
        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"
                }));
            }
        }
Exemple #22
0
        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"
                }));
            }
        }
Exemple #23
0
        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);
        }