예제 #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 TransferOutID = Convert.ToInt64(lblTransferOutID.Text);
                string SupplierDRNo = txtSupplierDRNo.Text;

                TransferOut clsTransferOut = new TransferOut();
                clsTransferOut.IssueGRN(TransferOutID, SupplierDRNo, DeliveryDate);
                clsTransferOut.CommitAndDispose();

                string stParam = "?task=" + Common.Encrypt("list", Session.SessionID) + "&TransferOutid=" + Common.Encrypt(TransferOutID.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);
            }
        }
예제 #2
0
		private void SetDataSource(ReportDocument Report)
		{
            long iID = 0;
            try
            {
                if (Request.QueryString["task"].ToString().ToLower() == "reportfromposted" && Request.QueryString["transferoutid"].ToString() != null)
                { iID = Convert.ToInt64(Request.QueryString["transferoutid"].ToString()); }
                else
                { iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["transferoutid"].ToString(), Session.SessionID)); }
            }
            catch { iID = Convert.ToInt64(Common.Decrypt(lblReferrer.Text.Substring(lblReferrer.Text.IndexOf("transferoutid") + 14), Session.SessionID)); }

			ReportDataset rptds = new ReportDataset();

			TransferOut clsTransferOut = new TransferOut();
			MySqlDataReader myreader = clsTransferOut.List(iID, "TransferOutID", SortOption.Ascending);
            
			while(myreader.Read())
			{
				DataRow drNew = rptds.TransferOut.NewRow();
				
				foreach (DataColumn dc in rptds.TransferOut.Columns)
					drNew[dc] = "" + myreader[dc.ColumnName]; 
				
				rptds.TransferOut.Rows.Add(drNew);
			}
            myreader.Close();

            TransferOutItem clsTransferOutItem = new TransferOutItem(clsTransferOut.Connection, clsTransferOut.Transaction);
            MySqlDataReader myreaderitems = clsTransferOutItem.List(iID, "TransferOutItemID", SortOption.Ascending);
			while(myreaderitems.Read())
			{
				DataRow drNew = rptds.TransferOutItems.NewRow();
				
				foreach (DataColumn dc in rptds.TransferOutItems.Columns)
					drNew[dc] = "" + myreaderitems[dc.ColumnName]; 
				
				rptds.TransferOutItems.Rows.Add(drNew);
			}
            myreaderitems.Close();
            clsTransferOut.CommitAndDispose();

			Report.SetDataSource(rptds); 
			SetParameters(Report);
		}
예제 #3
0
        protected void chkIsVatInclusive_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                long TransferOutID = long.Parse(lblTransferOutID.Text);

                TransferOut clsTransferOut = new TransferOut();
                clsTransferOut.UpdateIsVatInclusive(TransferOutID, chkIsVatInclusive.Checked);

                TransferOutDetails clsTransferOutDetails = clsTransferOut.Details(TransferOutID);
                clsTransferOut.CommitAndDispose();

                UpdateFooter(clsTransferOutDetails);
            }
            catch (Exception ex) { throw ex; }
        }
예제 #4
0
        private void LoadRecord()
        {
            Int64 iID = 0;
            try { iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["TransferOutid"], Session.SessionID)); }
            catch { }
            try
            { if (iID == 0) iID = Convert.ToInt64(lblTransferOutID.Text); }
            catch { }

            TransferOut clsTransferOut = new TransferOut();
            TransferOutDetails clsDetails = clsTransferOut.Details(iID);
            clsTransferOut.CommitAndDispose();

            lblTransferOutID.Text = clsDetails.TransferOutID.ToString();
            lnkTransferOutNo.Text = clsDetails.TransferOutNo;
            
            lblTransferOutDate.Text = clsDetails.TransferOutDate.ToString("yyyy-MM-dd HH:mm:ss");
            lblRequiredDeliveryDate.Text = clsDetails.RequiredDeliveryDate.ToString("yyyy-MM-dd");
            //lblRID.Text = clsDetails.RID.ToString();
            lblSupplierID.Text = clsDetails.SupplierID.ToString();

            lblSupplierCode.Text = clsDetails.SupplierCode.ToString();
            lblSupplierCode.NavigateUrl = Constants.ROOT_DIRECTORY + "/PurchasesAndPayables/_Vendor/Default.aspx?task=" + Common.Encrypt("details", Session.SessionID) + "&id=" + Common.Encrypt(clsDetails.SupplierID.ToString(), Session.SessionID);

            lblSupplierContact.Text = clsDetails.SupplierContact;
            lblSupplierTelephoneNo.Text = clsDetails.SupplierTelephoneNo;
            lblTerms.Text = clsDetails.SupplierTerms.ToString("##0");
            switch (clsDetails.SupplierModeOfTerms)
            {
                case 0:
                    lblModeOfterms.Text = "Days";
                    break;
                case 1:
                    lblModeOfterms.Text = "Months";
                    break;
                case 2:
                    lblModeOfterms.Text = "Years";
                    break;
            }
            lblSupplierAddress.Text = clsDetails.SupplierAddress;
            lblBranchID.Text = clsDetails.BranchID.ToString();
            lblBranchCode.Text = clsDetails.BranchCode;
            lblBranchAddress.Text = clsDetails.BranchAddress;
            lblTransferOutRemarks.Text = clsDetails.Remarks;

            txtTransferOutDiscountApplied.Text = clsDetails.DiscountApplied.ToString("###0.#0");
            cboTransferOutDiscountType.SelectedIndex = cboTransferOutDiscountType.Items.IndexOf(cboTransferOutDiscountType.Items.FindByValue(clsDetails.DiscountType.ToString("d")));
            lblTransferOutDiscount.Text = clsDetails.Discount.ToString("#,##0.#0");
            lblTotalDiscount1.Text = Convert.ToDecimal(clsDetails.SubTotal + clsDetails.Discount + clsDetails.Discount2 + clsDetails.Discount3).ToString("#,##0.#0");

            txtTransferOutDiscount2Applied.Text = clsDetails.Discount2Applied.ToString("###0.#0");
            cboTransferOutDiscount2Type.SelectedIndex = cboTransferOutDiscount2Type.Items.IndexOf(cboTransferOutDiscount2Type.Items.FindByValue(clsDetails.Discount2Type.ToString("d")));
            lblTransferOutDiscount2.Text = clsDetails.Discount2.ToString("#,##0.#0");
            lblTotalDiscount2.Text = Convert.ToDecimal(clsDetails.SubTotal + clsDetails.Discount2 + clsDetails.Discount3).ToString("#,##0.#0");

            txtTransferOutDiscount3Applied.Text = clsDetails.Discount3Applied.ToString("###0.#0");
            cboTransferOutDiscount3Type.SelectedIndex = cboTransferOutDiscount3Type.Items.IndexOf(cboTransferOutDiscountType.Items.FindByValue(clsDetails.Discount3Type.ToString("d")));
            lblTransferOutDiscount3.Text = clsDetails.Discount3.ToString("#,##0.#0");
            lblTotalDiscount3.Text = Convert.ToDecimal(clsDetails.SubTotal + clsDetails.Discount3).ToString("#,##0.#0");

            lblTransferOutVatableAmount.Text = clsDetails.VatableAmount.ToString("#,##0.#0");
            txtTransferOutFreight.Text = clsDetails.Freight.ToString("#,##0.#0");
            txtTransferOutDeposit.Text = clsDetails.Deposit.ToString("#,##0.#0");
            lblTransferOutSubTotal.Text = Convert.ToDecimal(clsDetails.SubTotal - clsDetails.VAT).ToString("#,##0.#0");
            lblTransferOutVAT.Text = clsDetails.VAT.ToString("#,##0.#0");
            lblTransferOutTotal.Text = clsDetails.SubTotal.ToString("#,##0.#0");
        }
예제 #5
0
        private void UpdateTransferOutDiscount()
        {
            TransferOutDetails clsTransferOutDetails = new TransferOutDetails();
            clsTransferOutDetails.TransferOutID = Convert.ToInt64(lblTransferOutID.Text);
            clsTransferOutDetails.DiscountApplied = Convert.ToDecimal(txtTransferOutDiscountApplied.Text);
            clsTransferOutDetails.DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferOutDiscountType.SelectedItem.Value);

            clsTransferOutDetails.Discount2Applied = Convert.ToDecimal(txtTransferOutDiscount2Applied.Text);
            clsTransferOutDetails.Discount2Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferOutDiscount2Type.SelectedItem.Value);

            clsTransferOutDetails.Discount3Applied = Convert.ToDecimal(txtTransferOutDiscount3Applied.Text);
            clsTransferOutDetails.Discount3Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferOutDiscount3Type.SelectedItem.Value);

            TransferOut clsTransferOut = new TransferOut();
            clsTransferOut.UpdateDiscount(clsTransferOutDetails.TransferOutID, clsTransferOutDetails.DiscountApplied, clsTransferOutDetails.DiscountType, clsTransferOutDetails.Discount2Applied, clsTransferOutDetails.Discount2Type, clsTransferOutDetails.Discount3Applied, clsTransferOutDetails.Discount3Type);
            clsTransferOut.SynchronizeAmount(Convert.ToInt64(lblTransferOutID.Text));
            clsTransferOutDetails = clsTransferOut.Details(Convert.ToInt64(lblTransferOutID.Text));
            clsTransferOut.CommitAndDispose();

            UpdateFooter(clsTransferOutDetails);
        }
예제 #6
0
        private void UpdateDeposit()
        {
            TransferOutDetails clsTransferOutDetails = new TransferOutDetails();
            clsTransferOutDetails.TransferOutID = Convert.ToInt64(lblTransferOutID.Text);
            clsTransferOutDetails.Deposit = Convert.ToDecimal(txtTransferOutDeposit.Text);

            TransferOut clsTransferOut = new TransferOut();
            clsTransferOut.UpdateDeposit(clsTransferOutDetails.TransferOutID, clsTransferOutDetails.Deposit);
            clsTransferOut.SynchronizeAmount(Convert.ToInt64(lblTransferOutID.Text));
            clsTransferOutDetails = clsTransferOut.Details(Convert.ToInt64(lblTransferOutID.Text));
            clsTransferOut.CommitAndDispose();

            UpdateFooter(clsTransferOutDetails);
        }
예제 #7
0
        private void CancelTransferOut()
        {
            long TransferOutID = Convert.ToInt64(lblTransferOutID.Text);
            string Remarks = txtRemarks.Text;

            TransferOut clsTransferOut = new TransferOut();
            clsTransferOut.Cancel(TransferOutID, DateTime.Now, Remarks, Convert.ToInt64(Session["UID"].ToString()));
            clsTransferOut.CommitAndDispose();

            Response.Redirect("Default.aspx?task=" + Common.Encrypt("list", Session.SessionID));
        }
예제 #8
0
 private void GenerateItems()
 {
     TransferOut clsTransferOut = new TransferOut();
     clsTransferOut.GenerateItemsForReorder(Int32.Parse(Session["TerminalID"].ToString()), Convert.ToInt64(lblTransferOutID.Text));
     clsTransferOut.CommitAndDispose();
 }
예제 #9
0
		private void LoadList()
		{	
			TransferOut clsTransferOut = new TransferOut();
			DataClass clsDataClass = new DataClass();
			Common Common = new Common();

			string SortField = "TransferOutID";
			if (Request.QueryString["sortfield"]!=null)
			{	SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID);	}

			SortOption sortoption = SortOption.Ascending;
			if (Request.QueryString["sortoption"]!=null)
			{	sortoption = (SortOption) Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true);	}

            DateTime dteTransferStartDate = DateTime.MinValue;
            try { if (txtOrderStartDate.Text != string.Empty) dteTransferStartDate = Convert.ToDateTime(txtOrderStartDate.Text + " " + txtOrderStartTime.Text); }
            catch { }

            DateTime dteTransferEndDate = DateTime.MinValue;
            try { if (txtOrderEndDate.Text != string.Empty) dteTransferEndDate = Convert.ToDateTime(txtOrderEndDate.Text + " " + txtOrderEndTime.Text); }
            catch { }

            DateTime dtePostingStartDate = DateTime.MinValue;
            try { if (txtPostingStartDate.Text != string.Empty) dtePostingStartDate = Convert.ToDateTime(txtPostingStartDate.Text + " " + txtPostingStartTime.Text); }
            catch { }

            DateTime dtePostingEndDate = DateTime.MinValue;
            try { if (txtPostingEndDate.Text != string.Empty) dtePostingEndDate = Convert.ToDateTime(txtPostingEndDate.Text + " " + txtPostingEndTime.Text); }
            catch { }

            string SearchKey = txtSearch.Text;
            TransferOutStatus status = (TransferOutStatus)Enum.Parse(typeof(TransferOutStatus), cboStatus.SelectedItem.Value);
            PageData.DataSource = clsTransferOut.SearchAsDataTable(status, dteTransferStartDate, dteTransferEndDate, dtePostingStartDate, dtePostingEndDate, SearchKey, SortField, sortoption).DefaultView;

			clsTransferOut.CommitAndDispose();

			int iPageSize = Convert.ToInt16(Session["PageSize"]) ;
			
			PageData.AllowPaging = true;
			PageData.PageSize = iPageSize;
			try
			{
				PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1;				
				lstItem.DataSource = PageData;
				lstItem.DataBind();
			}
			catch
			{
				PageData.CurrentPageIndex = 1;
				lstItem.DataSource = PageData;
				lstItem.DataBind();
			}			
			
			cboCurrentPage.Items.Clear();
			for (int i=0; i < PageData.PageCount;i++)
			{
				int iValue = i + 1;
				cboCurrentPage.Items.Add(new ListItem(iValue.ToString(),iValue.ToString()));
				if (PageData.CurrentPageIndex == i)
				{	cboCurrentPage.Items[i].Selected = true;}
				else
				{	cboCurrentPage.Items[i].Selected = false;}
			}
			lblDataCount.Text = " of " + " " + PageData.PageCount;
		}
예제 #10
0
        private void ExportToFile()
        {

            TransferOut clsTransferOut = new TransferOut();
            TransferOutDetails clsTransferOutDetails = clsTransferOut.Details(long.Parse(lblTransferOutID.Text));

            TransferOutItem clsTransferOutItem = new TransferOutItem(clsTransferOut.Connection, clsTransferOut.Transaction);
            DataTable dtaTransferOutItems = clsTransferOutItem.ListAsDataTable(clsTransferOutDetails.TransferOutID, null, SortOption.Ascending);

            Branch clsBranch = new Branch(clsTransferOut.Connection, clsTransferOut.Transaction);
            BranchDetails clsBranchDetails;

            Contacts clsContact = new Contacts(clsTransferOut.Connection, clsTransferOut.Transaction);
            ContactDetails clsContactDetails;

            Products clsProduct = new Products(clsTransferOut.Connection, clsTransferOut.Transaction);
            ProductDetails clsProductDetails;

            ProductVariations clsProductVariation = new ProductVariations(clsTransferOut.Connection, clsTransferOut.Transaction);
            DataTable dtaProductVariation;

            ProductVariationsMatrix clsProductVariationsMatrix = new ProductVariationsMatrix(clsTransferOut.Connection, clsTransferOut.Transaction);
            DataTable dtaProductVariationsMatrix;

            string xmlFileName = Server.MapPath(@"\RetailPlus\temp\" + lblBranchCode.Text.Replace(" ", "").Trim() + "_" + clsTransferOutDetails.TransferOutNo + "_" + clsTransferOutDetails.TransferOutDate.ToString("yyyyMMddHHmmssffff") + ".xml");
            XmlTextWriter writer = new XmlTextWriter(xmlFileName, System.Text.Encoding.UTF8);

            writer.Formatting = Formatting.Indented;
            writer.WriteStartDocument();
            writer.WriteComment("This file represents the TransferOut Details of TransferOut No: '" + clsTransferOutDetails.TransferOutNo + "' for " + lblBranchCode.Text + " branch.");
            writer.WriteComment("Save this in your local file. Goto 'File', click 'Save As', select the location in your local directory, click 'Save'.");
            writer.WriteStartElement("TransferOutDetails");
            writer.WriteAttributeString("TransferOutID", XmlConvert.ToString(clsTransferOutDetails.TransferOutID));
            writer.WriteAttributeString("TransferOutNo", clsTransferOutDetails.TransferOutNo);
            writer.WriteAttributeString("TransferOutDate", clsTransferOutDetails.TransferOutDate.ToString("MM/dd/yyyy HH:mm:ss"));

            /******Supplier information******/
            clsContactDetails = clsContact.Details(clsTransferOutDetails.SupplierID);
            writer.WriteAttributeString("SupplierID", XmlConvert.ToString(clsContactDetails.ContactID));
            writer.WriteAttributeString("SupplierCode", clsContactDetails.ContactCode);
            writer.WriteAttributeString("SupplierName", clsContactDetails.ContactName);
            writer.WriteAttributeString("SupplierContact", clsContactDetails.BusinessName);
            writer.WriteAttributeString("SupplierAddress", clsTransferOutDetails.SupplierAddress);
            writer.WriteAttributeString("SupplierTelephoneNo", clsTransferOutDetails.SupplierTelephoneNo);
            writer.WriteAttributeString("SupplierModeOfTerms", XmlConvert.ToString(clsTransferOutDetails.SupplierModeOfTerms));
            writer.WriteAttributeString("SupplierTerms", XmlConvert.ToString(clsTransferOutDetails.SupplierTerms));
            writer.WriteAttributeString("SupplierContactGroupName", clsContactDetails.ContactGroupName);
            /******End Of Supplier Information******/

            writer.WriteAttributeString("RequiredDeliveryDate", clsTransferOutDetails.RequiredDeliveryDate.ToString("MM/dd/yyyy HH:mm:ss"));

            /******Branch & Transferrer Information******/
            clsBranchDetails = clsBranch.Details(short.Parse(clsTransferOutDetails.BranchID.ToString()));
            writer.WriteAttributeString("BranchID", XmlConvert.ToString(clsTransferOutDetails.BranchID));
            writer.WriteAttributeString("BranchCode", clsTransferOutDetails.BranchCode);
            writer.WriteAttributeString("BranchName", clsTransferOutDetails.BranchName);
            writer.WriteAttributeString("BranchAddress", clsTransferOutDetails.BranchAddress);
            writer.WriteAttributeString("BranchDBIP", clsBranchDetails.DBIP);
            writer.WriteAttributeString("BranchDBPort", clsBranchDetails.DBPort);
            writer.WriteAttributeString("BranchRemarks", clsBranchDetails.Remarks);
            writer.WriteAttributeString("TransferrerID", clsTransferOutDetails.TransferrerID.ToString());
            writer.WriteAttributeString("TransferrerName", clsTransferOutDetails.TransferrerName);
            /******End Of Branch & Transferrer Information******/

            /******Amount Information******/
            writer.WriteAttributeString("SubTotal", XmlConvert.ToString(clsTransferOutDetails.SubTotal));
            writer.WriteAttributeString("Discount", XmlConvert.ToString(clsTransferOutDetails.Discount));
            writer.WriteAttributeString("DiscountApplied", XmlConvert.ToString(clsTransferOutDetails.DiscountApplied));
            writer.WriteAttributeString("DiscountType", clsTransferOutDetails.DiscountType.ToString("d"));
            writer.WriteAttributeString("VAT", XmlConvert.ToString(clsTransferOutDetails.VAT));
            writer.WriteAttributeString("VatableAmount", XmlConvert.ToString(clsTransferOutDetails.VatableAmount));
            writer.WriteAttributeString("EVAT", XmlConvert.ToString(clsTransferOutDetails.EVAT));
            writer.WriteAttributeString("EVatableAmount", XmlConvert.ToString(clsTransferOutDetails.EVatableAmount));
            writer.WriteAttributeString("LocalTax", XmlConvert.ToString(clsTransferOutDetails.LocalTax));
            writer.WriteAttributeString("Freight", XmlConvert.ToString(clsTransferOutDetails.Freight));
            writer.WriteAttributeString("Deposit", XmlConvert.ToString(clsTransferOutDetails.Deposit));
            writer.WriteAttributeString("UnpaidAmount", XmlConvert.ToString(clsTransferOutDetails.UnpaidAmount));
            writer.WriteAttributeString("PaidAmount", XmlConvert.ToString(clsTransferOutDetails.PaidAmount));
            writer.WriteAttributeString("TotalItemDiscount", XmlConvert.ToString(clsTransferOutDetails.TotalItemDiscount));
            writer.WriteAttributeString("Status", clsTransferOutDetails.Status.ToString("d"));
            writer.WriteAttributeString("Remarks", clsTransferOutDetails.Remarks);
            writer.WriteAttributeString("SupplierDRNo", clsTransferOutDetails.SupplierDRNo);
            writer.WriteAttributeString("DeliveryDate", clsTransferOutDetails.DeliveryDate.ToString("MM/dd/yyyy HH:mm:ss"));
            writer.WriteAttributeString("CancelledDate", clsTransferOutDetails.CancelledDate.ToString("MM/dd/yyyy HH:mm:ss"));
            writer.WriteAttributeString("CancelledRemarks", clsTransferOutDetails.CancelledRemarks);
            writer.WriteAttributeString("CancelledByID", XmlConvert.ToString(clsTransferOutDetails.CancelledByID));
            /******End Of Branch Information******/

            foreach (DataRow row in dtaTransferOutItems.Rows)
            {
                clsProductDetails = new ProductDetails();
                clsProductDetails = clsProduct.Details(Convert.ToInt64(row["ProductID"].ToString()));

                writer.WriteStartElement("TransferOutItem");
                writer.WriteAttributeString("TransferOutItemID", row["TransferOutItemID"].ToString());
                writer.WriteAttributeString("TransferOutID", row["TransferOutID"].ToString());
                writer.WriteAttributeString("ProductID", row["ProductID"].ToString());

                /*****Product Information*****/
                writer.WriteAttributeString("ProductCode", clsProductDetails.ProductCode);
                writer.WriteAttributeString("BarCode", clsProductDetails.BarCode);
                writer.WriteAttributeString("ProductDesc", clsProductDetails.ProductDesc);
                writer.WriteAttributeString("MatrixDescription", row["MatrixDescription"].ToString());
                writer.WriteAttributeString("ProductSubGroupID", clsProductDetails.ProductSubGroupID.ToString());
                writer.WriteAttributeString("ProductSubGroupCode", clsProductDetails.ProductSubGroupCode);
                writer.WriteAttributeString("ProductSubGroupName", clsProductDetails.ProductSubGroupName);
                writer.WriteAttributeString("ProductGroupID", clsProductDetails.ProductGroupID.ToString());
                writer.WriteAttributeString("ProductGroupCode", clsProductDetails.ProductGroupCode);
                writer.WriteAttributeString("ProductGroupName", clsProductDetails.ProductGroupName);
                writer.WriteAttributeString("BaseUnitID", clsProductDetails.BaseUnitID.ToString());
                writer.WriteAttributeString("BaseUnitCode", clsProductDetails.BaseUnitCode);
                writer.WriteAttributeString("BaseUnitName", clsProductDetails.BaseUnitName);
                writer.WriteAttributeString("DateCreated", clsProductDetails.DateCreated.ToString("MM/dd/yy HH:mm:ss"));
                writer.WriteAttributeString("Deleted", clsProductDetails.Deleted.ToString());
                writer.WriteAttributeString("Price", clsProductDetails.Price.ToString());
                writer.WriteAttributeString("PurchasePrice", clsProductDetails.PurchasePrice.ToString());
                writer.WriteAttributeString("IncludeInSubtotalDiscount", clsProductDetails.IncludeInSubtotalDiscount.ToString());
                writer.WriteAttributeString("VAT", clsProductDetails.VAT.ToString());
                writer.WriteAttributeString("EVAT", clsProductDetails.EVAT.ToString());
                writer.WriteAttributeString("LocalTax", clsProductDetails.LocalTax.ToString());
                writer.WriteAttributeString("Quantity", clsProductDetails.Quantity.ToString());
                writer.WriteAttributeString("MinThreshold", clsProductDetails.MinThreshold.ToString());
                writer.WriteAttributeString("MaxThreshold", clsProductDetails.MaxThreshold.ToString());
                writer.WriteAttributeString("ChartOfAccountIDPurchase", clsProductDetails.ChartOfAccountIDPurchase.ToString());
                writer.WriteAttributeString("ChartOfAccountIDSold", clsProductDetails.ChartOfAccountIDSold.ToString());
                writer.WriteAttributeString("ChartOfAccountIDInventory", clsProductDetails.ChartOfAccountIDInventory.ToString());
                writer.WriteAttributeString("ChartOfAccountIDTaxPurchase", clsProductDetails.ChartOfAccountIDTaxPurchase.ToString());
                writer.WriteAttributeString("ChartOfAccountIDTaxSold", clsProductDetails.ChartOfAccountIDTaxSold.ToString());
                writer.WriteAttributeString("IsItemSold", clsProductDetails.IsItemSold.ToString());
                writer.WriteAttributeString("WillPrintProductComposition", clsProductDetails.WillPrintProductComposition.ToString());
                writer.WriteAttributeString("UpdatedBy", clsProductDetails.UpdatedBy.ToString());
                writer.WriteAttributeString("UpdatedOn", clsProductDetails.UpdatedOn.ToString("MM/dd/yyyy HH:mm"));
                writer.WriteAttributeString("PercentageCommision", clsProductDetails.PercentageCommision.ToString());
                writer.WriteAttributeString("Active", clsProductDetails.Active.ToString());
                /*****End Of Product Information*****/

                writer.WriteAttributeString("ItemProductGroup", row["ProductGroup"].ToString());
                writer.WriteAttributeString("ItemProductSubGroup", row["ProductSubGroup"].ToString());
                writer.WriteAttributeString("ItemVariationMatrixID", row["VariationMatrixID"].ToString());
                writer.WriteAttributeString("ItemBaseVariationDescription", row["MatrixDescription"].ToString());
                writer.WriteAttributeString("ItemProductUnitID", row["ProductUnitID"].ToString());
                writer.WriteAttributeString("ItemProductUnitCode", row["ProductUnitCode"].ToString());
                writer.WriteAttributeString("ItemQuantity", row["Quantity"].ToString());
                writer.WriteAttributeString("ItemUnitCost", row["UnitCost"].ToString());
                writer.WriteAttributeString("ItemDiscount", row["Discount"].ToString());
                writer.WriteAttributeString("ItemDiscountApplied", row["DiscountApplied"].ToString());
                writer.WriteAttributeString("ItemDiscountType", row["DiscountType"].ToString());
                writer.WriteAttributeString("ItemAmount", row["Amount"].ToString());
                writer.WriteAttributeString("ItemVAT", row["VAT"].ToString());
                writer.WriteAttributeString("ItemVatableAmount", row["VatableAmount"].ToString());
                writer.WriteAttributeString("ItemEVAT", row["EVAT"].ToString());
                writer.WriteAttributeString("ItemEVatableAmount", row["EVatableAmount"].ToString());
                writer.WriteAttributeString("ItemLocalTax", row["LocalTax"].ToString());
                writer.WriteAttributeString("ItemisVATInclusive", row["isVATInclusive"].ToString());
                writer.WriteAttributeString("ItemTransferOutItemStatus", row["TransferOutItemStatus"].ToString());
                writer.WriteAttributeString("ItemIsVatable", row["IsVatable"].ToString());
                writer.WriteAttributeString("ItemSellingPrice", row["SellingPrice"].ToString());
                writer.WriteAttributeString("ItemSellingVAT", row["SellingVAT"].ToString());
                writer.WriteAttributeString("ItemSellingEVAT", row["SellingEVAT"].ToString());
                writer.WriteAttributeString("ItemSellingLocalTax", row["SellingLocalTax"].ToString());
                writer.WriteAttributeString("ItemOldSellingPrice", row["OldSellingPrice"].ToString());
                writer.WriteAttributeString("ItemRemarks", row["Remarks"].ToString());

                dtaProductVariation = clsProductVariation.ListAsDataTable(clsProductDetails.ProductID, null, System.Data.SqlClient.SortOrder.Ascending);
                foreach (DataRow rowVariation in dtaProductVariation.Rows)
                {
                    writer.WriteStartElement("Variation", null);
                    writer.WriteAttributeString("VariationCode", rowVariation["VariationCode"].ToString());
                    writer.WriteAttributeString("VariationType", rowVariation["VariationType"].ToString());
                    writer.WriteEndElement();
                }

                dtaProductVariationsMatrix = clsProductVariationsMatrix.ProductVariationsMatrixListAsDataTable(long.Parse(row["VariationMatrixID"].ToString()), null, System.Data.SqlClient.SortOrder.Ascending);
                foreach (DataRow rowVariationsMatrix in dtaProductVariationsMatrix.Rows)
                {
                    writer.WriteStartElement("VariationMatrix", null);
                    writer.WriteAttributeString("MatriXID", rowVariationsMatrix["MatriXID"].ToString());
                    writer.WriteAttributeString("VariationID", rowVariationsMatrix["VariationID"].ToString());
                    writer.WriteAttributeString("Description", rowVariationsMatrix["Description"].ToString());
                    writer.WriteAttributeString("VariationCode", rowVariationsMatrix["VariationCode"].ToString());
                    writer.WriteAttributeString("VariationType", rowVariationsMatrix["VariationType"].ToString());
                    writer.WriteEndElement();
                }

                writer.WriteEndElement();
            }

            writer.WriteEndElement();

            //Write the XML to file and close the writer
            writer.Flush();
            writer.Close();

            clsTransferOut.CommitAndDispose();

            string stScript = "<Script>";
            stScript += "window.open('/RetailPlus/temp/" + lblBranchCode.Text.Replace(" ", "").Trim() + "_" + clsTransferOutDetails.TransferOutNo + "_" + clsTransferOutDetails.TransferOutDate.ToString("yyyyMMddHHmmssffff") + ".xml')";
            stScript += "</Script>";
            Response.Write(stScript);
        }
예제 #11
0
		private void SaveRecord()
		{
			TransferOutDetails clsDetails = new TransferOutDetails();

			clsDetails.TransferOutID = Convert.ToInt64(lblTransferOutID.Text);
			clsDetails.TransferOutNo = lblTransferOutNo.Text;
			clsDetails.TransferOutDate = Convert.ToDateTime(lblTransferOutDate.Text);
			clsDetails.SupplierID = Convert.ToInt64(cboSupplier.SelectedItem.Value);
			clsDetails.SupplierCode = cboSupplier.SelectedItem.Text;
			clsDetails.SupplierContact = txtSupplierContact.Text;
			clsDetails.SupplierAddress = txtSupplierAddress.Text;
			clsDetails.SupplierTelephoneNo = txtSupplierTelephoneNo.Text;
			switch (lblModeOfterms.Text)
			{
				case "Days":
					clsDetails.SupplierModeOfTerms = 0;
					break;
				case "Months":
					clsDetails.SupplierModeOfTerms = 1;
					break;
				case "Years":
					clsDetails.SupplierModeOfTerms = 2;
					break;
			}
			clsDetails.RequiredDeliveryDate = Convert.ToDateTime(txtRequiredDeliveryDate.Text);
			clsDetails.BranchID = Convert.ToInt16(cboBranch.SelectedItem.Value);
			clsDetails.TransferrerID = Convert.ToInt64(Session["UID"].ToString());
            clsDetails.TransferrerName = Session["Name"].ToString();
			clsDetails.Status = TransferOutStatus.Open;
			clsDetails.Remarks = txtRemarks.Text;

			TransferOut clsTransferOut = new TransferOut();
			clsTransferOut.Update(clsDetails);
			clsTransferOut.CommitAndDispose();
		}
예제 #12
0
		private void LoadRecord()
		{
            Int64 iID = Convert.ToInt64(Common.Decrypt(Request.QueryString["transferoutid"], Session.SessionID));
			TransferOut clsTransferOut = new TransferOut();
			TransferOutDetails clsDetails = clsTransferOut.Details(iID);
			clsTransferOut.CommitAndDispose();

			lblTransferOutID.Text = clsDetails.TransferOutID.ToString();
			lblTransferOutNo.Text = clsDetails.TransferOutNo;
			lblTransferOutDate.Text = clsDetails.TransferOutDate.ToString("yyyy-MM-dd HH:mm:ss");
			txtRequiredDeliveryDate.Text = clsDetails.RequiredDeliveryDate.ToString("yyyy-MM-dd");
			cboSupplier.SelectedIndex = cboSupplier.Items.IndexOf(cboSupplier.Items.FindByValue(clsDetails.SupplierID.ToString()));
			txtSupplierContact.Text = clsDetails.SupplierContact;
			txtSupplierTelephoneNo.Text = clsDetails.SupplierTelephoneNo;
			lblTerms.Text = clsDetails.SupplierTerms.ToString("##0");
			switch (clsDetails.SupplierModeOfTerms)
			{
				case 0: 
					lblModeOfterms.Text = "Days"; 
					break;
				case 1:
					lblModeOfterms.Text = "Months"; 
					break;
				case 2:
					lblModeOfterms.Text = "Years"; 
					break;
			}
			txtSupplierAddress.Text = clsDetails.SupplierAddress;
			cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(clsDetails.BranchID.ToString()));
			txtBranchAddress.Text = clsDetails.BranchAddress;
			txtRemarks.Text = clsDetails.Remarks;
		}
예제 #13
0
		private Int64 SaveRecord()
		{
			TransferOut clsTransferOut = new TransferOut();
			clsTransferOut.GetConnection();
			lblTransferOutNo.Text = Constants.TRANSFER_OUT_CODE + CompanyDetails.BECompanyCode + DateTime.Now.Year.ToString() + clsTransferOut.LastTransactionNo();

			TransferOutDetails clsDetails = new TransferOutDetails();

			clsDetails.TransferOutNo = lblTransferOutNo.Text;
			clsDetails.TransferOutDate = Convert.ToDateTime(lblTransferOutDate.Text);
			clsDetails.SupplierID = Convert.ToInt64(cboSupplier.SelectedItem.Value);
			clsDetails.SupplierCode = cboSupplier.SelectedItem.Text;
			clsDetails.SupplierContact = txtSupplierContact.Text;
			clsDetails.SupplierAddress = txtSupplierAddress.Text;
			clsDetails.SupplierTelephoneNo = txtSupplierTelephoneNo.Text;
            clsDetails.SupplierTerms = Convert.ToInt32(lblTerms.Text);
			switch (lblModeOfterms.Text)
			{
				case "Days":
					clsDetails.SupplierModeOfTerms = 0;
					break;
				case "Months":
					clsDetails.SupplierModeOfTerms = 1;
					break;
				case "Years":
					clsDetails.SupplierModeOfTerms = 2;
					break;
			}
			clsDetails.RequiredDeliveryDate = Convert.ToDateTime(txtRequiredDeliveryDate.Text);
			clsDetails.BranchID = Convert.ToInt16(cboBranch.SelectedItem.Value);
			clsDetails.TransferrerID = Convert.ToInt64(Session["UID"].ToString());
            clsDetails.TransferrerName = Session["Name"].ToString();
			clsDetails.Status = TransferOutStatus.Open;
			clsDetails.Remarks = txtRemarks.Text;
			
			Int64 id = clsTransferOut.Insert(clsDetails);
			clsTransferOut.CommitAndDispose();

			return id;
		}