예제 #1
0
        internal int IUDAssignExamUser(BOAssignExamUserGroup _boaeu)
        {
            int returnValue = default(int);

            using (SqlConnection _sqlconnection = ConnectionInfo.GetConnection())
            {
                _sqlcommand             = new SqlCommand();
                _sqlcommand.Connection  = _sqlconnection;
                _sqlcommand.CommandText = "SP_IUDAssignExamUserGroup";
                _sqlcommand.CommandType = CommandType.StoredProcedure;
                _sqlconnection.Open();

                _sqlcommand.Parameters.AddWithValue("@UserGroupId", _boaeu.UserGroupId);
                _sqlcommand.Parameters.AddWithValue("@ExamId", _boaeu.ExamId);
                _sqlcommand.Parameters.AddWithValue("@SecondCatId", _boaeu.SecondCatId);
                _sqlcommand.Parameters.AddWithValue("@OnlineTest", _boaeu.OnlineTest);
                _sqlcommand.Parameters.AddWithValue("@OfflineSimulator", _boaeu.OfflineSimulator);
                _sqlcommand.Parameters.AddWithValue("@TestOnce", _boaeu.TestOnce);
                _sqlcommand.Parameters.AddWithValue("@IsActive", _boaeu.IsActive);
                _sqlcommand.Parameters.AddWithValue("@IsDelete", _boaeu.IsDelete);
                _sqlcommand.Parameters.AddWithValue("@CreatedBy", _boaeu.CreatedBy);
                _sqlcommand.Parameters.AddWithValue("@CreatedDate", _boaeu.CreatedDate);
                _sqlcommand.Parameters.AddWithValue("@UpdatedBy", _boaeu.UpdatedBy);
                _sqlcommand.Parameters.AddWithValue("@UpdatedDate", _boaeu.UpdatedDate);
                _sqlcommand.Parameters.AddWithValue("@Event", _boaeu.Event);
                _sqlcommand.Parameters.AddWithValue("@returnValue", 0).Direction = System.Data.ParameterDirection.InputOutput;

                try
                {
                    _sqlcommand.ExecuteNonQuery();
                    returnValue = Convert.ToInt32(_sqlcommand.Parameters["@returnValue"].Value);
                }
                catch (SqlException sqlex)
                { Common.LogError(sqlex); }
                catch (StackOverflowException stackex)
                { Common.LogError(stackex); }
                catch (Exception ex)
                {
                    Common.LogError(ex);
                }
                finally
                {
                    _sqlconnection.Close();
                    _sqlcommand.Dispose();
                }
            }
            return(returnValue);
        }
예제 #2
0
        private void AssignExamUserGroup(int UserGroupId, int SecondCatId, string parentEvent)
        {
            BOAssignExamUserGroup _boaeug = new BOAssignExamUserGroup();
            BAAssignExamUserGroup _baaeug = new BAAssignExamUserGroup();

            foreach (ListItem item in chkcheckdECLgrp.Items)
            {
                //if (item.Selected)
                //{
                _boaeug.UserGroupId = UserGroupId;
                _boaeug.ExamId      = Convert.ToInt32(item.Value);
                _boaeug.SecondCatId = SecondCatId;
                if (chklistAccessoptionGroup.Items.FindByValue("2").Selected)
                {
                    _boaeug.OnlineTest = true;
                }
                else
                {
                    _boaeug.OnlineTest = false;
                }
                if (chklistAccessoptionGroup.Items.FindByValue("3").Selected)
                {
                    _boaeug.OfflineSimulator = true;
                }
                else
                {
                    _boaeug.OfflineSimulator = false;
                }
                if (chklistAccessoptionGroup.Items.FindByValue("4").Selected)
                {
                    _boaeug.TestOnce = true;
                }
                else
                {
                    _boaeug.TestOnce = false;
                }
                _boaeug.IsActive    = true;
                _boaeug.IsDelete    = false;
                _boaeug.CreatedBy   = MerchantId;
                _boaeug.CreatedDate = DateTime.UtcNow;
                _boaeug.UpdatedBy   = MerchantId;
                _boaeug.UpdatedDate = DateTime.UtcNow;
                _boaeug.Event       = parentEvent;
                _baaeug.Insert(_boaeug);
                // }
            }
        }
예제 #3
0
 internal int Insert(BOAssignExamUserGroup _boaeug)
 {
     return(_daaeug.IUDAssignExamUser(_boaeug));
 }