コード例 #1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int  Sid        = int.Parse(grdWorkShopRequest.DataKeys[grdWorkShopRequest.SelectedIndex].Values["UserId"].ToString());
        int  Wid        = int.Parse(grdWorkShopRequest.DataKeys[grdWorkShopRequest.SelectedIndex].Values["WorkShopId"].ToString());
        bool IsAppOrRej = bool.Parse(rblApproveReject.SelectedValue.ToString());

        tbl_Student_WorkShop_Mapping swp = new tbl_Student_WorkShop_Mapping();

        swp.StudentId  = Sid;
        swp.WorkShopId = Wid;
        swp.IsApproved = IsAppOrRej;

        WorkshopBusiness WB = new WorkshopBusiness();

        WB.AppOrRejectWorkshopRequest(swp);
        GetWorkShopRequest();
    }
コード例 #2
0
 public bool AppOrRejectWorkshopRequest(tbl_Student_WorkShop_Mapping swp)
 {
     try
     {
         string        cmdStr = @"Update tbl_Student_WorkShop_Mapping 
                                         Set IsApproved=@IsApproved
                                         where  WorkShopId=@WorkShopId and StudentId=@StudentId";
         SqlConnection con    = new SqlConnection(conStr);
         SqlCommand    cmd    = new SqlCommand(cmdStr, con);
         cmd.Parameters.AddWithValue("@IsApproved", swp.IsApproved == true ? 1 : 0);
         cmd.Parameters.AddWithValue("@WorkShopId", swp.WorkShopId);
         cmd.Parameters.AddWithValue("@StudentId", swp.StudentId);
         con.Open();
         cmd.ExecuteNonQuery();
         con.Close();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
コード例 #3
0
 public bool AppOrRejectWorkShopRequest(tbl_Student_WorkShop_Mapping swp)
 {
     return(WD.AppOrRejectWorkShopRequest(swp));
 }