Ejemplo n.º 1
0
        private void btnGetData_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsFormValidate())
                {
                    int gridCount = gridBarcode.Rows.Count;
                    if (gridCount > 1)
                    {
                        gridBarcode.Rows.RemoveRange(1, gridBarcode.Rows.Count - 1);
                    }
                    ArticleManager         articleHierarchyManager = new ArticleManager();
                    ArticleDataExportModel articleDataExportModel  = articleHierarchyManager.GetArticleExportData(NodeCode, CommonModel.SiteCode);

                    if (cboBarCodeType.SelectedValue != null)
                    {
                        //   articleDataExportModel.ArticleDetails = articleDataExportModel.ArticleDetails.Where(x => x.DISCRIPTION == cboBarCodeType.SelectedValue.ToString()).ToList();
                        articleDataExportModel.ArticleDetails = articleDataExportModel.ArticleDetails.Where(x => x.BarcodeType == cboBarCodeType.SelectedValue.ToString()).ToList();  //vipin
                    }
                    if (articleDataExportModel.ArticleDetails.Count > 0)
                    {
                        btnExport.Visible = true;
                        foreach (var item in articleDataExportModel.ArticleDetails)
                        {
                            gridBarcode.Rows.Add();
                            gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.ItemCode] = item.ArticleCode.ToString();
                            // gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.EAN] = item.EAN.ToString();
                            gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.EAN]             = item.Barcode.ToString();
                            gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.ItemDescription] = item.ArticleShortName.ToString();
                            // gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.BarcodeType] = item.DISCRIPTION.ToString();
                            gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.BarcodeType] = item.BarcodeType.ToString();  //vipin
                            gridBarcode.Rows[gridBarcode.Rows.Count - 1][(int)enumBarcode.Exclude]     = false;
                        }
                    }
                    else
                    {
                        btnExport.Visible = false;
                        CommonFunc.ShowMessage("Data Not Exist", MessageType.Information);
                    }
                }
            }
            catch (System.Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }