Ejemplo n.º 1
0
        internal int IUDReports(BOExamReports _boexrport)
        {
            int        returnvalue = default(int);
            SqlCommand _sqlcommand;

            using (SqlConnection _sqlconnection = ConnectionInfo.GetConnection())
            {
                _sqlcommand = new SqlCommand();

                _sqlcommand.Connection  = _sqlconnection;
                _sqlcommand.CommandText = "SP_IUDReports";
                _sqlcommand.CommandType = CommandType.StoredProcedure;
                _sqlconnection.Open();

                _sqlcommand.Parameters.AddWithValue("@UserId", _boexrport.UserId);
                _sqlcommand.Parameters.AddWithValue("@CategoryId", _boexrport.CategoryId);
                _sqlcommand.Parameters.AddWithValue("@ExamId", _boexrport.ExamId);
                _sqlcommand.Parameters.AddWithValue("@Result", _boexrport.Result);
                _sqlcommand.Parameters.AddWithValue("@Score", _boexrport.Score);
                _sqlcommand.Parameters.AddWithValue("@OutofScore", _boexrport.OutofScore);
                _sqlcommand.Parameters.AddWithValue("@AllowPrint", _boexrport.AllowPrint);
                _sqlcommand.Parameters.AddWithValue("@DigitalCertificateId", _boexrport.DigitalCertificateId);
                _sqlcommand.Parameters.AddWithValue("@CertificationNo", _boexrport.CertificationNo);
                _sqlcommand.Parameters.AddWithValue("@ExamGivenDate", _boexrport.ExamGivenDate);
                _sqlcommand.Parameters.AddWithValue("@MerchantId", _boexrport.MerchantId);
                _sqlcommand.Parameters.AddWithValue("@IsActive", _boexrport.IsActive);
                _sqlcommand.Parameters.AddWithValue("@IsDelete", _boexrport.IsDelete);
                _sqlcommand.Parameters.AddWithValue("@CreatedBy", _boexrport.CreatedBy);
                _sqlcommand.Parameters.AddWithValue("@CreatedDate", _boexrport.CreatedDate);
                _sqlcommand.Parameters.AddWithValue("@UpdatedBy", _boexrport.UpdatedBy);
                _sqlcommand.Parameters.AddWithValue("@UpdatedDate", _boexrport.UpdatedDate);
                _sqlcommand.Parameters.AddWithValue("@Event", _boexrport.Event);
                _sqlcommand.Parameters.AddWithValue("@returnValue", 0).Direction = System.Data.ParameterDirection.InputOutput;

                try
                {
                    _sqlcommand.ExecuteNonQuery();
                    returnvalue = Convert.ToInt32(_sqlcommand.Parameters["@returnValue"].Value);
                }
                catch (Exception ex)
                {
                    Common.LogError(ex);
                }
                finally
                {
                    _sqlconnection.Close();
                    _sqlcommand.Dispose();
                }
            }
            return(returnvalue);
        }
Ejemplo n.º 2
0
 private void InserExamReport(BOExamManage _boexammanage)
 {
     try
     {
         if (_boexammanage != null)
         {
             BOExamReports _boexrport = new BOExamReports();
             BAExamReports _baexrport = new BAExamReports();
             _boexrport.UserId     = _bouserDetail.UserId;
             _boexrport.CategoryId = _boexammanage.SecondCategoryId;
             _boexrport.ExamId     = _boexammanage.ExamCodeId;
             if (resultScore >= passingSocre)
             {
                 _boexrport.Result = true;
             }
             else
             {
                 _boexrport.Result = false;
             }
             _boexrport.Score                = Convert.ToDecimal(resultScore);
             _boexrport.OutofScore           = Convert.ToDecimal(totalScore);
             _boexrport.AllowPrint           = true;
             _boexrport.DigitalCertificateId = 1;
             var rnd   = new Random(DateTime.Now.Millisecond);
             int ticks = rnd.Next(0, 3000);
             _boexrport.CertificationNo = ticks;
             _boexrport.ExamGivenDate   = DateTime.UtcNow;
             _boexrport.MerchantId      = _bouserDetail.MerchantId;
             _boexrport.IsActive        = true;
             _boexrport.IsDelete        = false;
             _boexrport.CreatedBy       = _bouserDetail.UserId;
             _boexrport.CreatedDate     = DateTime.UtcNow;
             _boexrport.UpdatedBy       = _bouserDetail.UserId;
             _boexrport.UpdatedDate     = DateTime.UtcNow;
             _boexrport.Event           = "Insert";
             _baexrport.Insert(_boexrport);
         }
     }
     catch (Exception ex)
     {
         Common.LogError(ex);
     }
 }
Ejemplo n.º 3
0
 internal int Insert(BOExamReports _boexrport)
 {
     return(_daexmrpt.IUDReports(_boexrport));
 }