Beispiel #1
0
        public static int UpdateRativeSource(RativeSource Rsource, string id, ref string a_strErr)
        {
            int      intInsert = 0;
            SQLTrans sqlTrans  = new SQLTrans();

            sqlTrans.Open("SupplyCnn");
            string strInsert = "update tk_RativeSource set RID = '" + Rsource.StrRID + "',EquipID = '" + Rsource.StrEquipID + "',ProModel = '" + Rsource.StrProModel + "',"
                               + "Source = '" + Rsource.StrSource + "',Manufacturer = '" + Rsource.StrManufacturer + "',Nominal = '" + Rsource.StrNominal + "',SourceNumber = '" + Rsource.StrSourceNumber + "' where ID = '" + id + "'";

            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);
        }
Beispiel #2
0
        public static int InsertRativeSource(RativeSource Rsource, ref string a_strErr)
        {
            int      intInsert = 0;
            SQLTrans sqlTrans  = new SQLTrans();

            sqlTrans.Open("SupplyCnn");
            string strInsert = GSqlSentence.GetInsertInfoByD <RativeSource>(Rsource, "tk_RativeSource");

            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);
        }
Beispiel #3
0
 public static bool UpdateNewRativeSource(RativeSource Rsource, string id, ref string a_strErr)
 {
     if (EquipPro.UpdateRativeSource(Rsource, id, ref a_strErr) >= 1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #4
0
 public static bool InsertNewRativeSource(RativeSource Rsource, ref string a_strErr)
 {
     if (EquipPro.InsertRativeSource(Rsource, ref a_strErr) >= 1)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #5
0
        public static RativeSource getUpdateRative(string id)
        {
            RativeSource Rsource = new RativeSource();
            string       strSql  = "select * from tk_RativeSource where ID = '" + id + "'";
            DataTable    dt      = SQLBase.FillTable(strSql, "SupplyCnn");

            if (dt.Rows.Count > 0)
            {
                Rsource.StrRID          = dt.Rows[0]["RID"].ToString();
                Rsource.StrEquipID      = dt.Rows[0]["EquipID"].ToString();
                Rsource.StrProModel     = dt.Rows[0]["ProModel"].ToString();
                Rsource.StrSource       = dt.Rows[0]["Source"].ToString();
                Rsource.StrManufacturer = dt.Rows[0]["Manufacturer"].ToString();
                Rsource.StrNominal      = dt.Rows[0]["Nominal"].ToString();
                Rsource.StrSourceNumber = dt.Rows[0]["SourceNumber"].ToString();
            }
            return(Rsource);
        }