Пример #1
0
        ///<summary>
        /// Begen Data Update
        ///</summary>
        public static int Update(Begen p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Begen SET HesapID=@HesapID,IP=@IP,ModulID=@ModulID,IcerikID=@IcerikID,Durum=@Durum,KayitTarihi=@KayitTarihi WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.Bit);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #2
0
        public static KategoriCollection GetSelect()
        {
            KategoriCollection rvKategori = new KategoriCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from Kategori order by Adi asc", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvKategori.Add(new Kategori(MConvert.NullToInt(IDR["ID"]), MConvert.NullToString(IDR["Kod"]), MConvert.NullToString(IDR["Adi"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvKategori);
        }
Пример #3
0
        ///<summary>
        /// Makale Data Select
        ///</summary>
        public static MakaleCollection GetSelect(string phesapid, int top)
        {
            MakaleCollection rvMakale = new MakaleCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from makale where hesapid=?hesapid and yoneticionay=1 and aktif=1 order by guncellemetarihi desc limit " + top, conneciton))
                {
                    cmd.Parameters.Add("hesapid", phesapid, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvMakale.Add(new Makale(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["ozet"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToString(IDR["etiket"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["uye"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvMakale);
        }
Пример #4
0
        ///<summary>
        /// Yorum Data Insert
        ///</summary>
        public static int Insert(Yorum p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "INSERT INTO Yorum (IP,ModulID,IcerikID,Adi,Mail,Icerik,KayitTarihi,YoneticiOnay,Aktif) VALUES(@IP,@ModulID,@IcerikID,@Adi,@Mail,@Icerik,@KayitTarihi,@YoneticiOnay,@Aktif)", conneciton))
                {
                    cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Icerik", p.Icerik, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("YoneticiOnay", p.YoneticiOnay, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #5
0
        ///<summary>
        /// Yorum Data Delete
        ///</summary>
        public static int Delete(Yorum p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "DELETE FROM Yorum WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #6
0
        ///<summary>
        /// Yorum Data PrimaryKey
        ///</summary>
        public static Yorum GetYorum(System.Guid pID)
        {
            Yorum rvYorum = new Yorum();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Yorum WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvYorum = new Yorum(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToString(IDR["IP"]), MConvert.NullToString(IDR["ModulID"]), MConvert.NullToString(IDR["IcerikID"]), MConvert.NullToString(IDR["Adi"]), MConvert.NullToString(IDR["Mail"]), MConvert.NullToString(IDR["Icerik"]), MConvert.NullToDateTime(IDR["KayitTarihi"]), MConvert.NullToBool(IDR["YoneticiOnay"]), MConvert.NullToBool(IDR["Aktif"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvYorum);
        }
Пример #7
0
        public static Int64 GetCount(string pMail, bool pAktif)
        {
            Int64 rvCount = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT COUNT(ID) AS TotalCount FROM Yorum WHERE Mail=@Mail AND Aktif=@Aktif", conneciton))
                {
                    cmd.Parameters.Add("Mail", pMail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Aktif", pAktif, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
Пример #8
0
        ///<summary>
        /// CalismaAlani Data Insert
        ///</summary>
        public static int Insert(CalismaAlani p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "if (@Varsayilan=1) begin UPDATE CalismaAlani SET Varsayilan=0 WHERE HesapID=@HesapID AND Varsayilan=1 end INSERT INTO CalismaAlani (HesapID,Kurum,Telefon,Adres,Semt,Sehir,WebSitesi,Randevu,Varsayilan,Aktif) VALUES(@HesapID,@Kurum,@Telefon,@Adres,@Semt,@Sehir,@WebSitesi,@Randevu,@Varsayilan,@Aktif)", conneciton))
                {
                    cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Kurum", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Kurum.ToLower().Trim()), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Telefon", p.Telefon, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adres", p.Adres, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Semt", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Semt.ToLower().Trim()), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Sehir", p.Sehir.ToUpper().Trim(), MSqlDbType.NVarChar);
                    cmd.Parameters.Add("WebSitesi", p.WebSitesi.Trim(), MSqlDbType.VarChar);
                    cmd.Parameters.Add("Randevu", p.Randevu, MSqlDbType.Bit);
                    cmd.Parameters.Add("Varsayilan", p.Varsayilan, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #9
0
        public static AnketPuanCollection GetSelect(Int64 psoruid)
        {
            AnketPuanCollection rvAnketPuan = new AnketPuanCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from anketpuan where soruid=?soruid", conneciton))
                {
                    cmd.Parameters.Add("soruid", psoruid, MSqlDbType.BigInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvAnketPuan.Add(new AnketPuan(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToInt64(IDR["anketid"]), MConvert.NullToInt64(IDR["soruid"]), MConvert.NullToString(IDR["ip"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvAnketPuan);
        }
Пример #10
0
        /// <summary>
        /// 物资收料
        /// </summary>
        /// <param name="tk_form">单据表单信息</param>
        /// <param name="MSInfos">物资具体信息</param>
        /// <returns></returns>
        public string receive(string tk_form, string MSInfos, int wfIdx)
        {
            string   _return = String.Empty, _code = MConvert.getValue(tk_form, "code");
            string   _wfId = (new WFIndex(wfIdx, api)).addInstance("施工工程收料单号:" + _code, "");
            SqlTrans trans = new SqlTrans(api);

            try
            {
                string[] _kv = MConvert.toKV(tk_form);
                string   _users = trans.execScalar(MString.getSelectStr(R.Table.WF_INSTANCE, "owner", "id=" + _wfId)), _proId = MConvert.getValue(tk_form, "proId");
                string   _newID  = trans.addRow(R.Table.TK_WH_RECEIVE, _kv[0] + ",wfId,users,observers", _kv[1] + "," + _wfId + ",'" + _users + "','" + _users + "'");
                string[] infoAry = MSInfos.Split('^');
                for (int i = 0, _len = infoAry.Length; i < _len; i++)
                {
                    string[] _tKV = MConvert.toKV(infoAry[i]);
                    trans.execNonQuery(MString.getInsertStr(R.Table.TK_WH_RECEIVE_DETAIL, _tKV[0] + ", oid, proId", _tKV[1] + "," + _newID + "," + _proId));
                }
                _return = _newID;
                trans.commit();
            }
            catch (Exception e)
            {
                trans.rollback();
                _return = Native.getErrorMsg(e.Message);
            }
            finally {
                trans.close();
            }
            return(_return);
        }
Пример #11
0
        ///<summary>
        /// CalismaAlani Data Select
        ///</summary>
        public static CalismaAlaniCollection GetSelect(System.Guid pHesapID)
        {
            CalismaAlaniCollection rvCalismaAlani = new CalismaAlaniCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM CalismaAlani WHERE HesapID=@HesapID", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvCalismaAlani.Add(new CalismaAlani(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["Kurum"]), MConvert.NullToString(IDR["Telefon"]), MConvert.NullToString(IDR["Adres"]), MConvert.NullToString(IDR["Semt"]), MConvert.NullToString(IDR["Sehir"]), MConvert.NullToString(IDR["WebSitesi"]), MConvert.NullToBool(IDR["Randevu"]), MConvert.NullToBool(IDR["Varsayilan"]), MConvert.NullToBool(IDR["Aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCalismaAlani);
        }
Пример #12
0
        ///<summary>
        /// Sehir Data PrimaryKey
        ///</summary>
        public static Sehir GetSehir(byte pid)
        {
            Sehir rvSehir = new Sehir();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from sehir where id=?id limit 1", conneciton))
                {
                    cmd.Parameters.Add("id", pid, MSqlDbType.SmallInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvSehir = new Sehir(MConvert.NullToByte(IDR["id"]), MConvert.NullToString(IDR["adi"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvSehir);
        }
Пример #13
0
        ///<summary>
        /// Sehir Data Select
        ///</summary>
        public static SehirCollection GetSelect()
        {
            SehirCollection rvSehir = new SehirCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from sehir order by adi asc", conneciton))
                {
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvSehir.Add(new Sehir(MConvert.NullToByte(IDR["id"]), MConvert.NullToString(IDR["adi"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvSehir);
        }
Пример #14
0
        //对话框载入
        private void EmployeeForm_Load(object sender, EventArgs e)
        {
            stock.Items.AddRange(db.Stock.Select(x => x.name).ToArray());
            goodsCat.Items.AddRange(db.GoodsCat.Select(x => x.name).ToArray());

            var employees = db.Employee.Where(x => !db.Job.FirstOrDefault(y => y.id == x.jobId).name.Contains("技师"));

            receiver.Items.AddRange(employees.Select(x => x.name).ToArray());
            checker.Items.AddRange(employees.Select(x => x.name).ToArray());
            transactor.Items.AddRange(employees.Select(x => x.name).ToArray());
            ComboUnit.Items.AddRange(db.Unit.Select(x => x.name).ToArray());
            if (newStockout)
            {
                receiver.Text   = LogIn.m_User.name;
                checker.Text    = LogIn.m_User.name;
                transactor.Text = LogIn.m_User.name;
            }
            else
            {
                var goodsCatID   = db.StorageList.FirstOrDefault(x => x.name == stockout.name).goodsCatId;
                var goodsCatName = db.GoodsCat.FirstOrDefault(x => x.id == goodsCatID).name;
                goodsCat.Text = MConvert <string> .ToTypeOrDefault(goodsCatName, "");

                name.Text               = stockout.name;
                stock.Text              = db.Stock.FirstOrDefault(x => x.id == stockout.stockId).name;
                ComboUnit.Text          = stockout.unit;
                amount.Text             = stockout.amount.ToString();
                dtPickerIntoStock.Value = MConvert <DateTime> .ToTypeOrDefault(stockout.date, DateTime.Now);

                receiver.Text   = stockout.receiver;
                checker.Text    = stockout.checker;
                transactor.Text = stockout.transactor;
                note.Text       = stockout.note;
            }
        }
Пример #15
0
        public static AnketCollection GetSelect(Anket p)
        {
            AnketCollection rvAnket = new AnketCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from anket where anketid=?anketid order by " + (BAYMYO.UI.Converts.NullToBool(p.Grup) ? "grup asc," : "") + " id asc", conneciton))
                {
                    cmd.Parameters.Add("anketid", p.ID, MSqlDbType.BigInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvAnket.Add(new Anket(MConvert.NullToInt64(IDR["id"]), MConvert.NullToInt64(IDR["anketid"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["aktif"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["grup"]), MConvert.NullToBool(IDR["yatay"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvAnket);
        }
Пример #16
0
        public static VideoCollection GetSelect(System.Guid pHesapID)
        {
            VideoCollection rvVideo = new VideoCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Video WHERE HesapID=@HesapID", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvVideo.Add(new Video(MConvert.NullToInt64(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["KategoriID"]), MConvert.NullToString(IDR["ResimUrl"]), MConvert.NullToString(IDR["Baslik"]), MConvert.NullToString(IDR["Embed"]), MConvert.NullToString(IDR["Etiket"]), MConvert.NullToDateTime(IDR["KayitTarihi"]), MConvert.NullToBool(IDR["Yorum"]), MConvert.NullToBool(IDR["Aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvVideo);
        }
Пример #17
0
        ///<summary>
        /// Anket Data Insert
        ///</summary>
        public static Int64 Insert(Anket p)
        {
            Int64 rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "insert into anket (anketid,adi,kayittarihi,aktif,resimurl,grup,yatay) values(?anketid,?adi,?kayittarihi,?aktif,?resimurl,?grup,?yatay); select last_insert_id();", conneciton))
                {
                    cmd.Parameters.Add("anketid", p.AnketID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar);
                    cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean);
                    cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("grup", p.Grup, MSqlDbType.VarChar);
                    cmd.Parameters.Add("yatay", p.Yatay, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #18
0
        ///<summary>
        /// Video Data Update
        ///</summary>
        public static int Update(Video p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Video SET HesapID=@HesapID,KategoriID=@KategoriID,ResimUrl=@ResimUrl,Baslik=@Baslik,Embed=@Embed,Etiket=@Etiket,KayitTarihi=@KayitTarihi,Yorum=@Yorum,Aktif=@Aktif WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.BigInt);
                    cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ResimUrl", p.ResimUrl, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Baslik", p.Baslik, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Embed", p.Embed, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Etiket", p.Etiket, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("Yorum", p.Yorum, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #19
0
        public static Int64 GetCount(bool pYoneticiOnay)
        {
            Int64 rvCount = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT COUNT(ID) AS TotalCount FROM Yorum WHERE YoneticiOnay=@YoneticiOnay", conneciton))
                {
                    cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
Пример #20
0
        public static HaberCollection GetSelect(string pkategoriid)
        {
            HaberCollection rvHaber = new HaberCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from haber where kategoriid=?kategoriid", conneciton))
                {
                    cmd.Parameters.Add("kategoriid", pkategoriid, MSqlDbType.VarChar);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvHaber.Add(new Haber(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["ozet"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToString(IDR["etiket"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToInt64(IDR["video"]), MConvert.NullToInt64(IDR["galeri"]), MConvert.NullToBool(IDR["uye"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["anasayfa"]), MConvert.NullToBool(IDR["aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvHaber);
        }
Пример #21
0
        public static Int64 GetCount(Guid pHesapID, string pUrl, bool pYoneticiOnay, bool pAktif)
        {
            Int64 rvCount = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT COUNT(ID) AS TotalCount FROM Yorum WHERE (YoneticiOnay=@YoneticiOnay AND Aktif=@Aktif) AND (EXISTS(SELECT ID FROM Makale WHERE HesapID=@HesapID) OR EXISTS(SELECT ID FROM Mesaj WHERE HesapID=@HesapID) OR EXISTS(SELECT ID FROM Video WHERE HesapID=@HesapID) OR IcerikID=@Url)", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, BAYMYO.MultiSQLClient.MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Url", pUrl, BAYMYO.MultiSQLClient.MSqlDbType.VarChar);
                    cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", pAktif, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
Пример #22
0
        ///<summary>
        /// Randevu Data PrimaryKey
        ///</summary>
        public static Randevu GetRandevu(System.Guid pID)
        {
            Randevu rvRandevu = new Randevu();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT TOP(1) * FROM Randevu WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvRandevu = new Randevu(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["ModulID"]), MConvert.NullToString(IDR["IcerikID"]), MConvert.NullToString(IDR["Adi"]), MConvert.NullToString(IDR["Mail"]), MConvert.NullToString(IDR["Telefon"]), MConvert.NullToString(IDR["GSM"]), MConvert.NullToString(IDR["Icerik"]), MConvert.NullToDateTime(IDR["TarihSaat"]), MConvert.NullToByte(IDR["Durum"]), MConvert.NullToBool(IDR["YoneticiOnay"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvRandevu);
        }
Пример #23
0
        ///<summary>
        /// Yorum Data Update
        ///</summary>
        public static int Update(Yorum p)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Yorum SET IP=@IP,ModulID=@ModulID,IcerikID=@IcerikID,Adi=@Adi,Mail=@Mail,Icerik=@Icerik,KayitTarihi=@KayitTarihi,YoneticiOnay=@YoneticiOnay,Aktif=@Aktif WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar);
                    cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("Mail", p.Mail, MSqlDbType.VarChar);
                    cmd.Parameters.Add("Icerik", p.Icerik, MSqlDbType.NVarChar);
                    cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime);
                    cmd.Parameters.Add("YoneticiOnay", p.YoneticiOnay, MSqlDbType.Bit);
                    cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #24
0
        public static Int64 GetCount(Guid pHesapID, byte pDurum, bool pYoneticiOnay)
        {
            Int64 rvCount = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT COUNT(ID) AS TotalCount FROM Randevu WHERE HesapID=@HesapID AND YoneticiOnay=@YoneticiOnay AND Durum=@Durum", conneciton))
                {
                    cmd.Parameters.Add("HesapID", pHesapID, BAYMYO.MultiSQLClient.MSqlDbType.UniqueIdentifier);
                    cmd.Parameters.Add("Durum", pDurum, MSqlDbType.TinyInt);
                    cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit);
                    rvCount = MConvert.NullToInt64(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvCount);
        }
Пример #25
0
        public static int Delete(string modulID, string icerikID)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "DELETE FROM Yorum WHERE ModulID=@ModulID AND IcerikID=@IcerikID", conneciton))
                {
                    cmd.Parameters.Add("ModulID", modulID, MSqlDbType.VarChar);
                    cmd.Parameters.Add("IcerikID", icerikID, MSqlDbType.VarChar);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #26
0
        ///<summary>
        /// Video Data Select
        ///</summary>
        public static VideoCollection GetSelect(Int64 id, byte limit)
        {
            VideoCollection rvVideo = new VideoCollection();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from video where id<>?id order by guncellemetarihi desc limit ?limit", conneciton))
                {
                    cmd.Parameters.Add("id", id, MSqlDbType.BigInt);
                    cmd.Parameters.Add("limit", limit, MSqlDbType.TinyInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvVideo.Add(new Video(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["embed"]), MConvert.NullToString(IDR["etiket"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["uye"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"])));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvVideo);
        }
Пример #27
0
        public static Kategori GetKategori(int pID)
        {
            Kategori rvKategori = new Kategori();

            using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select top 1  * from Kategori where ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.Int);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvKategori = new Kategori(MConvert.NullToInt(IDR["ID"]), MConvert.NullToString(IDR["Kod"]), MConvert.NullToString(IDR["Adi"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvKategori);
        }
Пример #28
0
        ///<summary>
        /// Anket Data PrimaryKey
        ///</summary>
        public static Anket GetAnket(Int64 pid)
        {
            Anket rvAnket = new Anket();

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select * from anket where id=?id limit 1", conneciton))
                {
                    cmd.Parameters.Add("id", pid, MSqlDbType.BigInt);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvAnket = new Anket(MConvert.NullToInt64(IDR["id"]), MConvert.NullToInt64(IDR["anketid"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["aktif"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["grup"]), MConvert.NullToBool(IDR["yatay"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvAnket);
        }
Пример #29
0
        ///<summary>
        /// Makale Data Count
        ///</summary>
        public static int Count(bool pyoneticionay)
        {
            int rowsAffected = 0;

            using (MConnection conneciton = new MConnection(MClientProvider.MySQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "select count(*) as totalcount from makale where yoneticionay=?yoneticionay", conneciton))
                {
                    cmd.Parameters.Add("yoneticionay", pyoneticionay, MSqlDbType.Boolean);
                    rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar());
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rowsAffected);
        }
Пример #30
0
        ///<summary>
        /// Begen Data PrimaryKey
        ///</summary>
        public static Begen GetBegen(System.Guid pID)
        {
            Begen rvBegen = new Begen();

            using (MConnection conneciton = new MConnection(MClientProvider.MSSQL))
            {
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Closed:
                    conneciton.Open();
                    break;
                }
                using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Begen WHERE ID=@ID", conneciton))
                {
                    cmd.Parameters.Add("ID", pID, MSqlDbType.UniqueIdentifier);
                    using (IDataReader IDR = cmd.ExecuteReader())
                    {
                        while (IDR.Read())
                        {
                            rvBegen = new Begen(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["IP"]), MConvert.NullToString(IDR["ModulID"]), MConvert.NullToString(IDR["IcerikID"]), MConvert.NullToBool(IDR["Durum"]), MConvert.NullToDateTime(IDR["KayitTarihi"]));
                        }
                        IDR.Close();
                    }
                }
                switch (conneciton.State)
                {
                case System.Data.ConnectionState.Open:
                    conneciton.Close();
                    break;
                }
            }
            return(rvBegen);
        }