Пример #1
0
		private void LoadRecord()
		{
			ERPConfig clsERPConfig = new ERPConfig();
			ERPConfigDetails clsDetails = clsERPConfig.Details();

			clsERPConfig.CommitAndDispose();

			txtDateFrom.Text = clsDetails.PostingDateFrom.ToString("yyyy-MM-dd");
			txtDateTo.Text = clsDetails.PostingDateTo.ToString("yyyy-MM-dd");
		}
Пример #2
0
		private void SaveRecord()
		{
			
			ERPConfigDetails clsDetails = new ERPConfigDetails();

			clsDetails.PostingDateFrom = Convert.ToDateTime(txtDateFrom.Text);
			clsDetails.PostingDateTo = Convert.ToDateTime(txtDateTo.Text);

			ERPConfig clsERPConfig = new ERPConfig();
			clsERPConfig.UpdatePostingDate(clsDetails.PostingDateFrom, clsDetails.PostingDateTo);

			clsERPConfig.CommitAndDispose();
		}
Пример #3
0
		private void LoadRecord()
		{
			ERPConfig clsERPConfig = new ERPConfig();
			APLinkConfigDetails clsDetails = clsERPConfig.APLinkDetails();

			clsERPConfig.CommitAndDispose();

            cboChartOfAccountAPTracking.SelectedIndex = cboChartOfAccountAPTracking.Items.IndexOf(cboChartOfAccountAPTracking.Items.FindByValue(clsDetails.ChartOfAccountIDAPTracking.ToString()));
            cboChartOfAccountAPBills.SelectedIndex = cboChartOfAccountAPBills.Items.IndexOf(cboChartOfAccountAPBills.Items.FindByValue(clsDetails.ChartOfAccountIDAPBills.ToString()));
            cboChartOfAccountAPFreight.SelectedIndex = cboChartOfAccountAPFreight.Items.IndexOf(cboChartOfAccountAPFreight.Items.FindByValue(clsDetails.ChartOfAccountIDAPFreight.ToString()));
            cboChartOfAccountAPVDeposit.SelectedIndex = cboChartOfAccountAPVDeposit.Items.IndexOf(cboChartOfAccountAPVDeposit.Items.FindByValue(clsDetails.ChartOfAccountIDAPVDeposit.ToString()));
            cboChartOfAccountAPContra.SelectedIndex = cboChartOfAccountAPContra.Items.IndexOf(cboChartOfAccountAPContra.Items.FindByValue(clsDetails.ChartOfAccountIDAPContra.ToString()));
            cboChartOfAccountAPLatePayment.SelectedIndex = cboChartOfAccountAPLatePayment.Items.IndexOf(cboChartOfAccountAPLatePayment.Items.FindByValue(clsDetails.ChartOfAccountIDAPLatePayment.ToString()));

		}
        private string CloseInventory()
        {
            string strRetValue = "";

            try
            {
                DateTime DeliveryDate = Convert.ToDateTime(txtClosingDate.Text);

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

                if (clsERPConfigDetails.PostingDateFrom <= DeliveryDate && clsERPConfigDetails.PostingDateTo >= DeliveryDate)
                {
                    string strReferenceNo = Constants.CLOSE_INVENTORY_CODE + CompanyDetails.BECompanyCode + DateTime.Now.Year.ToString() + clsERPConfig.get_LastClosingNo();

                    AccessUserDetails clsAccessUserDetails = (AccessUserDetails)Session["AccessUserDetails"];

                    ProductInventories clsProductInventories = new ProductInventories(clsERPConfig.Connection, clsERPConfig.Transaction);
                    clsProductInventories.CloseInventoryByProductGroup(int.Parse(cboBranch.SelectedItem.Value), clsAccessUserDetails.UID, DateTime.Parse(txtClosingDate.Text), strReferenceNo, long.Parse(cboProductGroup.SelectedItem.Value), cboProductGroup.SelectedItem.Text);

                    Products clsProducts = new Products(clsERPConfig.Connection, clsERPConfig.Transaction);
                    clsProducts.LockUnlockForSellingByProductGroup(int.Parse(cboBranch.SelectedItem.Value), long.Parse(cboProductGroup.SelectedItem.Value), false);

                    clsERPConfig.CommitAndDispose();
                    strRetValue = strReferenceNo;
                }
                else
                {
                    clsERPConfig.CommitAndDispose();
                    string stScript = "<Script>";
                    stScript += "window.alert('Sorry you cannot close using the closing date: " + txtClosingDate.Text + ". Please enter an allowable posting date.')";
                    stScript += "</Script>";
                    Response.Write(stScript);
                }
            }
            catch (Exception ex)
            {
                string stScript = "<Script>";
                stScript += "window.alert('An error has occured while closing the inventory. Details:' " + ex.Message + ")";
                stScript += "</Script>";
                Response.Write(stScript);
            }
            return strRetValue;
        }
Пример #5
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 DebitMemoID = Convert.ToInt64(lblDebitMemoID.Text);
				string SupplierDRNo = txtSupplierDocNo.Text;

				DebitMemos clsDebitMemos = new DebitMemos();
				clsDebitMemos.Post(DebitMemoID, SupplierDRNo, DeliveryDate);
				clsDebitMemos.CommitAndDispose();

				Common Common = new Common();
				string stParam = "?task=" + Common.Encrypt("list",Session.SessionID) + "&memoid=" + Common.Encrypt(DebitMemoID.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);	
			}
		}
Пример #6
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 SOID = Convert.ToInt64(lblSOID.Text);
                string CustomerDRNo = txtCustomerDRNo.Text;

                SO clsSO = new SO();
                clsSO.IssueGRN(SOID, CustomerDRNo, DeliveryDate);
                clsSO.CommitAndDispose();

                string stParam = "?task=" + Common.Encrypt("list", Session.SessionID) + "&soid=" + Common.Encrypt(SOID.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);
            }
        }
Пример #7
0
		private void SaveRecord()
		{

            APLinkConfigDetails clsDetails = new APLinkConfigDetails();

            clsDetails.ChartOfAccountIDAPTracking = Convert.ToInt32(cboChartOfAccountAPTracking.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPBills = Convert.ToInt32(cboChartOfAccountAPBills.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPFreight = Convert.ToInt32(cboChartOfAccountAPFreight.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPVDeposit = Convert.ToInt32(cboChartOfAccountAPVDeposit.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPContra = Convert.ToInt32(cboChartOfAccountAPContra.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPLatePayment = Convert.ToInt32(cboChartOfAccountAPLatePayment.SelectedItem.Value);

			ERPConfig clsERPConfig = new ERPConfig();
			clsERPConfig.UpdateAPLinkConfig(clsDetails);

			clsERPConfig.CommitAndDispose();
		}
Пример #8
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)
			{
                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);	
			}
		}
Пример #9
0
        private Int64 SaveRecord()
        {
            ContactDetails clsDetails = new ContactDetails();

            ERPConfig clsERPConfig = new ERPConfig();
            BarcodeHelper ean13 = new BarcodeHelper(BarcodeHelper.CustomerCode_Country_Code, BarcodeHelper.CustomerCode_ManufacturerCode, clsERPConfig.get_LastCustomerCode());
            clsDetails.ContactCode = ean13.CountryCode + ean13.ManufacturerCode + ean13.ProductCode + ean13.ChecksumDigit;
            clsERPConfig.CommitAndDispose();

            clsDetails.ContactName = txtLastName.Text + ", " + txtFirstName.Text + " " + txtMiddleName.Text;
            clsDetails.ContactGroupID = Convert.ToInt32(cboGroup.SelectedItem.Value);
            clsDetails.ModeOfTerms = ModeOfTerms.Months;
            clsDetails.Terms = 0;
            clsDetails.Address = txtAddress1.Text + " " + txtAddress2.Text + " " + txtCity.Text + " " + txtState.Text + " " + txtZipCode.Text;
            clsDetails.BusinessName = txtBusinessName.Text;
            clsDetails.TelephoneNo = txtBusinessPhoneNo.Text;
            clsDetails.Remarks = txtRemarks.Text;
            clsDetails.Debit = 0;
            clsDetails.Credit = 0;
            clsDetails.IsCreditAllowed = false;
            clsDetails.CreditLimit = 0;
            clsDetails.DepartmentID = Convert.ToInt16(cboDepartment.SelectedItem.Value);
            clsDetails.PositionID = Convert.ToInt16(cboPosition.SelectedItem.Value);

            DateTime dteBirthDate = Constants.C_DATE_MIN_VALUE;
            DateTime dteSpouseBirthDate = Constants.C_DATE_MIN_VALUE;
            DateTime dteAnniversaryDate = Constants.C_DATE_MIN_VALUE;

            dteBirthDate = DateTime.TryParse(txtBirthDate.Text, out dteBirthDate) ? dteBirthDate : Constants.C_DATE_MIN_VALUE;
            dteSpouseBirthDate = DateTime.TryParse(txtSpouseBirthDate.Text, out dteSpouseBirthDate) ? dteSpouseBirthDate : Constants.C_DATE_MIN_VALUE;
            dteAnniversaryDate = DateTime.TryParse(txtAnniversaryDate.Text, out dteAnniversaryDate) ? dteAnniversaryDate : Constants.C_DATE_MIN_VALUE;

            ContactAddOnDetails clsAddOnDetails = new ContactAddOnDetails();
            clsAddOnDetails.ContactID = clsDetails.ContactID;
            clsAddOnDetails.Salutation = cboSalutation.SelectedItem.Value;
            clsAddOnDetails.FirstName = txtFirstName.Text;
            clsAddOnDetails.MiddleName = txtMiddleName.Text;
            clsAddOnDetails.LastName = txtLastName.Text;
            clsAddOnDetails.SpouseName = txtSpouseName.Text;
            clsAddOnDetails.BirthDate = dteBirthDate;
            clsAddOnDetails.SpouseBirthDate = dteSpouseBirthDate;
            clsAddOnDetails.AnniversaryDate = dteAnniversaryDate;
            clsAddOnDetails.Address1 = txtAddress1.Text;
            clsAddOnDetails.Address2 = txtAddress2.Text;
            clsAddOnDetails.City = txtCity.Text;
            clsAddOnDetails.State = txtState.Text;
            clsAddOnDetails.ZipCode = txtZipCode.Text;
            clsAddOnDetails.CountryID = int.Parse(cboCountry.SelectedItem.Value);
            clsAddOnDetails.CountryCode = cboCountry.SelectedItem.Text;
            clsAddOnDetails.BusinessPhoneNo = txtBusinessPhoneNo.Text;
            clsAddOnDetails.HomePhoneNo = txtHomePhoneNo.Text;
            clsAddOnDetails.MobileNo = txtMobileNo.Text;
            clsAddOnDetails.FaxNo = txtFaxNo.Text;
            clsAddOnDetails.EmailAddress = txtEmailAddress.Text;

            clsDetails.AdditionalDetails = clsAddOnDetails;

            Contacts clsContact = new Contacts();
            Int64 id = clsContact.Insert(clsDetails);
            clsContact.CommitAndDispose();

            return id;
        }