예제 #1
0
        /// <summary>
        /// To Insert details of TimeTable in tbl_TimeTable_T table
        /// Created By : Darshan, 09/16/2014
        /// Modified By :
        /// </summary>
        /// <param name="objTimeTableBO"></param>
        /// <returns></returns>
        public ApplicationResult TimeTable_Insert(TimeTableBO objTimeTableBO, int intClassMID, int intDivisionTID, int intLastModifiedUserID, string strLastModifiedDate)
        {
            try
            {
                pSqlParameter = new SqlParameter[7];


                pSqlParameter[0]           = new SqlParameter("@PeriodID", SqlDbType.Int);
                pSqlParameter[0].Direction = ParameterDirection.Input;
                pSqlParameter[0].Value     = objTimeTableBO.PeriodID;

                pSqlParameter[1]           = new SqlParameter("@SubjectMID", SqlDbType.Int);
                pSqlParameter[1].Direction = ParameterDirection.Input;
                pSqlParameter[1].Value     = objTimeTableBO.SubjectMID;

                pSqlParameter[2]           = new SqlParameter("@EmployeeMID", SqlDbType.Int);
                pSqlParameter[2].Direction = ParameterDirection.Input;
                pSqlParameter[2].Value     = objTimeTableBO.EmployeeMID;

                pSqlParameter[3]           = new SqlParameter("@ClassMID", SqlDbType.Int);
                pSqlParameter[3].Direction = ParameterDirection.Input;
                pSqlParameter[3].Value     = intClassMID;

                pSqlParameter[4]           = new SqlParameter("@DivisionTID", SqlDbType.Int);
                pSqlParameter[4].Direction = ParameterDirection.Input;
                pSqlParameter[4].Value     = intDivisionTID;

                pSqlParameter[5]           = new SqlParameter("@LastModifiedUserID", SqlDbType.Int);
                pSqlParameter[5].Direction = ParameterDirection.Input;
                pSqlParameter[5].Value     = intLastModifiedUserID;

                pSqlParameter[6]           = new SqlParameter("@LastModifiedDate", SqlDbType.VarChar);
                pSqlParameter[6].Direction = ParameterDirection.Input;
                pSqlParameter[6].Value     = strLastModifiedDate;

                sSql = "usp_tbl_TimeTable_T_Insert";
                int iResult = Database.ExecuteNonQuery(CommandType.StoredProcedure, sSql, pSqlParameter);

                if (iResult > 0)
                {
                    ApplicationResult objResults = new ApplicationResult();
                    objResults.status = ApplicationResult.CommonStatusType.SUCCESS;
                    return(objResults);
                }
                else
                {
                    ApplicationResult objResults = new ApplicationResult();
                    objResults.status = ApplicationResult.CommonStatusType.FAILURE;
                    return(objResults);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objTimeTableBO = null;
            }
        }
예제 #2
0
 protected void btnSaveClass_OnClick(object sender, EventArgs e)
 {
     try
     {
         ApplicationResult objResult      = new ApplicationResult();
         TimeTableBO       objTimeTableBo = new TimeTableBO();
         TimeTableBL       objTimeTableBl = new TimeTableBL();
         for (int i = 1; i <= Convert.ToInt32(hfNoOfPeriod.Value); i++)
         {
             Label        lbl  = Page.Master.FindControl("ContentPlaceHolder1").FindControl("lblPeriod" + i.ToString()) as Label;
             DropDownList ddl1 = Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlSubject" + i.ToString()) as DropDownList;
             DropDownList ddl2 = Page.Master.FindControl("ContentPlaceHolder1").FindControl("ddlTeacher" + i.ToString()) as DropDownList;
             objTimeTableBo.PeriodID    = Convert.ToInt32(lbl.Text);
             objTimeTableBo.SubjectMID  = Convert.ToInt32(ddl1.SelectedValue);
             objTimeTableBo.EmployeeMID = Convert.ToInt32(ddl2.SelectedValue);
             objResult = objTimeTableBl.TimeTable_Insert(objTimeTableBo, Convert.ToInt32(ddlClass.SelectedValue),
                                                         Convert.ToInt32(ddlDivision.SelectedValue),
                                                         Convert.ToInt32(Session[ApplicationSession.USERID].ToString()),
                                                         DateTime.UtcNow.AddHours(5.5).ToString());
         }
         BindTimeTable();
         PanelVisibility(1);
         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Record saved successfully.');</script>");
     }
     catch (Exception ex)
     {
         logger.Error("Error", ex);
         ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
     }
 }
예제 #3
0
        /// <summary>
        /// To Update details of TimeTable in tbl_TimeTable_T table
        /// Created By : Darshan, 09/16/2014
        /// Modified By :
        /// </summary>
        /// <param name="objTimeTableBO"></param>
        /// <returns></returns>
        public ApplicationResult TimeTable_Update(TimeTableBO objTimeTableBO)
        {
            try
            {
                pSqlParameter = new SqlParameter[5];


                pSqlParameter[0]           = new SqlParameter("@TimeTableTID", SqlDbType.Int);
                pSqlParameter[0].Direction = ParameterDirection.Input;
                pSqlParameter[0].Value     = objTimeTableBO.TimeTableTID;

                pSqlParameter[1]           = new SqlParameter("@TimeTableMID", SqlDbType.Int);
                pSqlParameter[1].Direction = ParameterDirection.Input;
                pSqlParameter[1].Value     = objTimeTableBO.TimeTableMID;

                pSqlParameter[2]           = new SqlParameter("@PeriodID", SqlDbType.Int);
                pSqlParameter[2].Direction = ParameterDirection.Input;
                pSqlParameter[2].Value     = objTimeTableBO.PeriodID;

                pSqlParameter[3]           = new SqlParameter("@SubjectMID", SqlDbType.Int);
                pSqlParameter[3].Direction = ParameterDirection.Input;
                pSqlParameter[3].Value     = objTimeTableBO.SubjectMID;

                pSqlParameter[4]           = new SqlParameter("@EmployeeMID", SqlDbType.Int);
                pSqlParameter[4].Direction = ParameterDirection.Input;
                pSqlParameter[4].Value     = objTimeTableBO.EmployeeMID;


                sSql = "usp_tbl_TimeTable_T_Update";
                int iResult = Database.ExecuteNonQuery(CommandType.StoredProcedure, sSql, pSqlParameter);

                if (iResult > 0)
                {
                    ApplicationResult objResults = new ApplicationResult();
                    objResults.status = ApplicationResult.CommonStatusType.SUCCESS;
                    return(objResults);
                }
                else
                {
                    ApplicationResult objResults = new ApplicationResult();
                    objResults.status = ApplicationResult.CommonStatusType.FAILURE;
                    return(objResults);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objTimeTableBO = null;
            }
        }