public DataSet Login_RegisterStatus(string UserName, string Password, string SysDt, int StoreID, int StationID) { objData = new ClsData(); DataSet dsAIPLData = new DataSet("AIPLData"); if ((dtResult.Columns.Count == 0)) { dtResult.Columns.Add("Result"); dtResult.Columns.Add("Code"); dtResult.Columns.Add("Description"); dtResult.Rows.Add(); } try { dsAIPLData = objData.Login_RegisterStatus(UserName, Password, SysDt, StoreID, StationID); if (dsAIPLData != null) { if (dsAIPLData.Tables[0].Rows.Count > 0) { dtResult.Rows[0]["Result"] = "A"; dtResult.Rows[0]["Code"] = "000"; dtResult.Rows[0]["Description"] = "Success"; dtResult.AcceptChanges(); dsReturn.Tables.Add(dtResult); for (int intFor = 0; intFor <= dsAIPLData.Tables.Count - 1; intFor++) { dsReturn.Tables.Add(dsAIPLData.Tables[intFor].Copy()); } } } else { dtResult.Rows[0]["Result"] = "R"; dtResult.Rows[0]["Code"] = "001"; dtResult.Rows[0]["Description"] = "No record found!"; dtResult.AcceptChanges(); dsReturn.Tables.Add(dtResult); } return(dsReturn); } catch (Exception ex) { SendEMail(ErrorMailSendTo, "Login_RegisterStatus", ex.Message.ToString()); dtResult.Rows[0]["Result"] = "R"; dtResult.Rows[0]["Code"] = "001"; dtResult.Rows[0]["Description"] = ex.Message.ToString(); dtResult.AcceptChanges(); dsReturn.Tables.Add(dtResult); return(dsReturn); } finally { dsAIPLData = null; objData = null; } }