protected void lnkbtnOnlytestOnce_Click(object sender, EventArgs e)
 {
     try
     {
         LinkButton  lnkbtn       = sender as LinkButton;
         GridViewRow gvrow        = lnkbtn.NamingContainer as GridViewRow;
         int         examcodeid   = Convert.ToInt32(gvExamDetail.DataKeys[gvrow.RowIndex].Value.ToString());
         LinkButton  ID           = (LinkButton)gvrow.FindControl("lnkbtnOnlytestOnce");
         bool        onlytestonce = Convert.ToBoolean(ID.CommandArgument);
         if (onlytestonce == true)
         {
             _boexmmng.OnlyTestOnce = false;
         }
         else
         {
             _boexmmng.OnlyTestOnce = true;
         }
         _boexmmng.ExamCodeId  = examcodeid;
         _boexmmng.ValidDate   = DateTime.UtcNow;
         _boexmmng.CreatedDate = DateTime.UtcNow;
         _boexmmng.UpdatedBy   = merchantId;
         _boexmmng.UpdatedDate = DateTime.UtcNow;
         _boexmmng.Event       = "UpdateOnlyTestOnce";
         _baexmmng.Update(_boexmmng);
         FillgridViewExamDetail("GetExamWithMId", merchantId);
     }
     catch (Exception ex)
     {
         Common.LogError(ex);
         ShowMessage("Some technical error", MessageType.Warning);
     }
 }
Example #2
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
         {
             Session["CheckRefresh"]     = Server.UrlDecode(System.DateTime.Now.ToString());
             _boexmmng.ExamCode          = txtExamCode.Text;
             _boexmmng.ExamTitle         = txtExamtitle.Text;
             _boexmmng.SecondCategoryId  = Convert.ToInt32(drpSecondCategory.SelectedItem.Value);
             _boexmmng.PassingPercentage = Convert.ToDecimal(txtPassingPercentage.Text);
             _boexmmng.TestTime          = Convert.ToInt32(txtTestTime.Text);
             _boexmmng.TestOption        = txtTestOption.Text;
             _boexmmng.ValidDate         = Convert.ToDateTime(txtdate.Text);
             _boexmmng.MerchantId        = MerchantId;
             _boexmmng.IsActive          = true;
             _boexmmng.IsDelete          = false;
             _boexmmng.CreatedBy         = MerchantId;
             _boexmmng.CreatedDate       = DateTime.UtcNow;
             _boexmmng.UpdatedBy         = MerchantId;
             _boexmmng.UpdatedDate       = DateTime.UtcNow;
             if (ViewState["examId"] != null && !ViewState["examId"].Equals(""))
             {
                 // btnAdd.OnClientClick = "return getConfirmation(this, 'Please confirm','Are you sure you want to update this record?');";
                 _boexmmng.ExamCodeId = Convert.ToInt32(ViewState["examId"]);
                 _boexmmng.Event      = "Update";
                 if (_baexmmng.Update(_boexmmng) == 2)
                 {
                     ShowMessage("Exam updated successfully", MessageType.Success);
                 }
             }
             else
             {
                 _boexmmng.ExamCodeId = 0;
                 _boexmmng.Event      = "Insert";
                 if (_baexmmng.Insert(_boexmmng) == 1)
                 {
                     ShowMessage("Exam added successfully", MessageType.Success);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Common.LogError(ex);
         ShowMessage("Some technical error", MessageType.Warning);
     }
     ClearControl();
 }
 protected void lnkbtnactive_Click(object sender, EventArgs e)
 {
     try
     {
         if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
         {
             Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
             LinkButton  lnkbtn     = sender as LinkButton;
             GridViewRow gvrow      = lnkbtn.NamingContainer as GridViewRow;
             int         examcodeid = Convert.ToInt32(gvExamManage.DataKeys[gvrow.RowIndex].Value.ToString());
             LinkButton  ID         = (LinkButton)gvrow.FindControl("lnkbtnactive");
             bool        isactive   = Convert.ToBoolean(ID.CommandArgument);
             if (isactive == true)
             {
                 _boexmng.IsActive = false;
             }
             else
             {
                 _boexmng.IsActive = true;
             }
             _boexmng.ExamCodeId  = examcodeid;
             _boexmng.UpdatedBy   = adminId;
             _boexmng.UpdatedDate = DateTime.UtcNow;
             _boexmng.Event       = "UpdateActive";
             _baexmng.Update(_boexmng);
             FillgridViewExamManage();
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         Common.LogError(ex);
         ShowMessage("Some technical error", MessageType.Warning);
     }
 }
Example #4
0
        private void dgvExamManage_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (headval)
                {
                    if (dgvExamManage.Columns[e.ColumnIndex].Name == "Active")
                    {
                        bool isactive = Convert.ToBoolean(dgvExamManage.Rows[e.RowIndex].Cells[5].Value.ToString());
                        if (isactive == true)
                        {
                            _boexmmng.IsActive = false;
                        }
                        else
                        {
                            _boexmmng.IsActive = true;
                        }
                        _boexmmng.ExamCodeId = Convert.ToInt32(dgvExamManage.Rows[e.RowIndex].Cells[0].Value.ToString());

                        _boexmmng.UpdatedBy   = loginID;
                        _boexmmng.UpdatedDate = DateTime.UtcNow;
                        _boexmmng.Event       = "UpdateActive";
                        MessageBox.Show(Common.Message("Exam code " + dgvExamManage.Rows[e.RowIndex].Cells[1].Value.ToString() + " is", _baexmmng.Update(_boexmmng)));
                        FillDataGridView();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }