public DataSet CheckSeatsAndLock(string SeatNo, string showDate, string ShowTime, long TransactionID) { try { if (SecurityHeaderValidation.Validate(objSecurity)) { DataTable classcode = VistaDAL._Select_classcode(SeatNo, showDate, ShowTime);//this functon select all the categories of the seats, selected by the user. string classcodestring = ""; for (int i = 0; i < classcode.Rows.Count; i++) { classcodestring = classcodestring + classcode.Rows[i]["class Code"].ToString() + ","; } classcodestring = classcodestring.Remove(classcodestring.Length - 1); string[] classcodearray = classcodestring.Split(','); var distinctclasscode = (from w in classcodearray //decide whether categories are same or not select w).Distinct().ToArray(); string[] SeatKeyNo = SeatNo.Split(','); var distinctkeyno = (from w in SeatKeyNo //decide whether key no are repitative or not select w).Distinct().ToArray(); if (SeatKeyNo.Length == distinctkeyno.Length && distinctclasscode.Length == 1) { return(GTICKDAL.CheckSeatsAndLock(TransactionID, SeatNo, showDate, ShowTime)); } else { DataSet dsexcep = new DataSet(); DataTable dtexcep = new DataTable(); dtexcep.Columns.Add("Column1", typeof(int)); dtexcep.Rows.Add(0); dsexcep.Tables.Add(dtexcep); return(dsexcep); } } } catch (Exception ex) { Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(ex.Message); } return(null); }