public string GetUserStatus(string localBody, string wardno, string mobileno, string boothno) { try { OthersDAL dal = new OthersDAL(); DataSet ds = dal.GetJuniiours(mobileno); string juniours = ""; if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { juniours += ",'" + ds.Tables[0].Rows[i][1].ToString() + "'"; } juniours = juniours.Substring(1, juniours.Length - 1); PollingDataDAL podal = new PollingDataDAL(); DataSet ds1 = podal.GetUserStatus(juniours, wardno, boothno, localBody); juniours = ""; if (ds1.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { juniours += "*" + ds1.Tables[0].Rows[i][3].ToString() + "*" + ds1.Tables[0].Rows[i][4].ToString(); } juniours = juniours.Substring(1, juniours.Length - 1); } else { juniours += "" + CommonCode.DATA_NOT_FOUND.ToString(); } } else { juniours += "" + CommonCode.DATA_NOT_FOUND; } return(juniours); } catch (Exception) { return("" + CommonCode.ERROR); } }
public string GetResponsibility(string localBody, string wardno, string mobileno) { try { OthersDAL dal = new OthersDAL(); DataSet ds = dal.GetJuniiours(mobileno); string juniours = ""; if (ds.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { juniours += ",'" + ds.Tables[0].Rows[i][1].ToString() + "'"; } juniours = juniours.Substring(1, juniours.Length - 1); DataSet ds1 = dal.GetResponsibility(juniours, localBody, wardno); juniours = ""; if (ds1.Tables[0].Rows.Count != 0) { for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { juniours += "*" + ds1.Tables[0].Rows[i][1].ToString() + "*" + ds1.Tables[0].Rows[i][4].ToString() + "*" + (ds.Tables[0].AsEnumerable().Where(a => a.Field <string>("USER_MOBILE") == ds1.Tables[0].Rows[i][1].ToString()).Select(r => r.Field <string>("Name")).First <string>()); } juniours = juniours.Substring(1, juniours.Length - 1); } else { juniours += "" + CommonCode.DATA_NOT_FOUND.ToString(); } } else { juniours += "" + CommonCode.DATA_NOT_FOUND; } return(juniours); } catch (Exception) { return("" + CommonCode.ERROR); } }