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(); }
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); } }
public bool AppOrRejectWorkShopRequest(tbl_Student_WorkShop_Mapping swp) { return(WD.AppOrRejectWorkShopRequest(swp)); }