Пример #1
0
        public string LH_ComportSorgula()
        {
            string        sonuc = null;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("select VALUE from TBL_PARAMETERS where ID='LH_COMPORT'", con);
            SqlDataReader dr    = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    sonuc = Convert.ToString(dr["VALUE"]);
                }
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
                sonuc = null;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }



            return(sonuc);
        }
Пример #2
0
        public bool RH_ComportGuncelle(string comPortValue)
        {
            bool result = false;


            cGenel        gnl = new cGenel();
            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("update TBL_PARAMETERS set " +
                                               "VALUE='" + comPortValue + "'" +
                                               " where ID= 'RH_COMPORT' ", con);

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }

                result = Convert.ToBoolean(cmd.ExecuteNonQuery());
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }

            return(result);
        }
        public void log_Listele(Bunifu.UI.WinForms.BunifuDataGridView dg)
        {
            cGenel         gnl = new cGenel();
            SqlConnection  con = new SqlConnection(gnl.conString);
            SqlDataAdapter da  = new SqlDataAdapter("SELECT * FROM LOG WHERE TIME >= GETDATE() - 3  ", con);
            DataSet        ds  = new DataSet();

            da.Fill(ds);
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dg.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
        public int TBTGalcLastTBTNO_Read_RH()
        {
            int           sonuc = 0;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("select LAST_TBTNO_RH from LAST where ID=1", con);
            SqlDataReader dr    = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    sonuc = Convert.ToInt32(dr["LAST_TBTNO_RH"]);
                }
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
            return(sonuc);
        }
        public bool speckInfoUpdate(SPECK_INFO SPECK_INFO, byte[] resim)
        {
            bool          sonuc = false;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("update SPECK_INFO set  Model=@Model, Spec=@Spec, Direction=@Direction,Resim=@Resim where Barkod=@Barkod", con);

            cmd.Parameters.Add("@Barkod", SqlDbType.NVarChar).Value           = SPECK_INFO._Barkod;
            cmd.Parameters.Add("@Model", SqlDbType.NVarChar).Value            = SPECK_INFO._Model;
            cmd.Parameters.Add("@Spec", SqlDbType.NVarChar).Value             = SPECK_INFO._Spec;
            cmd.Parameters.Add("@Direction", SqlDbType.NVarChar).Value        = SPECK_INFO._Direction;
            cmd.Parameters.Add("@Resim", SqlDbType.Image, resim.Length).Value = resim;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                sonuc = Convert.ToBoolean(cmd.ExecuteNonQuery());
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }


            return(sonuc);
        }
        public bool logDollyNoGuncelle(uint dolly_no, uint karkasID)
        {
            bool          sonuc = false;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("update LOG set DOLLY_NO=@DOLLY_NO where KARKASID=@karkasID", con);

            cmd.Parameters.Add("@DOLLY_NO", SqlDbType.NVarChar).Value = dolly_no;
            cmd.Parameters.Add("@karkasID", SqlDbType.BigInt).Value   = karkasID;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Dispose();
                con.Close();
            }

            return(sonuc);
        }
        public bool modelInfoUpdate(models modelInfo)
        {
            bool          sonuc = false;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("update MODELS set  MODELKODU=@MODELKODU, MODELADI=@MODELADI where MODELNO=@MODELNO", con);

            cmd.Parameters.Add("@MODELKODU", SqlDbType.NVarChar).Value = modelInfo._MODELKODU;
            cmd.Parameters.Add("@MODELADI", SqlDbType.NVarChar).Value  = modelInfo._MODELADI;
            cmd.Parameters.Add("@MODELNO", SqlDbType.NVarChar).Value   = modelInfo._MODELNO;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                sonuc = Convert.ToBoolean(cmd.ExecuteNonQuery());
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }


            return(sonuc);
        }
        public void barkodsList(Bunifu.UI.WinForms.BunifuDataGridView dg)
        {
            cGenel         gnl = new cGenel();
            SqlConnection  con = new SqlConnection(gnl.conString);
            SqlDataAdapter da  = new SqlDataAdapter("SELECT Barkod, Model, Spec, Direction FROM SPECK_INFO", con);
            DataTable      ds  = new DataTable();

            da.Fill(ds);
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dg.DataSource = ds;
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
        public void error_log_kayit(string log)
        {
            gnl      = new cGenel();
            mesajlar = new cMesajlar();
            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("insert into TBL_USER_LOG(ERROR_LOG, DATETIME) values(@error_log,@datetime)", con);

            cmd.Parameters.Add("@error_log", SqlDbType.NVarChar).Value = cGenel.MAKINE_ADI + " " + log;
            cmd.Parameters.Add("@datetime", SqlDbType.DateTime).Value  = DateTime.Now;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "error_log_kayit");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
Пример #10
0
        public bool parametreDefaultGuncelle(string ID)
        {
            bool          result = false;
            cGenel        gnl    = new cGenel();
            SqlConnection con    = new SqlConnection(gnl.conString);
            SqlCommand    cmd    = new SqlCommand("update TBL_PARAMETERS set " +
                                                  "VALUE=DEFAULTVALUE" +
                                                  " where ID= '" + ID + "' ", con);

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }

                result = Convert.ToBoolean(cmd.ExecuteNonQuery());
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }

            return(result);
        }
        public bool speckInfoDelete(string _barkod)
        {
            bool          sonuc = false;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("delete from SPECK_INFO where Barkod=@Barkod", con);

            cmd.Parameters.Add("@Barkod", SqlDbType.NVarChar).Value = _barkod;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                sonuc = Convert.ToBoolean(cmd.ExecuteNonQuery());
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }


            return(sonuc);
        }
        public void TBTGalcLastTBTNO_Write_LH(float TBTNO)
        {
            cGenel        gnl = new cGenel();
            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("update LAST set LAST_TBTNO_LH=@TBTNO where ID=1", con);

            cmd.Parameters.Add("@TBTNO", SqlDbType.Float).Value = TBTNO;
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
        }
        public float TelemailIleTBTNOBul(float telemail)
        {
            float         sonuc = 0;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conStringTBT);
            SqlCommand    cmd   = new SqlCommand("SELECT TOP (1) TBTNO FROM TBTGALC where TRIMNO=@telemail order by TBTNO desc ", con);

            cmd.Parameters.Add("@telemail", SqlDbType.Float).Value = telemail;
            SqlDataReader dr = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    sonuc = Convert.ToInt32(dr["TBTNO"]);
                }
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
            return(sonuc);
        }
        public SPECK_INFO speckInfoSearch(string _barkod)
        {
            ms   = new MemoryStream();
            info = new SPECK_INFO();
            gnl  = new cGenel();
            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("select * from SPECK_INFO where Barkod=@Barkod", con);

            cmd.Parameters.Add("@Barkod", SqlDbType.NVarChar).Value = _barkod;
            SqlDataReader dr = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    info._Barkod    = Convert.ToString(dr["Barkod"]);
                    info._Model     = Convert.ToString(dr["Model"]);
                    info._Spec      = Convert.ToString(dr["Spec"]);
                    info._Direction = Convert.ToString(dr["Direction"]);
                    info._Resim     = (byte[])(dr["Resim"]);
                }
                if (info._Resim != null)
                {
                    ms.Write(info._Resim, 0, info._Resim.Length);
                    info.bitmap = new Bitmap(ms);
                    //colorConvert resim = new colorConvert();
                    //info.bitmap = resim.resimCevir(info.bitmap, info._Model);
                }
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }


            return(info);
        }
        public List <TBTGALC_DOOR> TBTGalcDoorSpecRead_RH(float lastTBTNO)
        {
            List <TBTGALC_DOOR> list = new List <TBTGALC_DOOR>();
            TBTGALC_DOOR        info;
            cGenel        gnl = new cGenel();
            SqlConnection con = new SqlConnection(gnl.conStringTBT);
            SqlCommand    cmd = new SqlCommand("select TOP 10 T.TBTNO, T.BODYNO,T.MODEL,T.TRIMNO,T.SEATSPEC,T.DOORSPEC,S.FRR_BARCODE,S.RRR_BARCODE,S.BACKNO, S.TYPE from TBTGALC AS T inner join   dbo.DOOR AS S  ON T.DOORSPEC=S.SPEC where T.TBTNO>=@lastTBTNO ORDER BY T.TBTNO", con);

            cmd.Parameters.Add("@lastTBTNO", SqlDbType.Float).Value = lastTBTNO;
            SqlDataReader dr = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    info              = new TBTGALC_DOOR();
                    info._TBTNO       = Convert.ToInt32(dr["TBTNO"]);
                    info._BODYNO      = Convert.ToInt32(dr["BODYNO"]);
                    info._MODEL       = Convert.ToString(dr["MODEL"]);
                    info._TRIMNO      = Convert.ToInt32(dr["TRIMNO"]);
                    info._SEATSPEC    = Convert.ToString(dr["SEATSPEC"]);
                    info._DOORSPEC    = Convert.ToString(dr["DOORSPEC"]);
                    info._FRR_BARCODE = Convert.ToString(dr["FRR_BARCODE"]);
                    info._RRR_BARCODE = Convert.ToString(dr["RRR_BARCODE"]);
                    info._BACKNO      = Convert.ToString(dr["BACKNO"]);
                    info._TYPE        = Convert.ToString(dr["TYPE"]);
                    list.Add(info);
                }
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }
            return(list);
        }
        public bool logOlustur(uint barkodID, string line, uint karkasID, string telemail, string modelkodu, string speckodu, string type, string model, string dolly_no, string dolly_adress, string dolly_adres_dir, float setcount, string ok_rework, string karkas_user)
        {
            bool          sonuc = false;
            cGenel        gnl   = new cGenel();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("insert into LOG values (@BARKODSID,@LINE,@KARKASID,@TELEMAIL,@MODELKODU,@SPECKODU,@TYPE,@MODEL,@DOLLY_NO,@DOLLY_ADRESS,@DOLLY_ADRES_DIR,@SETCOUNT,@OK_REWORK,null,@TIME,@KARKAS_USER)", con);

            cmd.Parameters.Add("@BARKODSID", SqlDbType.BigInt).Value      = barkodID;
            cmd.Parameters.Add("@LINE", SqlDbType.NChar).Value            = line;
            cmd.Parameters.Add("@KARKASID", SqlDbType.BigInt).Value       = karkasID;
            cmd.Parameters.Add("@TELEMAIL", SqlDbType.NVarChar).Value     = telemail;
            cmd.Parameters.Add("@MODELKODU", SqlDbType.NVarChar).Value    = modelkodu;
            cmd.Parameters.Add("@SPECKODU", SqlDbType.NVarChar).Value     = speckodu;
            cmd.Parameters.Add("@TYPE", SqlDbType.NVarChar).Value         = type;
            cmd.Parameters.Add("@MODEL", SqlDbType.NVarChar).Value        = model;
            cmd.Parameters.Add("@DOLLY_NO", SqlDbType.NVarChar).Value     = dolly_no;
            cmd.Parameters.Add("@DOLLY_ADRESS", SqlDbType.NVarChar).Value = dolly_adress;
            cmd.Parameters.Add("@DOLLY_ADRES_DIR", SqlDbType.NChar).Value = dolly_adres_dir;
            cmd.Parameters.Add("@SETCOUNT", SqlDbType.Float).Value        = setcount;
            cmd.Parameters.Add("@OK_REWORK", SqlDbType.NVarChar).Value    = ok_rework;
            // cmd.Parameters.Add("@DATE", SqlDbType.DateTime).Value =DateTime.Now;
            cmd.Parameters.Add("@TIME", SqlDbType.DateTime).Value        = DateTime.Now;
            cmd.Parameters.Add("@KARKAS_USER", SqlDbType.NVarChar).Value = karkas_user;
            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                mesaj.hata(ex, "");
            }
            finally
            {
                con.Dispose();
                con.Close();
            }

            return(sonuc);
        }
        public List <models> modelList()
        {
            List <models> list = new List <models>();
            models        info;
            cGenel        gnl = new cGenel();
            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("select * from MODELS ", con);
            SqlDataReader dr  = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    info            = new models();
                    info._MODELNO   = Convert.ToString(dr["MODELNO"]);
                    info._MODELKODU = Convert.ToString(dr["MODELKODU"]);
                    info._MODELADI  = Convert.ToString(dr["MODELADI"]);
                    list.Add(info);
                }
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }


            return(list);
        }
        public models speckInfoSearch(string modelNo)
        {
            models        info = new models();
            cGenel        gnl  = new cGenel();
            SqlConnection con  = new SqlConnection(gnl.conString);
            SqlCommand    cmd  = new SqlCommand("select * from MODELS where MODELNO=@MODELNO", con);

            cmd.Parameters.Add("@MODELNO", SqlDbType.NVarChar).Value = modelNo;
            SqlDataReader dr = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();

                while (dr.Read())
                {
                    info._MODELNO   = Convert.ToString(dr["MODELNO"]);
                    info._MODELKODU = Convert.ToString(dr["MODELKODU"]);
                    info._MODELADI  = Convert.ToString(dr["MODELADI"]);
                }
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
            }
            finally
            {
                con.Close();
                con.Dispose();
            }


            return(info);
        }
Пример #19
0
        public List <string> parametreAra(string ID)
        {
            string        sonuc = null;
            cGenel        gnl   = new cGenel();
            List <string> liste = new List <string>();
            SqlConnection con   = new SqlConnection(gnl.conString);
            SqlCommand    cmd   = new SqlCommand("select * from TBL_PARAMETERS where ID like '%'+'" + ID + "'+'%'", con);
            SqlDataReader dr    = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    sonuc = Convert.ToString(dr["ID"]);
                    liste.Add(sonuc);
                }
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
                sonuc = null;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }



            return(liste);
        }
Пример #20
0
        public string parametreAraAciklama(string ID)
        {
            string sonuc = null;
            cGenel gnl   = new cGenel();

            SqlConnection con = new SqlConnection(gnl.conString);
            SqlCommand    cmd = new SqlCommand("select * from TBL_PARAMETERS where ID='" + ID + "'", con);
            SqlDataReader dr  = null;

            try
            {
                if (con.State == ConnectionState.Closed)
                {
                    con.Open();
                }
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    sonuc = Convert.ToString(dr["DEFINITION"]);
                }
            }
            catch (Exception ex)
            {
                mesajlar.hata(ex, "");
                sonuc = null;
            }
            finally
            {
                con.Close();
                con.Dispose();
            }



            return(sonuc);
        }
 private void btntxtSifreSil_Click(object sender, EventArgs e)
 {
     global = new cGenel();
     global.textSingleClear(txtParola);
 }