Пример #1
0
 protected void btnSaveNewMainCourse_Click(object sender, EventArgs e)
 {
     try
     {
         int    resultNo   = 0;
         string resultDesc = string.Empty;
         obj_MC             = new clsManageMasterTables();
         obj                = new TBL_MAIN_COURSE();
         obj.MAIN_COURSE_ID = 0;
         obj.COURSE_NAME    = txtMainCourseName.Text;
         obj.COURSE_DESC    = txtMainCourseDesc.Text;
         obj.CREATED_ON     = DbConnect.GetCurrentDateTimeIndia();
         obj.CREATED_BY     = 1000000001;
         obj.MODIFIED_ON    = DbConnect.GetCurrentDateTimeIndia();
         obj.MODIFIED_BY    = 1000000001;
         obj.PURGEFLAG      = "A";
         obj_MC.MainCourseInsertUpdate(obj, out resultNo, out resultDesc);
         Response.Write(resultDesc);
         Bind_grdMainCourse();
         txtMainCourseDesc.Text = txtMainCourseName.Text = string.Empty;
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message);
     }
 }
Пример #2
0
    protected void grdMainCourse_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridViewRow row = grdMainCourse.Rows[e.RowIndex];
        TextBox     txtMainCourseNameGRD = (TextBox)row.FindControl("txtMainCourseNameGRD");
        TextBox     txtMainCourseDescGRD = (TextBox)row.FindControl("txtMainCourseDescGRD");

        int    resultNo   = 0;
        string resultDesc = string.Empty;

        obj_MC             = new clsManageMasterTables();
        obj                = new TBL_MAIN_COURSE();
        obj.MAIN_COURSE_ID = Convert.ToInt32(grdMainCourse.DataKeys[e.RowIndex].Value.ToString());
        obj.COURSE_NAME    = txtMainCourseNameGRD.Text;
        obj.COURSE_DESC    = txtMainCourseDescGRD.Text;
        obj.CREATED_ON     = DbConnect.GetCurrentDateTimeIndia();
        obj.CREATED_BY     = 1000000001;
        obj.MODIFIED_ON    = DbConnect.GetCurrentDateTimeIndia();
        obj.MODIFIED_BY    = 1000000001;
        obj.PURGEFLAG      = "A";
        obj_MC.MainCourseInsertUpdate(obj, out resultNo, out resultDesc);
        Response.Write(resultDesc);
        Bind_grdMainCourse();
        txtMainCourseDesc.Text = txtMainCourseName.Text = string.Empty;

        grdMainCourse.EditIndex = -1;
        Bind_grdMainCourse();
    }
Пример #3
0
    protected void chkPURGEFLAG_OnCheckedChanged(object sender, EventArgs e)
    {
        CheckBox    chkPURGEFLAG  = (CheckBox)sender;
        GridViewRow row           = (GridViewRow)chkPURGEFLAG.NamingContainer;
        HiddenField hdnfPurgeFlag = (HiddenField)row.FindControl("hdnfPurgeFlag");
        int         rowindex      = row.RowIndex;

        int    resultNo   = 0;
        string resultDesc = string.Empty;

        obj_MC             = new clsManageMasterTables();
        obj                = new TBL_MAIN_COURSE();
        obj.MAIN_COURSE_ID = Convert.ToInt32(grdMainCourse.DataKeys[rowindex].Value.ToString());
        obj.CREATED_ON     = DbConnect.GetCurrentDateTimeIndia();
        obj.MODIFIED_ON    = DbConnect.GetCurrentDateTimeIndia();
        obj.MODIFIED_BY    = 1000000001;
        if (chkPURGEFLAG.Checked)
        {
            obj.PURGEFLAG = "A";
        }
        else
        {
            obj.PURGEFLAG = "I";
        }
        obj_MC.MainCourseInsertUpdate(obj, out resultNo, out resultDesc);
        Response.Write(resultDesc);
        Bind_grdMainCourse();
        txtMainCourseDesc.Text = txtMainCourseName.Text = string.Empty;

        grdMainCourse.EditIndex = -1;
        Bind_grdMainCourse();
    }
 public void MainCourseInsertUpdate(TBL_MAIN_COURSE obj)
 {
     DB.ExecScalerSP_Object(CommandType.StoredProcedure, "USP_TBL_MAIN_COURSE_InsertUpdate",
                            new SqlParameter("@MAIN_COURSE_ID", obj.MAIN_COURSE_ID),
                            new SqlParameter("@COURSE_NAME", obj.COURSE_NAME),
                            new SqlParameter("@COURSE_DESC", obj.COURSE_DESC),
                            new SqlParameter("@CREATED_ON", obj.CREATED_ON),
                            new SqlParameter("@CREATED_BY", obj.CREATED_BY),
                            new SqlParameter("@MODIFIED_ON", obj.MODIFIED_ON),
                            new SqlParameter("@MODIFIED_BY", obj.MODIFIED_BY),
                            new SqlParameter("@PURGEFLAG", obj.PURGEFLAG));
     CloseAll();
 }
        public void MainCourseInsertUpdate(TBL_MAIN_COURSE obj, out int resultNo, out string resultDesc)
        {
            SqlParameter resultNoSQL = new SqlParameter("@RESULT_NO", SqlDbType.Int, 100);

            resultNoSQL.Direction = ParameterDirection.Output;
            SqlParameter resultDescSQL = new SqlParameter("@RESULT_DESC", SqlDbType.NVarChar, 2000);

            resultDescSQL.Direction = ParameterDirection.Output;

            DB.ExecScalerSP_Object(CommandType.StoredProcedure, "USP_TBL_MAIN_COURSE_InsertUpdate",
                                   new SqlParameter("@MAIN_COURSE_ID", obj.MAIN_COURSE_ID),
                                   new SqlParameter("@COURSE_NAME", obj.COURSE_NAME),
                                   new SqlParameter("@COURSE_DESC", obj.COURSE_DESC),
                                   new SqlParameter("@CREATED_ON", obj.CREATED_ON),
                                   new SqlParameter("@CREATED_BY", obj.CREATED_BY),
                                   new SqlParameter("@MODIFIED_ON", obj.MODIFIED_ON),
                                   new SqlParameter("@MODIFIED_BY", obj.MODIFIED_BY),
                                   new SqlParameter("@PURGEFLAG", obj.PURGEFLAG),
                                   resultNoSQL, resultDescSQL);
            resultNo   = Convert.ToInt32(resultNoSQL.Value.ToString());
            resultDesc = resultDescSQL.Value.ToString();
            CloseAll();
        }