Ejemplo n.º 1
0
        private void Post()
        {
            DateTime DeliveryDate = Convert.ToDateTime(txtPostDate.Text);

            ERPConfig clsERPConfig = new ERPConfig();
            ERPConfigDetails clsERPConfigDetails = clsERPConfig.Details();
            clsERPConfig.CommitAndDispose();

            if (clsERPConfigDetails.PostingDateFrom <= DeliveryDate && clsERPConfigDetails.PostingDateTo >= DeliveryDate)
            {
                long CreditMemoID = Convert.ToInt64(lblCreditMemoID.Text);
                string CustomerDocNo = txtCustomerDocNo.Text;

                SOReturns clsSOReturns = new SOReturns();
                clsSOReturns.Post(CreditMemoID, CustomerDocNo, DeliveryDate);
                clsSOReturns.CommitAndDispose();

                Common Common = new Common();
                string stParam = "?task=" + Common.Encrypt("list", Session.SessionID) + "&retid=" + Common.Encrypt(CreditMemoID.ToString(), Session.SessionID);
                Response.Redirect("Default.aspx" + stParam);
            }
            else
            {
                string stScript = "<Script>";
                stScript += "window.alert('Sorry you cannot post using the delivery date: " + txtPostDate.Text + ". Please enter an allowable posting date.')";
                stScript += "</Script>";
                Response.Write(stScript);
            }
        }