Пример #1
0
        private bool IsExists(String existQuery)
        {
            DataSet ds = GF.GetDataFromDB(existQuery);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0].ItemArray.GetValue(0) != DBNull.Value)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        private string getValueFromMaster(string MasterLookUpTable, string MasterIdField, string MasterLookUpField, string FieldValue)
        {
            DataSet ds;
            string  Query;

            Query = "select " + MasterIdField + " from " + MasterLookUpTable + " where " + MasterLookUpField + " = '" + FieldValue + "'";

            ds = GF.GetDataFromDB(Query);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0].ItemArray.GetValue(0) != null)
                {
                    return(Convert.ToString(ds.Tables[0].Rows[0].ItemArray.GetValue(0)));
                }
                else
                {
                    return("null");
                }
            }
            return("null");
        }