protected void AutoRefreshTimer_Tick(object sender, EventArgs e) { GridEntries.DataBind(); }
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e) { var strSql = new StringBuilder(string.Empty); var con = new SqlConnection(strConnection); var conQueue = new SqlConnection(strConnection); var cmd = new SqlCommand(); //CheckBox CheckNo = (CheckBox)sender; var rdbl = (RadioButtonList)sender; var grdRow = (GridViewRow)rdbl.NamingContainer; //CheckBox chkNo = (CheckBox)grdRow.FindControl("CheckNo"); var chkRl = (RadioButtonList)grdRow.FindControl("RadioButtonList1"); var lblID = (Label)grdRow.FindControl("LabelID"); var cusTime = DateTime.Now; var named = User.Identity.Name; if (chkRl.SelectedValue == "False") { try { const string strQueueUpdate = "Update NewQueue set Status = @Status, StatusTime = @StatusTime WHERE QueueID = @QueueID"; cmd.CommandType = CommandType.Text; cmd.CommandText = strQueueUpdate; cmd.Parameters.Clear(); //cmd.Parameters.AddWithValue("@CustCareApproval", ChkApp); cmd.Parameters.AddWithValue("@Status", "UNCLR"); cmd.Parameters.AddWithValue("@StatusTime", cusTime); cmd.Parameters.AddWithValue("@QueueID", lblID.Text); cmd.Connection = conQueue; conQueue.Open(); cmd.ExecuteNonQuery(); } catch (SqlException ex) { var errorMsg = "Error in Updation"; errorMsg += ex.Message; throw new Exception(errorMsg); } finally { con.Close(); conQueue.Close(); GridEntries.DataBind(); } } else if (chkRl.SelectedValue == "True") { try { const string strQueueUpdate = "Update NewQueue set Status = @Status WHERE QueueID = @QueueID"; cmd.CommandType = CommandType.Text; cmd.CommandText = strQueueUpdate; cmd.Parameters.Clear(); //cmd.Parameters.AddWithValue("@CustCareApproval", ChkApp); cmd.Parameters.AddWithValue("@Status", "LODCLE"); //cmd.Parameters.AddWithValue("@StatusTime", cusTime); cmd.Parameters.AddWithValue("@QueueID", lblID.Text); cmd.Connection = conQueue; conQueue.Open(); cmd.ExecuteNonQuery(); } catch (SqlException ex) { var errorMsg = "Error in Updation"; errorMsg += ex.Message; throw new Exception(errorMsg); } finally { con.Close(); conQueue.Close(); } } checkAll(); }