public DataSet GetDBDefault_Load() { common_DataBase = new Common_DataBase(); common_DataBase.Query = "SELECT * FROM view_SingleGraphInfo Where Measured = 1 AND Incidence = 1 AND FreqBand = 1 AND GraphType = 1"; //common_DataBase.Query = "SELECT * from Project"; DataSet ds = common_DataBase.GetDataSet_Text(); return ds; }
/// <summary> /// /// </summary> /// <param name="Flag">0 �̸� ���� �ƴϸ� �Ϻ�</param> /// <returns></returns> public DataSet GetMaterialType(int Flag) { common_DataBase = new Common_DataBase(); if(Flag == 0) { common_DataBase.Query = "SELECT * FROM MaterialType ORDER BY MID ASC"; } else { common_DataBase.Query = "SELECT * FROM MaterialType Where Flag = 1 ORDER BY MID ASC"; } DataSet ds = common_DataBase.GetDataSet_Text(); return ds; }
public DataSet GetSingleMaterialGraph(string strID) { common_DataBase = new Common_DataBase(); common_DataBase.Query = String.Format("SELECT * FROM SingleMeterialGraph Where SGID = {0}",strID); DataSet ds = common_DataBase.GetDataSet_Text(); return ds; }
public DataSet GetSingleMaterial(string dID) { common_DataBase = new Common_DataBase(); common_DataBase.Query = String.Format("SELECT * FROM SingleMeterial Where SID = {0}",dID); return common_DataBase.GetDataSet_Text(); }
public int IsGraphExist(bool bIsSingle,int dIsMeasured,int dIncidence,int dFreqBand,int dGraphType,int dID) { common_DataBase = new Common_DataBase(); if(bIsSingle == true) { common_DataBase.Query = String.Format("SELECT SGID FROM view_SingleGraphInfo Where Measured = {0} AND Incidence = {1} AND FreqBand = {2} AND GraphType = {3} AND SID = {4}",dIsMeasured,dIncidence,dFreqBand,dGraphType,dID); } else { common_DataBase.Query = String.Format("SELECT LGID FROM view_MultiLayerMaterialGraph Where Measured = {0} AND Incidence = {1} AND FreqBand = {2} AND GraphType = {3} AND LID = {4}",dIsMeasured,dIncidence,dFreqBand,dGraphType,dID); } if(common_DataBase.GetDataSet_Text().Tables[0].Rows.Count > 0) { return int.Parse(common_DataBase.GetDataSet_Text().Tables[0].Rows[0][0].ToString()); } else { return -1; } }
public DataSet GetMultiMaterial(int dID) { common_DataBase = new Common_DataBase(); common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where LID = {0}",dID); return common_DataBase.GetDataSet_Text(); }
public DataSet Search_Parameter(string Category,string IncidenceCondition,string MaterialType,string Frequency,string strName, string strVendor,string strProducing,string strDate,int dMeasured) { common_DataBase = new Common_DataBase(); if(MaterialType != "0") { if(Category == "Single") { if(strName != "") { common_DataBase.Query = String.Format("SELECT * FROM SingleMeterial WHERE SID IN(SELECT SID FROM view_SingleGraphInfo Where (Vendor LIKE '%{3}%' OR Vendor IS NULL) AND (Producing LIKE '%{4}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND Name LIKE '%{2}%') ORDER BY SID",IncidenceCondition,MaterialType,strName,strVendor,strProducing,strDate); } else { common_DataBase.Query = String.Format("SELECT * FROM SingleMeterial WHERE SID IN(SELECT SID FROM view_SingleGraphInfo Where (Vendor LIKE '%{2}%' OR Vendor IS NULL) AND (Producing LIKE '%{3}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1}) ORDER BY SID",IncidenceCondition,MaterialType,strVendor,strProducing,strDate); } } else { if(strName != "") { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND MultiLayer.Name LIKE '%{2}%'",IncidenceCondition,MaterialType,strName); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1}",IncidenceCondition,MaterialType); } } } else { if(Category == "Single") { if(strName != "") { //common_DataBase.Query = String.Format("SELECT * FROM SingleMeterial WHERE SID IN(SELECT SID FROM view_SingleGraphInfo Where ((Vendor LIKE '%{2}%' OR Vendor IS NULL) AND (Producing LIKE '%{3}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND Name = '%{1}%') OR(Occurred_Date LIKE '%{4}%')) ORDER BY SID",IncidenceCondition,strName,strVendor,strProducing,strDate); common_DataBase.Query = String.Format("SELECT * FROM SingleMeterial WHERE SID IN(SELECT SID FROM view_SingleGraphInfo Where (Vendor LIKE '%{1}%' OR Vendor IS NULL) AND (Producing LIKE '%{2}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {3} AND Name LIKE '%{0}%')",strName,strVendor,strProducing,IncidenceCondition); } else { common_DataBase.Query = String.Format("SELECT * FROM SingleMeterial WHERE SID IN(SELECT SID FROM view_SingleGraphInfo Where (Vendor LIKE '%{1}%' OR Vendor IS NULL) AND (Producing LIKE '%{2}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0}) ORDER BY SID",IncidenceCondition,strVendor,strProducing,strDate); } } else { if(strName != "") { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND Name LIKE '%{1}%'",IncidenceCondition,strName); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0}",IncidenceCondition); } } } DataSet ds = common_DataBase.GetDataSet_Text(); return ds; }
// public DataSet Search_MultiMaterial(string strName,string strTotalThick) // { // string strQuery = "SELECT * FROM view_MultiLayerMaterialGraph Where Measured <> 1"; // // if(strname != "") // { // strQuery = strQuery + String.Format(" AND Name = '{0}' ",strName); // } // if(strTotalThick != "") // { // strQuery = strQuery + String.Format(" AND TotalThick = '{0}' ",strTotalThick); // } // // common_DataBase.Query = strQuery; // // DataSet ds = common_DataBase.GetDataSet_Text(); // // return ds; // } /// <summary> /// IDs �� �ĸ��������� �ָ� �� �����´� /// </summary> /// <param name="Category"></param> /// <param name="strIDs"></param> /// <returns></returns> public DataSet Search_IDs(string Category,string strIDs) { if(strIDs != "") { common_DataBase = new Common_DataBase(); if(Category == "Single") { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where SGID IN({0})",strIDs); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where LGID IN({0})",strIDs); } DataSet ds = common_DataBase.GetDataSet_Text(); return ds; } else { return null; } }
/// <summary> /// �ش� ���� ID �� �ָ� �װ� �����´� /// </summary> /// <param name="Category"></param> /// <param name="strIDs"></param> /// <returns></returns> public DataSet Search_ID(bool Category,string strID) { common_DataBase = new Common_DataBase(); if(Category == true) { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where SGID = {0}",strID); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where LGID = {0}",strID); } DataSet ds = common_DataBase.GetDataSet_Text(); return ds; }
/// <summary> /// ��ȸ �Լ� /// </summary> /// <param name="Category"></param> /// <param name="IncidenceCondition"></param> /// <param name="MaterialType"></param> /// <param name="Option"></param> /// <param name="Frequency">1,Narrow band 2,Octave 3,1/3 Octav</param> public DataSet Search(string Category,string IncidenceCondition,string MaterialType,string Frequency,string strName, string strVendor,string strProducing,string strDate,int dMeasured) { common_DataBase = new Common_DataBase(); if(MaterialType != "0") { if(Category == "Single") { if(strName != "") { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{3}%' OR Vendor IS NULL) AND (Producing LIKE '%{4}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND Name LIKE '%{2}%' ORDER BY SID",IncidenceCondition,MaterialType,strName,strVendor,strProducing,strDate); } else { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{4}%' OR Vendor IS NULL) AND (Producing LIKE '%{5}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND FreqBand = {2} AND Name LIKE '%{3}%' ORDER BY SID",IncidenceCondition,MaterialType,Frequency,strName,strVendor,strProducing,strDate); } } else { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{2}%' OR Vendor IS NULL) AND (Producing LIKE '%{3}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} ORDER BY SID",IncidenceCondition,MaterialType,strVendor,strProducing,strDate); } else { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{3}%' OR Vendor IS NULL) AND (Producing LIKE '%{4}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND FreqBand = {2} ORDER BY SID",IncidenceCondition,MaterialType,Frequency,strVendor,strProducing,strDate); } } } else { if(strName != "") { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND MultiLayer.Name LIKE '%{2}%'",IncidenceCondition,MaterialType,strName); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND FreqBand = {2} AND MultiLayer.Name LIKE '%{3}%'",IncidenceCondition,MaterialType,Frequency,strName); } } else { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1}",IncidenceCondition,MaterialType); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND MID = {1} AND FreqBand = {2} ",IncidenceCondition,MaterialType,Frequency); } } } } else { if(Category == "Single") { if(strName != "") { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{2}%' OR Vendor IS NULL) AND (Producing LIKE '%{3}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND Name LIKE '%{1}%' ORDER BY SID",IncidenceCondition,strName,strVendor,strProducing,strDate); } else { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{3}%' OR Vendor IS NULL) AND (Producing LIKE '%{4}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND FreqBand = {1} AND Name LIKE '%{2}%' ORDER BY SID",IncidenceCondition,Frequency,strName,strVendor,strProducing,strDate); } } else { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{1}%' OR Vendor IS NULL) AND (Producing LIKE '%{2}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} ORDER BY SID",IncidenceCondition,strVendor,strProducing,strDate); } else { common_DataBase.Query = String.Format("SELECT * FROM view_SingleGraphInfo Where (Vendor LIKE '%{2}%' OR Vendor IS NULL) AND (Producing LIKE '%{3}%' OR Producing IS NULL) AND Measured = " + dMeasured + " AND Incidence = {0} AND FreqBand = {1} ORDER BY SID",IncidenceCondition,Frequency,strVendor,strProducing,strDate); } } } else { if(strName != "") { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND Name LIKE '%{1}%'",IncidenceCondition,strName); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND FreqBand = {1} AND Name LIKE '%{2}%'",IncidenceCondition,Frequency,strName); } } else { if(Frequency == "0") { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0}",IncidenceCondition); } else { common_DataBase.Query = String.Format("SELECT * FROM view_MultiLayerMaterialGraph Where Measured = " + dMeasured + " AND Incidence = {0} AND FreqBand = {1} ",IncidenceCondition,Frequency); } } } } DataSet ds = common_DataBase.GetDataSet_Text(); return ds; }