public int GetGateImportID(ModelGateStationImport pModel) { if (pModel == null) { return(0); } string strSql = @"select Gate_Id from gateStation_Import where rownum = 1 and Gate_Name = '{0}' and Month={1} and year = {2} "; string.Format(strSql, pModel.GATE_NAME, pModel.MONTH, pModel.YEAR); var dal = new DAL.DAL(); var objExecute = dal.ExecuteScalar(strSql); return(0); }
public bool IsPipelineImportDuplicate(ModelPipelineImport pModel) { if (pModel == null) { return(false); } string strCommand = @"select case when exists( select 1 from pipeline_Import where rc_Name = '{0}' and month ={1} and year = {2} ) then 1 else 0 end xx from dual"; strCommand = string.Format(strCommand, pModel.RC_NAME.Replace("'", "''"), pModel.MONTH, pModel.YEAR); var dal = new DAL.DAL(); var objExecute = dal.ExecuteScalar(strCommand); return(1.Equals(objExecute)); }