private void AddServiceButtons() { DataTable theDT = this.CreateServiceTiles(); RepeaterseriveAreas.DataSource = theDT; RepeaterseriveAreas.DataBind(); }
private void createserviceButtons() { try { IPatientRegistration ptnMgr = (IPatientRegistration)ObjectFactory.CreateInstance(ObjFactoryParameter); DataSet DSModules = new DataSet(); DataTable theDT = new DataTable(); DataTable theDTIdent = new DataTable(); if (Convert.ToInt32(Session["AppUserId"]) > 1) { DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"]), Convert.ToInt32(Session["AppUserId"])); theDT = DSModules.Tables[2]; theDTIdent = DSModules.Tables[3]; } else { DSModules = ptnMgr.GetModuleNames(Convert.ToInt32(Session["AppLocationId"])); theDT = DSModules.Tables[0]; theDTIdent = DSModules.Tables[2]; Session["AppModule"] = DSModules.Tables[3]; } ViewState["theDTIdent"] = theDTIdent;// Add this line by Rahmat(29 March-2017) which is used at RepeaterseriveAreas_ItemCommand //removing Workplan if KNH Static form service is not available Session["isKNHEnabled"] = false; DataTable dt = theDT; if (!object.Equals(theDT, null)) { int tmp = dt.AsEnumerable().Where(p => p.Field <int>("moduleid") == Convert.ToInt32("204")).Select(p => p.Field <int>("moduleid")).FirstOrDefault(); if (tmp > 0) { Session["isKNHEnabled"] = true; } } //DataTable dtTiles = DSModules.Tables[0]; DataTable dtTiles = dt; //returns true if user has at least some rights in billing and billing is enabled if (setBillingRights()) { DataRow dr = dtTiles.NewRow(); int maxSequence = DSModules.Tables[0].AsEnumerable().Max(r => r.Field <int>("Sequence")); dr["FacilityID"] = Convert.ToInt32(Session["FacilityID"].ToString()); dr["ModuleID"] = 9999; dr["ModuleName"] = "Billing"; dr["Sequence"] = maxSequence + 1; dtTiles.Rows.Add(dr); } //Add the Wards button only if wards is enabled and user has rights to it if (Session["Wards"].ToString() == "1" && Authentication.HasFeatureRight(ApplicationAccess.Wards, (DataTable)Session["UserRight"])) { DataRow dr = dtTiles.NewRow(); int maxSequence = DSModules.Tables[0].AsEnumerable().Max(r => r.Field <int>("Sequence")); dr["FacilityID"] = Convert.ToInt32(Session["FacilityID"].ToString()); dr["ModuleID"] = 9998; dr["ModuleName"] = "Wards"; dr["Sequence"] = maxSequence + 1; dtTiles.Rows.Add(dr); } theDT = this.GetTileData(dtTiles); RepeaterseriveAreas.DataSource = theDT; RepeaterseriveAreas.DataBind(); } catch (Exception) { throw; } }