示例#1
0
        public static int InsertDeviceBas(DevicsBas Bas, ref string a_strErr)
        {
            int      intInsert = 0;
            SQLTrans sqlTrans  = new SQLTrans();

            sqlTrans.Open("SupplyCnn");
            string strInsert = GSqlSentence.GetInsertInfoByD <DevicsBas>(Bas, "tk_DevicsBas");

            try
            {
                if (strInsert != "")
                {
                    intInsert = sqlTrans.ExecuteNonQuery(strInsert, CommandType.Text, null);
                }
                sqlTrans.Close(true);
            }
            catch (SqlException e)
            {
                sqlTrans.Close(false);
                a_strErr = e.Message;
                return(-1);
            }

            return(intInsert);
        }
示例#2
0
        public static int UpdateDeviceBas(DevicsBas Bas, string ecode, ref string a_strErr)
        {
            int      intInsert = 0;
            SQLTrans sqlTrans  = new SQLTrans();

            sqlTrans.Open("SupplyCnn");
            string strInsert = "update tk_DevicsBas set ControlCode = '" + Bas.StrControlCode + "',Ename = '" + Bas.StrEname + "',Manufacturer = '" + Bas.StrManufacturer + "',"
                               + "FactoryNumber = '" + Bas.StrFactoryNumber + "',Specification = '" + Bas.StrSpecification + "',DevicsType = '" + Bas.StrDevicsType + "',"
                               + "FactoryDate = '" + Bas.StrFactoryDate + "',TracingType = '" + Bas.StrTracingType + "',Precision = '" + Bas.StrPrecision + "',"
                               + "Clrange = '" + Bas.StrClrange + "',CycleType = '" + Bas.StrCycleType + "',Cycle = '" + Bas.StrCycle + "',"
                               + "CheckCompany = '" + Bas.StrCheckCompany + "',Remark = '" + Bas.StrRemark + "'"
                               + " where ECode = '" + ecode + "'";

            try
            {
                if (strInsert != "")
                {
                    intInsert = sqlTrans.ExecuteNonQuery(strInsert, CommandType.Text, null);
                }
                sqlTrans.Close(true);
            }
            catch (SqlException e)
            {
                sqlTrans.Close(false);
                a_strErr = e.Message;
                return(-1);
            }

            return(intInsert);
        }
示例#3
0
        public static DevicsBas getDevicsByID(string id)
        {
            DevicsBas Bas = new DevicsBas();
            string    str = "select * from tk_DevicsBas where ECode = '" + id + "'";
            DataTable dt  = SQLBase.FillTable(str, "SupplyCnn");

            if (dt.Rows.Count > 0)
            {
                Bas.StrControlCode   = dt.Rows[0]["ControlCode"].ToString();
                Bas.StrEname         = dt.Rows[0]["Ename"].ToString();
                Bas.StrManufacturer  = dt.Rows[0]["Manufacturer"].ToString();
                Bas.StrFactoryNumber = dt.Rows[0]["FactoryNumber"].ToString();
                Bas.StrSpecification = dt.Rows[0]["Specification"].ToString();
                Bas.StrDevicsType    = dt.Rows[0]["DevicsType"].ToString();
                if (dt.Rows[0]["FactoryDate"].ToString() != "")
                {
                    Bas.StrFactoryDate = Convert.ToDateTime(dt.Rows[0]["FactoryDate"]).ToString("yyyy-MM-dd");
                }
                Bas.StrPrecision    = dt.Rows[0]["Precision"].ToString();
                Bas.StrTracingType  = dt.Rows[0]["TracingType"].ToString();
                Bas.StrClrange      = dt.Rows[0]["Clrange"].ToString();
                Bas.StrCycleType    = dt.Rows[0]["CycleType"].ToString();
                Bas.StrCycle        = dt.Rows[0]["Cycle"].ToString();
                Bas.StrCheckCompany = dt.Rows[0]["CheckCompany"].ToString();
                Bas.StrRemark       = dt.Rows[0]["Remark"].ToString();
            }
            return(Bas);
        }
示例#4
0
 public static bool InsertNewDeviceBas(DevicsBas Bas, ref string a_strErr)
 {
     if (EquipPro.InsertDeviceBas(Bas, ref a_strErr) >= 1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#5
0
 public static bool UpdateNewDevice(DevicsBas Bas, string ecode, ref string a_strErr)
 {
     if (EquipPro.UpdateDeviceBas(Bas, ecode, ref a_strErr) >= 1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }