Exemplo n.º 1
0
		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 BranchTransferID = Convert.ToInt64(lblBranchTransferID.Text);
				string ReceivedBy = txtReceivedBy.Text;

				BranchTransfer clsBranchTransfer = new BranchTransfer();
				clsBranchTransfer.IssueGRN(BranchTransferID, ReceivedBy, DeliveryDate);
				clsBranchTransfer.CommitAndDispose();

				string stParam = "?task=" + Common.Encrypt("list",Session.SessionID) + "&BranchTransferID=" + Common.Encrypt(BranchTransferID.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);	
			}
		}