public int LoginVendor(LoginDetails loginDetails) { try { DALComponent objDALLog = new DALComponent(); objDALLog.SetParameters("@loginName", SqlDbType.VarChar, 50, loginDetails.UserName); objDALLog.SetParameters("@loginPassword", SqlDbType.VarChar, 50, loginDetails.UserPassword); objDALLog.SqlCommandText = "[ValidateVendor]"; object y = objDALLog.SelectRecordValue(); if (int.Parse(y.ToString()) > 0) return int.Parse(y.ToString()); else return 0; } catch (SqlException sqlEx) { throw new ApplicationException(sqlEx.Message.ToString()); } catch (Exception ex) { throw new ApplicationException("Error=" + ex.Message.ToString()); } }