Ejemplo n.º 1
0
        protected void gv_Students_RowCommand(object sender, GridViewCommandEventArgs e)

        {
            Achievement    selTD = new Achievement();
            AchievementDAO updTD = new AchievementDAO();
            int            updCnt;
            String         Status        = "delete";
            int            AchievementId = Convert.ToInt32(e.CommandArgument.ToString());

            if (e.CommandName == "Delete")
            {
                updCnt = updTD.delete(AchievementId, LblAdminNo.Text, Status);
                if (updCnt == 1)
                {
                    Response.Redirect("AchievementPage.aspx");
                }
            }

            else if (e.CommandName == "Edit")

            {
                Session["SSAchievementId"] = Convert.ToInt32(e.CommandArgument.ToString());
                Response.Redirect("EditAchievement.aspx");
            }
        }
Ejemplo n.º 2
0
        protected void BtnConfirm_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TbAchievementName.Text) || string.IsNullOrEmpty(TbAyearTaken.Text))
            {
                LblResult.Text = "pls fill in all the blank";
            }
            else
            {
                String         Status          = "active";
                String         AdminNo         = lbAdminNo.Text.ToString();
                String         AchievementName = TbAchievementName.Text.ToString();
                int            AyearTaken      = Convert.ToInt32(TbAyearTaken.Text.ToString());
                AchievementDAO fmTd            = new AchievementDAO();
                int            insCnt          = fmTd.InsertTD(AchievementName, AyearTaken, AdminNo, Status);
                if (insCnt == 1)
                {
                    LblResult.Text = "Achievement Created!";
                    Response.Redirect("AchievementPage.aspx");
                }
                else
                {
                    LblResult.Text = "Unable to insert Achievement, please inform system administrator!";
                }
                BtnConfirm.Enabled = false;
            }
            // complete the code

            /*
             * try
             * {
             *  int tdRenewMode = Convert.ToInt16(DdlRenew.SelectedValue);
             *  timeDepositDAO fmTd = new timeDepositDAO();
             *  int insCnt = fmTd.InsertTD(tdAccount, tdCustId, tdPrincipal, tdTerm, tdIntRte, tdMaturityDte, tdMaturedAmt, tdInterest, tdRenewMode);
             *  if (insCnt == 1)
             *  {
             *      LblResult.Text = "Time Deposit Created!";
             *  }
             *  else
             *  {
             *      LblResult.Text = "Unable to insert time deposit, please inform system administrator!";
             *
             *  }
             *  BtnConfirm.Enabled = false;
             *
             * }
             * catch (FormatException)
             * {
             *  LblResult.Text = "Select a renewal option!";
             * }
             */
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["SSAchievementId"] != null)
         {
             int AchievementId = Convert.ToInt32(Session["SSAchievementId"]);
             LblAchievementId.Text = AchievementId.ToString();
             Achievement    selTD = new Achievement();
             AchievementDAO updTD = new AchievementDAO();
             selTD = updTD.getAchievementById(AchievementId);
         }
     }
 }
Ejemplo n.º 4
0
        protected void BtnUpdate(object sender, EventArgs e)
        {
            int            AchievementId = Convert.ToInt32(Session["SSAchievementId"]);
            Achievement    selTD         = new Achievement();
            AchievementDAO updTD         = new AchievementDAO();
            int            AyearTaken    = Convert.ToInt32(TbAyearTaken.Text.ToString());
            int            updCnt;

            updCnt = updTD.Edit(AchievementId, TbAchievementName.Text, AyearTaken);
            if (string.IsNullOrEmpty(TbAchievementName.Text) || string.IsNullOrEmpty(TbAyearTaken.Text))
            {
                LblResult.Text = "pls fill in all the blank";
            }
            else
            {
                if (updCnt == 1)
                {
                    Response.Redirect("AchievementPage.aspx");
                }
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //LblAdminNo.Text = Session["SSAdminNo"].ToString();
            //String adminNo = LblAdminNo.Text.ToString();
            //string DBConnect = ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
            //SqlConnection myConn = new SqlConnection(DBConnect);
            //SqlCommand cmd1 = new SqlCommand("select * from Achievement where AdminNo = adminNo", myConn);
            //SqlDataAdapter sda1 = new SqlDataAdapter(cmd1);
            //DataTable dt = new DataTable();
            //sda1.Fill(dt);
            //GridView_Achievement.DataSource = dt;
            //GridView_Achievement.DataBind();

            LblAdminNo.Text = Session["AdminNo"].ToString();
            String             adminNo = LblAdminNo.Text.ToString();
            AchievementDAO     tdDAO   = new AchievementDAO();
            List <Achievement> tdList  = new List <Achievement>();

            tdList = tdDAO.getAchievement(LblAdminNo.Text);
            GridView_Achievement.DataSource = tdList;
            GridView_Achievement.DataBind();
            LblAdminNo.Visible = false;
        }