private void IssueGRN() { DateTime DeliveryDate = Convert.ToDateTime(txtDeliveryDate.Text); ERPConfig clsERPConfig = new ERPConfig(); ERPConfigDetails clsERPConfigDetails = clsERPConfig.Details(); clsERPConfig.CommitAndDispose(); if (clsERPConfigDetails.PostingDateFrom <= DeliveryDate && clsERPConfigDetails.PostingDateTo >= DeliveryDate) { long TransferOutID = Convert.ToInt64(lblTransferOutID.Text); string SupplierDRNo = txtSupplierDRNo.Text; TransferOut clsTransferOut = new TransferOut(); clsTransferOut.IssueGRN(TransferOutID, SupplierDRNo, DeliveryDate); clsTransferOut.CommitAndDispose(); string stParam = "?task=" + Common.Encrypt("list", Session.SessionID) + "&TransferOutid=" + Common.Encrypt(TransferOutID.ToString(), Session.SessionID); Response.Redirect("Default.aspx" + stParam); } else { string stScript = "<Script>"; stScript += "window.alert('Sorry you cannot post using the delivery date: " + txtDeliveryDate.Text + ". Please enter an allowable posting date.')"; stScript += "</Script>"; Response.Write(stScript); } }