public bool CancelGRN(Guid GRNId, string TrackingNo, RequestforApprovedGRNCancelationStatus status) { bool isSaved = false; GRNBLL objGRN = new GRNBLL(); objGRN = objGRN.GetbyGRN_Number(GRNId); GRNStatus GRNstatus = (GRNStatus)objGRN.Status; if (status == RequestforApprovedGRNCancelationStatus.Cancelled) { GRNstatus = GRNStatus.Cancelled; } if (objGRN != null) { if (GRNstatus == GRNStatus.Cancelled) { isSaved = objGRN.Update(objGRN.GRN_Number, GRNstatus, objGRN, TrackingNo, DateTime.Now); } if (isSaved == true) { ECXWF.CMessage mess = WFTransaction.Request(TrackingNo); WFTransaction.WorkFlowManager(TrackingNo, mess); isSaved = true; } } else { throw new Exception("Unable to find GRN"); } return(isSaved); }
protected void btnAdd_Click(object sender, EventArgs e) { if (this.cboStatus.SelectedValue == "6")// need to consume the webservice. { bool isSaved = false; GRNBLL objGRN = new GRNBLL(); objGRN = objGRN.GetbyGRN_Number(new Guid(this.hfGRNId.Value.ToString())); objGRN.ApprovedTimeStamp = DateTime.Now; objGRN.TrackingNo = this.lblCurrentTrackingNo.Text; objGRN.ManagerApprovedDateTime = DateTime.Parse(this.txtMADate.Text + " " + this.txtTime.Text); isSaved = objGRN.Update(this.lblGRN.Text, (GRNStatus)int.Parse(this.cboStatus.SelectedValue), objGRN, objGRN.TrackingNo, objGRN.ManagerApprovedDateTime); if (isSaved == true) { this.lblmsg.Text = "GRN Updated Successfully"; LoadGRNInformation(new Guid(this.hfGRNId.Value.ToString())); Response.Redirect("ListInbox.aspx"); } else { this.lblmsg.Text = "Can not update the GRN."; } } else if (this.cboStatus.SelectedValue == "3") { GRNBLL objGRN = new GRNBLL(); objGRN = objGRN.GetbyGRN_Number(new Guid(this.hfGRNId.Value.ToString())); bool isSaved = objGRN.Update(objGRN.GRN_Number, GRNStatus.Cancelled, objGRN, objGRN.TrackingNo, objGRN.ManagerApprovedDateTime); if (isSaved == false) { this.lblmsg.Text = "Can not update the GRN."; return; } else { this.lblmsg.Text = "GRN Cancelled."; } } }
protected void btnCancel_Click(object sender, EventArgs e) { bool isSaved = false; GRNBLL objGRN = new GRNBLL(); string TrackingNo = ""; TrackingNo = this.hfTrackingNo.Value; objGRN.GRN_Number = this.UIEditGRN1.lblGRN.Text; objGRN.Id = new Guid(this.UIEditGRN1.hfGRNId.Value.ToString()); objGRN.GradingId = new Guid(this.UIEditGRN1.hfGradingId.Value.ToString()); isSaved = objGRN.Update(this.UIEditGRN1.lblGRN.Text, GRNStatus.Cancelled, objGRN, TrackingNo, DateTime.Now); if (isSaved == true) { this.UIEditGRN1.lblmsg.Text = "Update Sucessfull"; this.btnCancel.Enabled = false; return; } else { this.UIEditGRN1.lblmsg.Text = "Unable to cancel the GRN."; return; } }