/// <summary>
        /// This method Opens Dimesions Screen.
        /// </summary>
        /// <param name="barcodeInfo"></param>
        private bool OpenItemDimensionsDialog(IBarcodeInfo barcodeInfo)
        {
            bool returnValue = false;
            // Get the dimensions
            DataTable inventDimCombination = PurchaseOrderReceiving.InternalApplication.Services.Dimension.GetDimensions(saleLineItem.ItemId);

            // Get the dimensions
            DimensionConfirmation dimensionConfirmation = new DimensionConfirmation()
            {
                InventDimCombination = inventDimCombination,
                DimensionData        = saleLineItem.Dimension,
                DisplayDialog        = !barcodeInfo.Found
            };

            InteractionRequestedEventArgs request = new InteractionRequestedEventArgs(dimensionConfirmation, () =>
            {
                if (dimensionConfirmation.Confirmed)
                {
                    if (dimensionConfirmation.SelectDimCombination != null)
                    {
                        DataRow dr = dimensionConfirmation.SelectDimCombination;
                        saleLineItem.Dimension.VariantId  = dr.Field <string>("VARIANTID");
                        saleLineItem.Dimension.ColorId    = dr.Field <string>("COLORID");
                        saleLineItem.Dimension.ColorName  = dr.Field <string>("COLOR");
                        saleLineItem.Dimension.SizeId     = dr.Field <string>("SIZEID");
                        saleLineItem.Dimension.SizeName   = dr.Field <string>("SIZE");
                        saleLineItem.Dimension.StyleId    = dr.Field <string>("STYLEID");
                        saleLineItem.Dimension.StyleName  = dr.Field <string>("STYLE");
                        saleLineItem.Dimension.ConfigId   = dr.Field <string>(DataAccessConstants.ConfigId);
                        saleLineItem.Dimension.ConfigName = dr.Field <string>("CONFIG");
                        saleLineItem.Dimension.DistinctProductVariantId = (Int64)dr["DISTINCTPRODUCTVARIANT"];

                        if (string.IsNullOrEmpty(saleLineItem.BarcodeId))
                        {   // Pick up if not previously set
                            saleLineItem.BarcodeId = dr.Field <string>("ITEMBARCODE");
                        }

                        string unitId = dr.Field <string>("UNITID");
                        if (!String.IsNullOrEmpty(unitId))
                        {
                            saleLineItem.SalesOrderUnitOfMeasure = unitId;
                        }
                    }
                    returnValue = true;
                }
            }
                                                                                      );

            PurchaseOrderReceiving.InternalApplication.Services.Interaction.InteractionRequest(request);

            return(returnValue);
        }
Beispiel #2
0
        // Dimension form
        private void HandleDimensionInteraction(InteractionRequestedEventArgs e)
        {
            if (e == null)
            {
                throw new ArgumentNullException("InteractionRequestedEventArgs");
            }

            DimensionConfirmation context = (DimensionConfirmation)e.Context;
            DimensionConfirmation results = InvokeInteraction <DimensionConfirmation, DimensionConfirmation>("DimensionView", context, context.DisplayDialog);

            if (results != null)
            {
                context.Confirmed            = results.Confirmed;
                context.SelectDimCombination = results.SelectDimCombination;
            }
        }
        public frmDimensions(DimensionConfirmation args)
            : this()
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            this.colorId  = ((IDimension)args.DimensionData).ColorId;
            this.sizeId   = ((IDimension)args.DimensionData).SizeId;
            this.styleId  = ((IDimension)args.DimensionData).StyleId;
            this.configId = ((IDimension)args.DimensionData).ConfigId;

            this.inventDimCombination = args.InventDimCombination;
            viewModel = new DimensionsViewModel(this.inventDimCombination);
            viewModel.PropertyChanged += new PropertyChangedEventHandler(OnViewModel_PropertyChanged);
            viewModel.Finished        += new EventHandler(OnViewModel_Finished);

            LoadButtons();
        }
        private void btnPOSItemSearch_Click(object sender, EventArgs e)
        {
            if (IsEdit)
            {
                using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("You are in editing mode", MessageBoxButtons.OK, MessageBoxIcon.Information))
                {
                    LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);
                    return;
                }
            }
            Microsoft.Dynamics.Retail.Pos.Dialog.Dialog objdialog = new Dialog.Dialog();
            string  str    = string.Empty;
            DataSet dsItem = new DataSet();

            objdialog.MyItemSearch(500, ref str, out dsItem);

            saleLineItem = new SaleLineItem();

            if (dsItem != null && dsItem.Tables.Count > 0 && dsItem.Tables[0].Rows.Count > 0)
            {
                saleLineItem.ItemId = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]);
                Microsoft.Dynamics.Retail.Pos.Item.Item objItem = new Item.Item();
                objItem.MYProcessItem(saleLineItem, application);
                Microsoft.Dynamics.Retail.Pos.Dimension.Dimension objDim = new Dimension.Dimension();
                DataTable dtDimension = new DataTable();
                dtDimension = objDim.GetDimensions(saleLineItem.ItemId);
                if (dtDimension != null && dtDimension.Rows.Count > 0)
                {
                    DimensionConfirmation dimConfirmation = new DimensionConfirmation();
                    dimConfirmation.InventDimCombination = dtDimension;
                    dimConfirmation.DimensionData        = saleLineItem.Dimension;

                    frmDimensions objfrmDim = new frmDimensions(dimConfirmation);
                    objfrmDim.ShowDialog();
                    if (objfrmDim.SelectDimCombination != null)
                    {
                        inventDimId = GetInventID(Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[2]));
                        DataTable dtcmbCode = new DataTable();
                        dtcmbCode.Columns.Add("CodeID", typeof(string));
                        dtcmbCode.Columns.Add("CodeValue", typeof(string));
                        DataRow drCode;
                        drCode              = dtcmbCode.NewRow();
                        drCode["CodeID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]);
                        drCode["CodeValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]);
                        dtcmbCode.Rows.Add(drCode);
                        cmbCode.DataSource    = dtcmbCode;
                        cmbCode.DisplayMember = "CodeValue";
                        cmbCode.ValueMember   = "CodeID";

                        DataTable dtSize = new DataTable();
                        dtSize.Columns.Add("SizeID", typeof(string));
                        dtSize.Columns.Add("SizeValue", typeof(string));
                        DataRow drSize;
                        drSize              = dtSize.NewRow();
                        drSize["SizeID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]);
                        drSize["SizeValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]);
                        dtSize.Rows.Add(drSize);
                        cmbSize.DataSource    = dtSize;
                        cmbSize.DisplayMember = "SizeID";
                        cmbSize.ValueMember   = "SizeValue";

                        DataTable dtConfig = new DataTable();
                        dtConfig.Columns.Add("ConfigID", typeof(string));
                        dtConfig.Columns.Add("ConfigValue", typeof(string));
                        DataRow drConfig;
                        drConfig                = dtConfig.NewRow();
                        drConfig["ConfigID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]);
                        drConfig["ConfigValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]);
                        dtConfig.Rows.Add(drConfig);
                        cmbConfig.DataSource    = dtConfig;
                        cmbConfig.DisplayMember = "ConfigID";
                        cmbConfig.ValueMember   = "ConfigValue";

                        DataTable dtStyle = new DataTable();
                        dtStyle.Columns.Add("StyleID", typeof(string));
                        dtStyle.Columns.Add("StyleValue", typeof(string));
                        DataRow drStyle;
                        drStyle               = dtStyle.NewRow();
                        drStyle["StyleID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]);
                        drStyle["StyleValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]);
                        dtStyle.Rows.Add(drStyle);
                        cmbStyle.DataSource    = dtStyle;
                        cmbStyle.DisplayMember = "StyleID";
                        cmbStyle.ValueMember   = "StyleValue";
                        cmbConfig.Enabled      = false;
                        cmbCode.Enabled        = false;
                        cmbSize.Enabled        = false;
                        cmbStyle.Enabled       = false;

                        Previewdimensions = ColorSizeStyleConfig();
                    }
                }
                else
                {
                    cmbStyle.Text     = string.Empty;
                    cmbConfig.Text    = string.Empty;
                    cmbCode.Text      = string.Empty;
                    cmbSize.Text      = string.Empty;
                    cmbConfig.Enabled = false;
                    cmbCode.Enabled   = false;
                    cmbSize.Enabled   = false;
                    cmbStyle.Enabled  = false;
                }
                txtPCS.Focus();
                txtPCS.Text = "";
                SqlConnection conn = new SqlConnection();
                if (application != null)
                {
                    conn = application.Settings.Database.Connection;
                }
                else
                {
                    conn = ApplicationSettings.Database.LocalConnection;
                }

                txtItemId.Text   = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]);
                txtItemName.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMNAME"]);


                unitid = saleLineItem.BackofficeSalesOrderUnitOfMeasure;
            }
        }
Beispiel #5
0
        private void btnPOSItemSearch_Click(object sender, EventArgs e)
        {
            if (IsEdit)
            {
                using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("You are in editing mode", MessageBoxButtons.OK, MessageBoxIcon.Information))
                {
                    LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);
                    return;
                }
            }
            Dialog  objdialog = new Dialog();
            string  str       = string.Empty;
            DataSet dsItem    = new DataSet();

            objdialog.MyItemSearch(500, ref str, out dsItem);

            saleLineItem = new SaleLineItem();

            if (dsItem != null && dsItem.Tables.Count > 0 && dsItem.Tables[0].Rows.Count > 0)
            {
                saleLineItem.ItemId = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]);
                Item objItem = new Item();
                objItem.MYProcessItem(saleLineItem, application);
                Dimension objDim      = new Dimension();
                DataTable dtDimension = new DataTable();
                dtDimension = objDim.GetDimensions(saleLineItem.ItemId);
                if (dtDimension != null && dtDimension.Rows.Count > 0)
                {
                    DimensionConfirmation dimConfirmation = new DimensionConfirmation();
                    dimConfirmation.InventDimCombination = dtDimension;
                    dimConfirmation.DimensionData        = saleLineItem.Dimension;

                    frmDimensions objfrmDim = new frmDimensions(dimConfirmation);
                    objfrmDim.ShowDialog();
                    if (objfrmDim.SelectDimCombination != null)
                    {
                        inventDimId = frmRepairDetail.GetInventID(Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[2]));
                        #region The following field(code,style,size and configuration are added to this form) @ 01/11/2014
                        txtCode.Text   = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]);
                        txtStyle.Text  = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]);
                        txtSize.Text   = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]);
                        txtConfig.Text = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]);
                        #endregion
                    }
                }

                txtPCS.Focus();
                txtPCS.Text = "1";
                SqlConnection conn = new SqlConnection();
                if (application != null)
                {
                    conn = application.Settings.Database.Connection;
                }
                else
                {
                    conn = ApplicationSettings.Database.LocalConnection;
                }

                string sQty = string.Empty;
                sQty = frmRepairDetail.GetStandardQuantityFromDB(conn, Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]));
                if (!string.IsNullOrEmpty(sQty))
                {
                    sQty             = Convert.ToString(decimal.Round(Convert.ToDecimal(sQty), 3, MidpointRounding.AwayFromZero));
                    txtQuantity.Text = Convert.ToString(Convert.ToDecimal(sQty) == 0 ? string.Empty : Convert.ToString(sQty));
                }
                txtItemId.Text   = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]);
                txtItemName.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMNAME"]);

                txtRate.Text = "0.00";// frmRepairDetail.getRateFromMetalTable(txtItemId.Text, cmbConfig.Text, cmbStyle.Text, cmbCode.Text, cmbSize.Text, txtQuantity.Text);
                //  if (!string.IsNullOrEmpty(txtRate.Text))
                //    cmbRateType.SelectedIndex = cmbRateType.FindStringExact("Tot");
                //  txtRate.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMPRICE"]).Remove(0, 1).Trim();
                unitid = saleLineItem.BackofficeSalesOrderUnitOfMeasure;
            }
        }
Beispiel #6
0
        private void btnPOSItemSearch_Click(object sender, EventArgs e)
        {
            if (IsEdit)
            {
                using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("You are in editing mode", MessageBoxButtons.OK, MessageBoxIcon.Information))
                {
                    LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog);
                    return;
                }
            }
            Dialog  objdialog = new Dialog();
            string  str       = string.Empty;
            DataSet dsItem    = new DataSet();

            objdialog.MyItemSearch(500, ref str, out dsItem);

            saleLineItem = new SaleLineItem();

            if (dsItem != null && dsItem.Tables.Count > 0 && dsItem.Tables[0].Rows.Count > 0)
            {
                saleLineItem.ItemId = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]);
                Item objItem = new Item();
                objItem.MYProcessItem(saleLineItem, application);
                Dimension objDim      = new Dimension();
                DataTable dtDimension = new DataTable();
                dtDimension = objDim.GetDimensions(saleLineItem.ItemId);
                if (dtDimension != null && dtDimension.Rows.Count > 0)
                {
                    DimensionConfirmation dimConfirmation = new DimensionConfirmation();
                    dimConfirmation.InventDimCombination = dtDimension;
                    dimConfirmation.DimensionData        = saleLineItem.Dimension;

                    frmDimensions objfrmDim = new frmDimensions(dimConfirmation);
                    objfrmDim.ShowDialog();
                    if (objfrmDim.SelectDimCombination != null)
                    {
                        inventDimId = frmOrderDetails.GetInventID(Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[2]));
                        DataTable dtcmbCode = new DataTable();
                        dtcmbCode.Columns.Add("CodeID", typeof(string));
                        dtcmbCode.Columns.Add("CodeValue", typeof(string));
                        DataRow drCode;
                        drCode              = dtcmbCode.NewRow();
                        drCode["CodeID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]);
                        drCode["CodeValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[4]);
                        dtcmbCode.Rows.Add(drCode);
                        cmbCode.DataSource    = dtcmbCode;
                        cmbCode.DisplayMember = "CodeValue";
                        cmbCode.ValueMember   = "CodeID";

                        DataTable dtSize = new DataTable();
                        dtSize.Columns.Add("SizeID", typeof(string));
                        dtSize.Columns.Add("SizeValue", typeof(string));
                        DataRow drSize;
                        drSize              = dtSize.NewRow();
                        drSize["SizeID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]);
                        drSize["SizeValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[3]);
                        dtSize.Rows.Add(drSize);
                        cmbSize.DataSource    = dtSize;
                        cmbSize.DisplayMember = "SizeID";
                        cmbSize.ValueMember   = "SizeValue";

                        DataTable dtConfig = new DataTable();
                        dtConfig.Columns.Add("ConfigID", typeof(string));
                        dtConfig.Columns.Add("ConfigValue", typeof(string));
                        DataRow drConfig;
                        drConfig                = dtConfig.NewRow();
                        drConfig["ConfigID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]);
                        drConfig["ConfigValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[6]);
                        dtConfig.Rows.Add(drConfig);
                        cmbConfig.DataSource    = dtConfig;
                        cmbConfig.DisplayMember = "ConfigID";
                        cmbConfig.ValueMember   = "ConfigValue";

                        DataTable dtStyle = new DataTable();
                        dtStyle.Columns.Add("StyleID", typeof(string));
                        dtStyle.Columns.Add("StyleValue", typeof(string));
                        DataRow drStyle;
                        drStyle               = dtStyle.NewRow();
                        drStyle["StyleID"]    = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]);
                        drStyle["StyleValue"] = Convert.ToString(objfrmDim.SelectDimCombination.ItemArray[5]);
                        dtStyle.Rows.Add(drStyle);
                        cmbStyle.DataSource    = dtStyle;
                        cmbStyle.DisplayMember = "StyleID";
                        cmbStyle.ValueMember   = "StyleValue";
                        cmbConfig.Enabled      = false;
                        cmbCode.Enabled        = false;
                        cmbSize.Enabled        = false;
                        cmbStyle.Enabled       = false;
                    }
                }

                else
                {
                    cmbStyle.Text     = string.Empty;
                    cmbConfig.Text    = string.Empty;
                    cmbCode.Text      = string.Empty;
                    cmbSize.Text      = string.Empty;
                    cmbConfig.Enabled = false;
                    cmbCode.Enabled   = false;
                    cmbSize.Enabled   = false;
                    cmbStyle.Enabled  = false;
                }
                txtPCS.Focus();
                txtPCS.Text = "1";
                SqlConnection conn = new SqlConnection();
                if (application != null)
                {
                    conn = application.Settings.Database.Connection;
                }
                else
                {
                    conn = ApplicationSettings.Database.LocalConnection;
                }

                string sQty = string.Empty;
                sQty = frmOrderDetails.GetStandardQuantityFromDB(conn, Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]));
                if (!string.IsNullOrEmpty(sQty))
                {
                    sQty             = Convert.ToString(decimal.Round(Convert.ToDecimal(sQty), 3, MidpointRounding.AwayFromZero));
                    txtQuantity.Text = Convert.ToString(Convert.ToDecimal(sQty) == 0 ? string.Empty : Convert.ToString(sQty));
                }
                txtItemId.Text   = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMID"]);
                txtItemName.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMNAME"]);
                txtRate.Text     = frmOrderDetails.getRateFromMetalTable(txtItemId.Text, cmbConfig.Text, cmbStyle.Text, cmbCode.Text, cmbSize.Text, txtQuantity.Text);
                //  if (!string.IsNullOrEmpty(txtRate.Text))
                //    cmbRateType.SelectedIndex = cmbRateType.FindStringExact("Tot");
                //  txtRate.Text = Convert.ToString(dsItem.Tables[0].Rows[0]["ITEMPRICE"]).Remove(0, 1).Trim();
                unitid = saleLineItem.BackofficeSalesOrderUnitOfMeasure;
            }
        }