Esempio n. 1
0
        //saveData
        #region [Save Data]

        protected void btnSave_Click(object sender, EventArgs e)
        {
            BL_Subject  objBL  = new BL_Subject();
            EWA_Subject objEWA = new EWA_Subject();

            try
            {
                lock (this)
                {
                    if (txtSubject.Text == "")
                    {
                        // msgBox.ShowMessage("Please Enter Document Name !!!", "Information", UserControls.MessageBox.MessageStyle.Information);
                    }

                    else
                    {
                        Action("Save");
                        // Page.Response.Redirect(HttpContext.Current.Request.Url.ToString(), true);
                    }
                }
            }

            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Esempio n. 2
0
        //Subjects Grid Bind
        #region [Subject Grid Bind]

        private void GrdSubjectBind()
        {
            try
            {
                EWA_Subject objEWA = new EWA_Subject();
                objEWA.ClassId = Convert.ToInt32(ddlClass.SelectedValue);
                DataSet ds = objBL.SubjectGridBind_BL(objEWA);
                GrdSubject.DataSource = ds;
                GrdSubject.DataBind();
            }

            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Esempio n. 3
0
        //To Call Subjects Grid Bind
        #region [Subjects Grid Bind]

        public System.Data.DataSet SubjectGridBind_BL(EWA_Subject objEWA)
        {
            try
            {
                DL_Subject objDL = new DL_Subject();
                DataSet    ds    = objDL.BindSubjectGrid_DL(objEWA);
                return(ds);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                objDL = null;
            }
        }
Esempio n. 4
0
        //Insert Update Delete operaeion on Subject Table
        #region [Action Performed For Subject]

        public int SubjectAction_BL(EWA_Subject objEWA)
        {
            //  DL_Documents objDL = new DL_Documents();
            try
            {
                int flag = objDL.SubjectAction_DL(objEWA);
                return(flag);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                objDL = null;
            }
        }
Esempio n. 5
0
        //To Perform Insert,Update,Delete and Search Actions On Subject Table
        #region [Perform Actions On Subject]

        public int SubjectAction_DL(EWA_Subject objEWA)
        {
            try
            {
                cmd             = new SqlCommand("SP_Subject", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@Action", objEWA.Action);
                cmd.Parameters.AddWithValue("@SubjectId", objEWA.SubjectId);
                cmd.Parameters.AddWithValue("@SubjectName", objEWA.SubjectName);
                cmd.Parameters.AddWithValue("@SubjectCode", objEWA.SubjectCode);
                cmd.Parameters.AddWithValue("@CourseId", objEWA.CourseId);
                cmd.Parameters.AddWithValue("@BranchId", objEWA.BranchId);
                cmd.Parameters.AddWithValue("@ClassId", objEWA.ClassId);
                //cmd.Parameters.AddWithValue("@SemesterId", objEWA.SemesterId);
                cmd.Parameters.AddWithValue("@OrgId", objEWA.OrgId);
                cmd.Parameters.AddWithValue("@AcademicYearId", objEWA.AcademicYearId);
                cmd.Parameters.AddWithValue("@UserId", objEWA.UserId);
                cmd.Parameters.AddWithValue("@IsActive", objEWA.IsActive);
                con.Open();
                int flag = cmd.ExecuteNonQuery();
                con.Close();
                return(flag);
            }
            catch (Exception ex)
            {
                int err = ((System.Data.SqlClient.SqlException)(ex)).Number;
                if (err == 547 && objEWA.Action == "Delete")
                {
                    throw new SystemException("Record is in use !!!");
                }
                else
                {
                    throw ex;
                }
            }
            finally
            {
                con.Close();
                cmd.Dispose();
            }
        }
Esempio n. 6
0
        //To Bind SubjectGrid
        #region [Bind Subject Grid]

        public DataSet BindSubjectGrid_DL(EWA_Subject objEWA)
        {
            DataSet ds = new DataSet();

            try
            {
                prmList    = new string[4];
                prmList[0] = "@Action";
                prmList[1] = "SelectData";
                prmList[2] = "@ClassId";
                prmList[3] = objEWA.ClassId.ToString();

                ds = ObjHelper.FillControl(prmList, "SP_Subject");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    return(ds);
                }
                else
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add("SubjectId");
                    dt.Columns.Add("SubjectCode");
                    dt.Columns.Add("SubjectName");

                    dt.Rows.Add();
                    dt.Rows.Add();
                    dt.Rows.Add();
                    //return dsCode;
                }
                return(ds);
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }