private int UpdateExamSchedule()
        {
            int Returnvalue = 0;

            ObjExamSehedules TheScdules = new ObjExamSehedules();

            TheScdules.ExamScheduleID   = int.Parse(lbl_Hidden_SheduleID.Text);
            TheScdules.ExamScheduleName = txt_ExamSeheduleName.Text;
            TheScdules.ExamID           = int.Parse(drpdwn_ExamID.SelectedValue);
            TheScdules.SubjectID        = int.Parse(drpdwn_Subject.SelectedValue);
            TheScdules.StreamID         = int.Parse(drpdwn_Stream.SelectedValue);
            //TheScdules.SubjectPaperID = int.Parse(drpdwn_PaperID.SelectedValue);
            TheScdules.FullMark          = int.Parse(txt_ExamFullMark.Text);
            TheScdules.PassMark          = int.Parse(txt_PassMark.Text);
            TheScdules.QualID            = int.Parse(DropDown_Class.SelectedValue);
            TheScdules.ClassID           = int.Parse(drpdwn_ClassID.SelectedValue);
            TheScdules.StartTime         = txt_startExamTime.Text;
            TheScdules.CloseTime         = txt_CloseTime.Text;
            TheScdules.ExamDate          = DateTime.Parse(txt_StartExam.Text).ToString(MicroConstants.DateFormat);
            TheScdules.InvisilatorUserID = int.Parse(DropDown_Staff.SelectedValue);
            //TheScdules.IsSubjectPractical = Boolean.Parse(radio_PraticalStatus.SelectedItem.Value);
            TheScdules.IsActive  = true;
            TheScdules.IsDeleted = false;
            TheScdules.RoomNo    = int.Parse(txt_Roomnumber.Text);

            Returnvalue = ExamScheduleManagement.GetInstance.UpdateSchedules(TheScdules);
            return(Returnvalue);
        }
Example #2
0
        public static ObjExamSehedules DataRowToObject(DataRow dr)
        {
            ObjExamSehedules examobj = new ObjExamSehedules();

            examobj.ExamScheduleID   = int.Parse(dr["ExamScheduleID"].ToString());
            examobj.ExamScheduleName = dr["ExamScheduleName"].ToString();
            examobj.StreamID         = int.Parse(dr["StreamID"].ToString());
            examobj.ExamID           = int.Parse(dr["ExamID"].ToString());
            examobj.SubjectID        = int.Parse(dr["SubjectID"].ToString());
            examobj.FullMark         = int.Parse(dr["FullMark"].ToString());
            examobj.PassMark         = int.Parse(dr["PassMark"].ToString());
            examobj.ClassID          = int.Parse(dr["ClassID"].ToString());
            examobj.QualID           = int.Parse(dr["QualID"].ToString());
            //examobj.SubjectFullMark = int.Parse(dr["SubjectFullMark"].ToString());
            examobj.ExamDate          = DateTime.Parse(dr["ExamDate"].ToString()).ToString(MicroConstants.DateFormat);
            examobj.StartTime         = dr["StartTime"].ToString();
            examobj.CloseTime         = dr["CloseTime"].ToString();
            examobj.RoomNo            = int.Parse(dr["RoomNo"].ToString());
            examobj.InvisilatorUserID = int.Parse(dr["InvisilatorUserID"].ToString());
            examobj.IsActive          = bool.Parse(dr["IsActive"].ToString());
            examobj.OfficeID          = (string.IsNullOrEmpty(dr["OfficeID"].ToString()) ? 0 : int.Parse(dr["OfficeID"].ToString()));
            examobj.CompanyID         = (string.IsNullOrEmpty(dr["CompanyID"].ToString()) ? 0 : int.Parse(dr["CompanyID"].ToString()));

            return(examobj);
        }
Example #3
0
        public static List <ObjExamSehedules> GetExamSeduleList()
        {
            List <ObjExamSehedules> ExamSeduleList = new List <ObjExamSehedules>();
            DataTable ExamSeduleTable = ExamScheduleDataAccess.GetInstance.GetExamSeduleList();

            foreach (DataRow dr in ExamSeduleTable.Rows)
            {
                ObjExamSehedules TheExamSehedules = DataRowToObject(dr);
                ExamSeduleList.Add(TheExamSehedules);
            }
            return(ExamSeduleList);
        }
        public List <ObjExamSehedules> BindThisSechedule()
        {
            ObjExamSehedules objSechedule = new ObjExamSehedules();

            objSechedule = (from xyzl in ExamScheduleManagement.GetInstance.GetExamSeduleList()
                            where xyzl.ExamScheduleID == int.Parse(drpdwn_ExamMarkSeheduleID.SelectedValue)
                            select xyzl).Single();
            List <ObjExamSehedules> obj = new List <ObjExamSehedules>();

            obj.Add(objSechedule);
            return(obj);
        }
        public int DeleteExamSedhule(ObjExamSehedules theSeduleExam)
        {
            int ReturnValue = 0;

            using (SqlCommand DeleteCommand = new SqlCommand {
                CommandType = CommandType.StoredProcedure
            })
            {
                DeleteCommand.Parameters.Add(GetParameter("@ExamScheduleID", SqlDbType.Int, theSeduleExam.ExamScheduleID));
                DeleteCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, 1));;//TO DO:hard code //SqlDbType.Int,Micro.Commons.Connection.LoggedOnUser.UserID)
                DeleteCommand.CommandText = "pICAS_Exam_Schedule_Delete";
                ExecuteStoredProcedure(DeleteCommand);
                ReturnValue = int.Parse(DeleteCommand.Parameters[0].Value.ToString());
            }
            return(ReturnValue);
        }
        private int DeleteRecord(int Record)
        {
            int Returnvalue = 0;

            ObjExamSehedules DeleteExamSchedules = new ObjExamSehedules();

            DeleteExamSchedules.ExamScheduleID = Record;

            DeleteExamSchedules.ModifiedBy = 44; //:TO DO Kanhu HARD CODE
            DeleteExamSchedules.OfficeID   = 1;  //:TO DO Kanhu HARD CODE
            DeleteExamSchedules.CompanyID  = 1;  //:TO DO Kanhu HARD CODE
            DeleteExamSchedules.IsActive   = false;
            DeleteExamSchedules.IsDeleted  = true;
            Returnvalue = ExamScheduleManagement.GetInstance.DeleteSchedules(DeleteExamSchedules);
            return(Returnvalue);
        }
 private void PopulateFormField(ObjExamSehedules theSehedules, int Record)
 {
     lbl_Hidden_SheduleID.Text   = Record.ToString();
     txt_ExamSeheduleName.Text   = theSehedules.ExamScheduleName;
     drpdwn_ExamID.SelectedValue = theSehedules.ExamID.ToString();
     drpdwn_Stream.SelectedValue = theSehedules.StreamID.ToString();
     BindDropdown_Quals();
     BindClass();
     BindDropdown_Qual_Classes();
     drpdwn_ClassID.SelectedValue = theSehedules.ClassID.ToString();
     BindDropdown_Stream_Subjects();
     drpdwn_Subject.SelectedValue = theSehedules.SubjectID.ToString();
     //BindDropdown_Subjects_Papers();
     //drpdwn_PaperID.SelectedValue = theSehedules.SubjectPaperID.ToString();
     txt_StartExam.Text           = theSehedules.ExamDate;
     txt_ExamFullMark.Text        = theSehedules.FullMark.ToString();
     txt_PassMark.Text            = theSehedules.PassMark.ToString();
     txt_startExamTime.Text       = theSehedules.StartTime;
     txt_CloseTime.Text           = theSehedules.CloseTime;
     DropDown_Staff.SelectedValue = theSehedules.InvisilatorUserID.ToString();
     txt_Roomnumber.Text          = theSehedules.RoomNo.ToString();
     //radio_PraticalStatus.SelectedValue = theSehedules.IsSubjectPractical.ToString();
 }
        public int UpdateExamSedhule(ObjExamSehedules theSeduleExam)
        {
            int ReturnValue = 0;

            using (SqlCommand UpdateCommand = new SqlCommand {
                CommandType = CommandType.StoredProcedure
            })
            {
                UpdateCommand.Parameters.Add(GetParameter("@ReturnValue", SqlDbType.Int, ReturnValue)).Direction = ParameterDirection.Output;
                UpdateCommand.Parameters.Add(GetParameter("@ExamScheduleID", SqlDbType.Int, theSeduleExam.ExamScheduleID));
                UpdateCommand.Parameters.Add(GetParameter("@ExamScheduleName", SqlDbType.VarChar, theSeduleExam.ExamScheduleName));
                UpdateCommand.Parameters.Add(GetParameter("@ExamID", SqlDbType.Int, theSeduleExam.ExamID));
                UpdateCommand.Parameters.Add(GetParameter("@StreamID", SqlDbType.Int, theSeduleExam.StreamID));
                UpdateCommand.Parameters.Add(GetParameter("@QualID", SqlDbType.Int, theSeduleExam.QualID));
                UpdateCommand.Parameters.Add(GetParameter("@ClassID", SqlDbType.Int, theSeduleExam.ClassID));
                UpdateCommand.Parameters.Add(GetParameter("@SubjectID", SqlDbType.Int, theSeduleExam.SubjectID));
                UpdateCommand.Parameters.Add(GetParameter("@FullMark", SqlDbType.Int, theSeduleExam.FullMark));
                UpdateCommand.Parameters.Add(GetParameter("@PassMark", SqlDbType.Int, theSeduleExam.PassMark));
                UpdateCommand.Parameters.Add(GetParameter("@ExamDate", SqlDbType.VarChar, theSeduleExam.ExamDate));
                UpdateCommand.Parameters.Add(GetParameter("@StartTime", SqlDbType.Decimal, Decimal.Parse(theSeduleExam.StartTime.ToString())));
                UpdateCommand.Parameters.Add(GetParameter("@CloseTime", SqlDbType.Decimal, Decimal.Parse(theSeduleExam.CloseTime)));
                UpdateCommand.Parameters.Add(GetParameter("@InvisilatorUserID", SqlDbType.Int, theSeduleExam.InvisilatorUserID));
                UpdateCommand.Parameters.Add(GetParameter("@RoomNo", SqlDbType.Int, theSeduleExam.RoomNo));
                UpdateCommand.Parameters.Add(GetParameter("@IsActive", SqlDbType.Bit, theSeduleExam.IsActive));
                UpdateCommand.Parameters.Add(GetParameter("@IsDeleted", SqlDbType.Bit, theSeduleExam.IsDeleted));
                UpdateCommand.Parameters.Add(GetParameter("@OfficeID", SqlDbType.Int, 44));
                //UpdateCommand.Parameters.Add(GetParameter("@DateModified", SqlDbType.DateTime,DateTime.Now));
                UpdateCommand.Parameters.Add(GetParameter("@ModifiedBy", SqlDbType.Int, 1)); //TO DO:hard code //SqlDbType.Int,Micro.Commons.Connection.LoggedOnUser.UserID)
                UpdateCommand.Parameters.Add(GetParameter("@CompanyID", SqlDbType.Int, 44)); //TO DO:hard code KP
                UpdateCommand.Parameters.Add(GetParameter("@AddedBy", SqlDbType.Int, 1));    //TO DO:hard code
                //TODO: KP: Remove hardcoding
                UpdateCommand.CommandText = "pICAS_Exam_Schedule_Update";
                ExecuteStoredProcedure(UpdateCommand);
                ReturnValue = int.Parse(UpdateCommand.Parameters[0].Value.ToString());
            }
            return(ReturnValue);
        }
Example #9
0
 public static int DeleteExamSedhule(ObjExamSehedules theSedhule)
 {
     return(ExamScheduleDataAccess.GetInstance.DeleteExamSedhule(theSedhule));
 }
Example #10
0
 public int DeleteSchedules(ObjExamSehedules theSehedules)
 {
     return(ExamScheduleIntegration.DeleteExamSedhule(theSehedules));
 }
Example #11
0
 public int InsertSchedules(ObjExamSehedules theSehedules)
 {
     return(ExamScheduleIntegration.InsertExamSedhule(theSehedules));
 }