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) { Int64 WBranchTransferID = Convert.ToInt64(lblWBranchTransferID.Text); string ReceivedBy = txtReceivedBy.Text; WBranchTransfer clsWBranchTransfer = new WBranchTransfer(); clsWBranchTransfer.IssueGRN(WBranchTransferID, ReceivedBy, DeliveryDate); clsWBranchTransfer.CommitAndDispose(); string stParam = "?task=" + Common.Encrypt("list",Session.SessionID) + "&WBranchTransferID=" + Common.Encrypt(WBranchTransferID.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); } }