protected void gvBids_RowCommand(object sender, GridViewCommandEventArgs e) { GridViewRow gvr = ((Control)e.CommandSource).NamingContainer as GridViewRow; switch (e.CommandName) { case "ViewBidEventDetails": { Session[Constant.SESSION_BIDREFNO] = e.CommandArgument.ToString(); Response.Redirect("biddetails.aspx"); } break; case "ViewBidItemDetails": { string[] args = e.CommandArgument.ToString().Split(new char[] { '|' }); Session[Constant.SESSION_BIDDETAILNO] = args[1]; Session[Constant.SESSION_BIDREFNO] = args[0]; Response.Redirect("withdrawnbiditemdetails.aspx"); } break; case "Approve": { int biddetailno = int.Parse(e.CommandArgument.ToString()); if (BidItemTransaction.WithdrawBidItem(connstring, biddetailno, Constant.BIDITEM_STATUS.WITHDRAWAL_STATUS.WITHDRAWNED)) { Response.Redirect("withdrawnedbiditems.aspx"); } } break; } }
protected void lnkWithdraw_Click(object sender, EventArgs e) { if (Session[Constant.SESSION_BIDDETAILNO] != null) { int biddetailno = int.Parse(Session[Constant.SESSION_BIDDETAILNO].ToString()); if (BidItemTransaction.WithdrawBidItem(connstring, biddetailno, Constant.BIDITEM_STATUS.WITHDRAWAL_STATUS.APPROVED)) { GetAllVendorsInfoByBidRef(biddetailno); SendEmailToVendors(); Response.Redirect("withdrawnedbiditems.aspx"); } } }
protected void gvBidItemDetails_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "withdraw": { GridViewRow row = ((Control)e.CommandSource).NamingContainer as GridViewRow; Panel tmp_pnlcommand = (Panel)row.FindControl("pnlLinks"); Panel tmp_pnlcomment = (Panel)row.FindControl("pnlComments"); tmp_pnlcommand.Visible = false; tmp_pnlcomment.Visible = true; } break; case "continuewithdraw": { if (BidItemTransaction.WithdrawBidItem(connstring, int.Parse(e.CommandArgument.ToString()), Constant.BIDITEM_STATUS.WITHDRAWAL_STATUS.WITHDRAWNED)) { GridViewRow row = ((Control)e.CommandSource).NamingContainer as GridViewRow; TextBox tmp_txtComment = (TextBox)row.FindControl("txtComment"); CheckBox tmp_chkBox = (CheckBox)row.FindControl("chkAlowVendorView"); InsertWithdrawnedItemComments(int.Parse(e.CommandArgument.ToString()), tmp_txtComment.Text.ToString().Trim(), Session[Constant.SESSION_USERID].ToString(), tmp_chkBox.Checked); GetAllVendorsInfoByBidRef(int.Parse(e.CommandArgument.ToString())); SendEmailToVendors(); #region Dev Richard - Send SMS Notification ArrayList recipients = GetSelectedSuppliers(); GridViewRow lblItemRow = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Label lblItem = (Label)gvBidItemDetails.Rows[row.RowIndex].FindControl("lblItem"); for (int a = 0; a < recipients.Count; a++) { BidParticipant p = (BidParticipant)recipients[a]; String mobileNo = p.MobileNo; if (SMSHelper.AreValidMobileNumbers(mobileNo.Trim())) { String textMessage = "“We wish to inform you that '" + lblItem.Text + "' has been withdrawn. Kindly go to your portal account under Withdrawn bid Items for details.”"; try { SMSHelper.SendSMS(new SMSMessage(textMessage, mobileNo)); } catch { } } } #endregion Response.Redirect("withdrawnedbiditems.aspx"); } } break; case "cancelwithdraw": { GridViewRow row = ((Control)e.CommandSource).NamingContainer as GridViewRow; Panel tmp_pnlcommand = (Panel)row.FindControl("pnlLinks"); Panel tmp_pnlcomment = (Panel)row.FindControl("pnlComments"); TextBox tmp_txtComment = (TextBox)row.FindControl("txtComment"); tmp_pnlcommand.Visible = true; tmp_pnlcomment.Visible = false; tmp_txtComment.Text = ""; } break; } }