Пример #1
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;
            }
        }
        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;
            }
        }
Пример #3
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;
            }
        }