protected void Show_Alert(string strMessage) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(' " + strMessage + "')", true); LogObject.LogMessage = "Showing Alert with Message <" + strMessage + ">"; LogObject.Level = LogClass.Information; LogObject.AddLog(); }
protected void BindGrid() { string strConnString = ConfigurationManager.ConnectionStrings["SQLServerDB"].ConnectionString; string strQuery = @"SELECT [Tenant_Details].[Tenant_ID] as 'Tenant ID', [Tenant_Details].[Name] AS 'Name',[Tenant_Details].[Mobile_Phone] AS 'Phone Number', Right([PG_Table].[Pay_Date],2) AS 'Due Date', [Rent] FROM [Tenant_Details], [PG_Table] WHERE [Tenant_Details].[Tenant_ID] = [PG_Table].[Tenant_ID] AND [Current_Tenant] = 1"; using (SqlConnection conn = new SqlConnection(strConnString)) { using (SqlCommand cmd = new SqlCommand(strQuery)) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = conn; sda.SelectCommand = cmd; using (DataTable dt = new DataTable()) { sda.Fill(dt); GridView1.DataSource = dt; GridView1.DataBind(); LogObject.LogMessage = "Extracting Tenant Details for Modify Tenant Page"; LogObject.Level = LogClass.Information; LogObject.AddLog(); } } } } }