protected void BtnSave_Click(object sender, EventArgs e) { int UpdateRow = 0; for (int j = 0; j < GrdReqPO.Rows.Count; j++) { if ((GrdReqPO.Rows[j].Cells[8].Text) == "Approved") { Entity_PurchaseOrder.POId = Convert.ToInt32(GrdReqPO.Rows[j].Cells[9].Text.ToString()); Entity_PurchaseOrder.POStatus = "Approved"; Entity_PurchaseOrder.ApprovedTime = DateTime.Now; Entity_PurchaseOrder.UserId = Convert.ToInt32(Session["UserID"]); Entity_PurchaseOrder.LoginDate = DateTime.Now; UpdateRow = Obj_EditPO.UpdatePurchase_OrderStatus_Approved(ref Entity_PurchaseOrder, out StrError); ((ImageButton)GrdReqPO.Rows[j].FindControl("ImageCancel")).Visible = false; ((ImageButton)GrdReqPO.Rows[j].FindControl("ImageAuthorised")).Visible = true; } if ((GrdReqPO.Rows[j].Cells[8].Text) == "Authorised") { Entity_PurchaseOrder.POId = Convert.ToInt32(GrdReqPO.Rows[j].Cells[9].Text.ToString()); Entity_PurchaseOrder.POStatus = "Authorised"; Entity_PurchaseOrder.AuthorizedTime = DateTime.Now; Entity_PurchaseOrder.UserId = Convert.ToInt32(Session["UserID"]); Entity_PurchaseOrder.LoginDate = DateTime.Now; UpdateRow = Obj_EditPO.UpdatePurchase_OrderStatus_Authroized(ref Entity_PurchaseOrder, out StrError); ((ImageButton)GrdReqPO.Rows[j].FindControl("ImageSuccess")).Visible = true; ((ImageButton)GrdReqPO.Rows[j].FindControl("ImageAuthorised")).Visible = false; ((ImageButton)GrdReqPO.Rows[j].FindControl("ImageCancel")).Visible = false; //SendMail(Convert.ToInt32(GrdReqPO.Rows[j].Cells[9].Text.ToString())); } } MakeEmptyForm(); GETHIGHLITE(); ScriptManager.RegisterStartupScript(this, GetType(), "ShowPOP", "javascript:HidePOP();", true); }
private void GetConfirm() { string RequestFor = string.Empty; string RequestBY = string.Empty; string StrError = string.Empty; int RequestID = 0; DateTime RequestDate = DateTime.Now; int LoginID = 0; DateTime LoginDate = DateTime.Now; RequestFor = Convert.ToString(Request.QueryString["for"].ToString()); RequestID = Convert.ToInt32(Request.QueryString["request"].ToString()); RequestBY = Convert.ToString(Request.QueryString["by"].ToString()); DMUserLogin obj_Login = new DMUserLogin(); DataSet dsLogin = obj_Login.GetLoginIDFORMAILREQUEST(RequestBY, out StrError); if (dsLogin.Tables.Count > 0 && dsLogin.Tables[0].Rows.Count > 0) { LoginID = Convert.ToInt32(dsLogin.Tables[0].Rows[0]["UserId"].ToString()); if (RequestFor == "Req") { DMApproveRequisition Obj_ApproveRequisition = new DMApproveRequisition(); ApproveRequisition Entity_ApproveRequisition = new ApproveRequisition(); Entity_ApproveRequisition.RequisitionCafeId = Convert.ToInt32(RequestID); Entity_ApproveRequisition.ReqStatus = "Authorised"; Entity_ApproveRequisition.AuthorizedTime = DateTime.Now; Entity_ApproveRequisition.UserId = LoginID; Entity_ApproveRequisition.LoginDate = DateTime.Now; int UpdateRow = Obj_ApproveRequisition.UpdateReq_Status_Authorozed(ref Entity_ApproveRequisition, out StrError); if (UpdateRow > 0) { SendMailREQ(RequestID); LblPass.Text = "Requisition Has Been Successfully Authorized.."; } else { LblPass.Text = "Requisition Not Authorize Please Try After Some Time.."; } } else { DMEditPurchaseOrder Obj_EditPO = new DMEditPurchaseOrder(); EditPurchaseOrder Entity_PurchaseOrder = new EditPurchaseOrder(); Entity_PurchaseOrder.POId = Convert.ToInt32(RequestID); Entity_PurchaseOrder.POStatus = "Authorised"; Entity_PurchaseOrder.AuthorizedTime = DateTime.Now; Entity_PurchaseOrder.UserId = LoginID; Entity_PurchaseOrder.LoginDate = DateTime.Now; int UpdateRow = Obj_EditPO.UpdatePurchase_OrderStatus_Authroized(ref Entity_PurchaseOrder, out StrError); if (UpdateRow > 0) { SendMail(RequestID); LblPass.Text = "Purchase Order Has Been Successfully Authorized.."; } else { LblPass.Text = "Purchase Order Not Authorize Please Try After Some Time.."; } } } }