コード例 #1
0
 protected void AutoRefreshTimer_Tick(object sender, EventArgs e)
 {
     GridExp.DataBind();
     GridLoc.DataBind();
     if (IsPostBack)
     {
         checkExp();
         checkLoc();
     }
     QueueView();
 }
コード例 #2
0
        protected void CheckLocApp_Click(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                var strSql   = new StringBuilder(string.Empty);
                var con      = new SqlConnection(strConnection);
                var conQueue = new SqlConnection(strConnection);
                var cmd      = new SqlCommand();

                var ChecklocApp = (Button)sender;
                var grdRow1     = (GridViewRow)ChecklocApp.NamingContainer;
                var lblID       = (Label)grdRow1.FindControl("LabelID");

                var cusTime = DateTime.Now;
                var named   = User.Identity.Name;


                try
                {
                    ApproveSecurity(con, conQueue, cmd, lblID, cusTime, named);
                }
                catch (SqlException ex)
                {
                    var errorMsg = "Error in Updation";
                    errorMsg += ex.Message;
                    throw new Exception(errorMsg);
                }
                finally
                {
                    con.Close();
                    conQueue.Close();

                    GridLoc.DataBind();
                }
            }
        }
コード例 #3
0
        private void RadioCheck(object sender)
        {
            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("@Status", "SECTNA");
                    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();

                    GridLoc.DataBind();
                    GridExp.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("@Status", "SECTA");
                    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();

                    //GridLoc.DataBind();
                    //GridExp.DataBind();
                }
            }
        }