// The below will check record and takes first paramenter as Stored Proc or Sql Query // second argument as whether this is proc or query i.e. true for stored proc and flase for sql query // third parameter is passed sql parameter public bool IsExists(string strProcOrQuery, bool isProc, SqlParameter[] sqlParam) { try { strCommon = ""; if (isProc) { sqlDr = objSql.ExecuteReader(CommandType.StoredProcedure, strProcOrQuery, sqlParam); } else { sqlDr = objSql.ExecuteReader(CommandType.Text, strProcOrQuery, sqlParam); } if (sqlDr.Read()) { return(true); } return(false); } catch (Exception ex) { SIMSCommonClass.WriteErrorErrFile(Request.RawUrl.ToString(), ex.StackTrace.ToString() + "-->" + ex.Message.ToString()); return(false); } }
//bhawesh 30 may public bool IsActivityChargeGenerated() { SqlParameter[] sqlParamI = { new SqlParameter("@Complaint_No", this.Complaint_No), new SqlParameter("@Type", "CHECK_ACTIVITY_CHARGES") }; SqlDataReader obj = objSql.ExecuteReader(CommandType.StoredProcedure, "uspSpareConsumeForComplaint", sqlParamI); sqlParamI = null; return(obj.HasRows); }
/// <summary> /// Enter sticker code on 19.3.2015 /// </summary> /// <returns></returns> public string UploadStickers() { string result = string.Empty; SqlParameter[] sqlParamI = { new SqlParameter("@Message", SqlDbType.VarChar, 1000), new SqlParameter("@UserName", this.EmpCode), new SqlParameter("@RegionSno", this.RegionSno), new SqlParameter("@StickerCode", this.StickerCode), new SqlParameter("@ActiveStatus", this.ActiveStatus), new SqlParameter("@ProductDivisionId", this.ProductDivisionSno), new SqlParameter("@Type", "STICKERENTRY") }; sqlParamI[0].Direction = ParameterDirection.Output; objSqlDataAccessLayer.ExecuteReader(CommandType.StoredProcedure, "uspGetStickerDetails", sqlParamI); result = sqlParamI[0].Value.ToString(); sqlParamI = null; return(result); }