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 POID = Convert.ToInt64(lblPOID.Text); string SupplierDRNo = txtSupplierDRNo.Text; PO clsPO = new PO(); clsPO.IssueGRN(POID, SupplierDRNo, DeliveryDate); clsPO.CommitAndDispose(); //string stParam = "?task=" + Common.Encrypt("list",Session.SessionID) + "&poid=" + Common.Encrypt(POID.ToString(),Session.SessionID); //Response.Redirect("Default.aspx" + stParam); BackToPOList(); } 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); } }