コード例 #1
0
        public static bool UpdateClampBarcode(Clamp clamp)
        {
            bool result = false;

            try
            {
                if (ClampConnectionClass.ClampExists(Program.clampSelectValidity, clamp))
                {
                    result = ClampConnectionClass.UpdateClampBarCode(Program.clampUpdateQueryBarcode, clamp);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                string newfolder = direktorijum + "\\Logs";
                if (!Directory.Exists(newfolder))
                {
                    Directory.CreateDirectory(newfolder);
                }
                newfolder += "\\log15" + DateTime.Now.ToString("dd_MM_yyyy hh_mm_ss") + ".txt";
                StreamWriter sw = new StreamWriter(newfolder);
                sw.Write(ex.ToString());
                sw.Close();

                //Debug.Write(ex);
                result = false;
            }

            return(result);
        }
コード例 #2
0
        public static List <Clamp> ReturnClampPackingList(string firstSerial, string lastSerial)
        {
            List <Clamp> result = new List <Clamp>();
            int          count  = ClampConnectionClass.ClampCount(Program.clampSelectPackingListCount, firstSerial, lastSerial);

            try
            {
                if (count < 20 && count > -1)
                {
                    result = ClampConnectionClass.SelectClampValuesPL(Program.clampSelectPackingList, firstSerial, lastSerial);
                }
            }
            catch (Exception ex)
            {
                string newfolder = direktorijum + "\\Logs";
                if (!Directory.Exists(newfolder))
                {
                    Directory.CreateDirectory(newfolder);
                }
                newfolder += "\\log17" + DateTime.Now.ToString("dd_MM_yyyy hh_mm_ss") + ".txt";
                StreamWriter sw = new StreamWriter(newfolder);
                sw.Write(ex.ToString());
                sw.Close();
            }

            return(result);
        }
コード例 #3
0
        public static bool InsertClamp(Clamp clamp)//Clamp clamp
        {
            bool result = false;

            try
            {
                if (String.IsNullOrEmpty(clamp.Clampimputerror))
                {
                    result = ClampConnectionClass.CreateClamp(Program.clampInsertIntoQuery, clamp);
                }
                else
                {
                    result = false;
                }
            }
            catch (Exception ex)
            {
                string newfolder = direktorijum + "\\Logs";
                if (!Directory.Exists(newfolder))
                {
                    Directory.CreateDirectory(newfolder);
                }
                newfolder += "\\log20" + DateTime.Now.ToString("dd_MM_yyyy hh_mm_ss") + ".txt";
                StreamWriter sw = new StreamWriter(newfolder);
                sw.Write(ex.ToString());
                sw.Close();

                //Debug.Write(ex);
                result = false;
            }

            return(result);
        }
コード例 #4
0
        public static string ReturnClampRN(string firstSerial, string lastSerial)
        {
            List <Clamp> result = new List <Clamp>();
            string       str    = "";

            try
            {
                result = ClampConnectionClass.SelectClampValuesRN(Program.clampSelectRN, firstSerial, lastSerial);
                foreach (Clamp c in result)
                {
                    if (!String.IsNullOrEmpty(str))
                    {
                        if (!str.Contains(c.Rn))
                        {
                            str += ", " + c.Rn;
                        }
                    }
                    else
                    {
                        if (!str.Contains(c.Rn))
                        {
                            str += c.Rn;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                string newfolder = direktorijum + "\\Logs";
                if (!Directory.Exists(newfolder))
                {
                    Directory.CreateDirectory(newfolder);
                }
                newfolder += "\\log18" + DateTime.Now.ToString("dd_MM_yyyy hh_mm_ss") + ".txt";
                StreamWriter sw = new StreamWriter(newfolder);
                sw.Write(ex.ToString());
                sw.Close();
            }

            return(str);
        }
コード例 #5
0
        public static Clamp ReturnClamp()
        {
            Clamp clamp = new Clamp();

            try
            {
                clamp = ClampConnectionClass.SelectClamp(Program.clampSelectQuery);
            }
            catch (Exception ex)
            {
                string newfolder = direktorijum + "\\Logs";
                if (!Directory.Exists(newfolder))
                {
                    Directory.CreateDirectory(newfolder);
                }
                newfolder += "\\log16" + DateTime.Now.ToString("dd_MM_yyyy hh_mm_ss") + ".txt";
                StreamWriter sw = new StreamWriter(newfolder);
                sw.Write(ex.ToString());
                sw.Close();
            }
            return(clamp);
        }
コード例 #6
0
        public static List <Clamp> ReturnClampFCR(string firstSerial, string lastSerial)
        {
            List <Clamp> result = new List <Clamp>();

            try
            {
                result = ClampConnectionClass.SelectClampValuesFCR(Program.clampSelectFinalControlReport, firstSerial, lastSerial);
            }
            catch (Exception ex)
            {
                string newfolder = direktorijum + "\\Logs";
                if (!Directory.Exists(newfolder))
                {
                    Directory.CreateDirectory(newfolder);
                }
                newfolder += "\\log19" + DateTime.Now.ToString("dd_MM_yyyy hh_mm_ss") + ".txt";
                StreamWriter sw = new StreamWriter(newfolder);
                sw.Write(ex.ToString());
                sw.Close();
            }

            return(result);
        }