private void btnCalculate_Click(object sender, EventArgs e)
        {
            try
            {
                if (gridScanArticle.Rows.Count > 1)
                {
                    int    totalOn = gridScanArticle.Cols.Count - 1;
                    string caption = "Total ";



                    // calculate three levels of totals
                    gridScanArticle.SubtotalPosition = C1.Win.C1FlexGrid.SubtotalPositionEnum.BelowData;

                    gridScanArticle.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, 0, totalOn - 1);
                    gridScanArticle.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, 0, totalOn - 2);
                    gridScanArticle.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, 0, totalOn - 3);
                    gridScanArticle.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, 0, totalOn - 4);
                    //gridScanArticle.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, 0, totalOn, caption);
                    //itemgrid.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum, 0, 0, totalOn-4, caption);
                    //itemgrid.FindRow(itemgrid ,0,4,true);

                    gridScanArticle[gridScanArticle.Rows.Count - 1, 4] = caption;
                }
            }

            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lnkArtilceExcel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         string appPath = Path.Combine(Application.StartupPath, "Resources\\ArticleDemo.xlsx");
         //Code is added by irfan for Mantis issue on 09/02/2018===============================
         C1XLBook book = new C1XLBook();
         book.Load(appPath);
         XLSheetCollection sheets       = book.Sheets;
         XLSheet           articleSheet = sheets[0];
         if (articleSheet.Rows.Count > 0)
         {
             if (articleSheet.Rows.Count != 1)
             {
                 for (int i = 1; i <= articleSheet.Rows.Count; i++)
                 {
                     i = 1;
                     articleSheet.Rows.RemoveAt(i);
                 }
                 book.Save(appPath);
             }
         }
         //========================================================================================
         System.Diagnostics.Process.Start(appPath);
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Form will be set for Edit,Save,Update transaction .in Edit mode it will enable all controls and allow to update . in case form is in new mode it will allow for save[add]...
        /// </summary>
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (IsFormvalidate())
                {
                    bool updateNextNo = false;
                    this.supplierModel = new SupplierModel();
                    FillSupplierDataToModel();
                    if (string.IsNullOrEmpty(txtSupplierCode.Text.Trim()))
                    {
                        supplierModel.SupplierCode = GetSupplierCode();
                        updateNextNo = true;
                    }
                    string autoSupplierCode = txtSupplierCode.Text;

                    if ((string.IsNullOrEmpty(editSupplierCode)) ? this.supplierManager.SaveSupplier(this.supplierModel, ref autoSupplierCode) : this.supplierManager.UpdateSupplier(this.supplierModel))
                    {
                        CommonFunc.ShowMessage("Supplier code " + autoSupplierCode + " Supplier details added successfully.", Models.Enums.MessageType.Information);
                        if (updateNextNo == true)
                        {
                            this.commonManager.UpdateNextID(CommonModel.SiteCode, "SU");
                        }
                        clearForm();
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Log(ex, Logger.LogingLevel.Error);
                MessageBox.Show(ex.Message);
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void chkSelectAll_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         if (chkSelectAll.Checked)
         {
             for (int rowArticleCode = 1; rowArticleCode < gridScanArticle.Rows.Count; rowArticleCode++)
             {
                 gridScanArticle.Rows[rowArticleCode][(int)GridColumnArticles.Select] = chkSelectAll.Checked;
             }
         }
         else
         {
             if (GridSelect == false)
             {
                 for (int rowArticleCode = 1; rowArticleCode < gridScanArticle.Rows.Count; rowArticleCode++)
                 {
                     gridScanArticle.Rows[rowArticleCode][(int)GridColumnArticles.Select] = chkSelectAll.Checked;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmArticleStockIn_Load(object sender, EventArgs e)
        {
            txtArticleFilePath.Enabled = false; //vipin
            try
            {
                if (CommonFunc.Themeselect == "Theme 1")
                {
                    ThemeChange();
                }
                this.supplier = (from result in this.commonManager.GetSupplierBySite(CommonModel.SiteCode)
                                 select new DropDownModel
                {
                    Code = result.SupplierCode,
                    Description = result.SupplierName
                }).ToList();
                supplier.Insert(0, new DropDownModel {
                    Code = null, Description = "Select"
                });

                //cmbSupplierName.DataSource = supplier;
                //cmbSupplierName.DisplayMember = "Description";
                //cmbSupplierName.ValueMember = "Code";
                CommonFunc.PopulateComboBoxDataForWindowsForm(ref cmbSupplierName, this.supplier);
                ResetArticleStockInData();
                // CommonFunc.WriteResourceFile(this);
                //  CommonFunc.SetCultureFromResource(this);
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 6
0
 private void btnApplyAll_Click(object sender, EventArgs e)
 {
     try
     {
         if (IsFormValidate())
         {
             int gridCount = gridBarcode.Rows.Count;
             if (gridCount > 1)
             {
                 if (pnlHierchy.Visible == true && gridBarcode.Rows.Count > 1)
                 {
                     for (int i = 1; i <= gridBarcode.Rows.Count - 1; i++)
                     {
                         gridBarcode.Rows[i][(int)enumBarcode.NoOfPrints] = Convert.ToInt32(txtNoOfPts.Text.ToString());
                     }
                 }
             }
             else
             {
                 CommonFunc.ShowMessage("Data does Not Exist", MessageType.Information);
             }
         }
     }
     catch (System.Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (ValidateArticleStock())
                {
                    if (CommonFunc.ShowMessage("Are you sure? The stock quantity will be updated in the system.", Models.Enums.MessageType.OKCancel) == DialogResult.OK)
                    {
                        articleStockOutModel = new ArticleStockOutModel();
                        articleStockOutModel.StockOutReason = GetStockOutReason();
                        if (cmbFromLocation.SelectedIndex != -1)
                        {
                            articleStockOutModel.StockFromLocation = GetStockFromLocation();
                        }

                        articleStockOutModel.OrderDtlModels = FillOrderDtlDataToModel();
                        articleStockOutModel.Reason         = txtRemark.Text.Trim();

                        this.articleStockManager.SaveArticleStockOutData(articleStockOutModel);

                        CommonFunc.ShowMessage("Stock Quantity has been updated", MessageType.Information);
                        ResetArticleStockOutData();
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 8
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     selectedItemNode = new List <ItemHierarchy>();
     try
     {
         if (ShowCheckBox)
         {
             FillCheckedNodes(treeView1.Nodes[0]);
         }
         else
         {
             selectedItemNode.Add(this.itemHierarchyList.Where(a => (a.Nodecode ?? "") == (string)treeView1.SelectedNode.Tag).ToList().FirstOrDefault());
             if (selectedItemNode[0] == null)
             {
                 MessageBox.Show("Please select Items from the Hierarchy");
                 return;
             }
             if (AllowedOnlyLastNodeSelection && !(bool)selectedItemNode[0].ISThisLastNode)
             {
                 CommonFunc.ShowMessage(" Please select the Last Node which has no child nodes associated ", MessageType.Information);
                 return;
             }
         }
         DialogResult = System.Windows.Forms.DialogResult.OK;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 9
0
 private void frmSiteDetails_Load(object sender, EventArgs e)
 {
     try
     {
         if (CommonFunc.Themeselect == "Theme 1")
         {
             ThemeChange();
         }
         this.tenderActionButton.btnSave.Click   += new System.EventHandler(btnSave_Click);
         this.tenderActionButton.btnCancel.Click += new System.EventHandler(btnCancel_Click);
         this.tenderActionButton.btnClear.Click  += new EventHandler(btnClear_Click);
         fillCountries();
         fillCurrencies();
         setTabIndex();
         setInitialFormsValidations();
         // CommonFunc.WriteResourceFile(this);
         CommonFunc.SetCultureFromResource(this);
         lblTaxNo.Text = "GSTNo.";
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtScanArticle_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter && !string.IsNullOrEmpty(txtScanArticle.Text.Trim()))
                {
                    var articleCodes = new List <string>();
                    articleCodes.Add(txtScanArticle.Text.Trim());

                    var selectedArticles = this.articleManager.GetArticlePurchaseList(string.Empty, articleCodes);

                    if (selectedArticles != null && selectedArticles.Count > 0)
                    {
                        var articleDefaultEan     = this.commonManager.GetDefaultEANbyArticle(txtScanArticle.Text.Trim());
                        var selectedArticlesfirst = articleDefaultEan.Select(x => x.EAN);
                        foreach (var item in selectedArticles)
                        {
                            item.EAN = selectedArticlesfirst.First();
                        }
                        AddSelectedArticlesIntoGrid(selectedArticles);
                    }
                    txtScanArticle.Value = string.Empty;
                }
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 11
0
        private void FilterCreditSales()
        {
            try
            {
                using (var context = Spectrum.DAL.ContextFactory.CreateContext())

                // using (var context = Spectrum.DAL.ContextFactory.CreateContext())
                {
                    var query = (from t in context.MstTax join tm in context.TaxSiteDocMap on t.TaxCode equals tm.TaxCode where t.STATUS == true && tm.STATUS == true select new { t.TaxCode, t.TaxName, t.Value, t.Type, tm.DocumentType }).ToList();

                    dgTax.Rows.RemoveRange(1, dgTax.Rows.Count - 1);
                    foreach (var item in query)
                    {
                        if (item.TaxName.ToUpper().Contains(txtSearch.Text.Trim().ToUpper()) || item.DocumentType.ToUpper().Contains(txtSearch.Text.Trim().ToUpper()))
                        {
                            dgTax.Rows.Add();
                            dgTax.Rows[dgTax.Rows.Count - 1][(int)enumTax.TaxCode]      = item.TaxCode.ToString();
                            dgTax.Rows[dgTax.Rows.Count - 1][(int)enumTax.DocumentType] = item.DocumentType.ToString();
                            dgTax.Rows[dgTax.Rows.Count - 1][(int)enumTax.TaxName]      = item.TaxName.ToString();
                            dgTax.Rows[dgTax.Rows.Count - 1][(int)enumTax.TaxValue]     = Convert.ToDecimal(item.Value);
                            dgTax.Rows[dgTax.Rows.Count - 1][(int)enumTax.TaxValueType] = item.Type.ToString();
                        }
                    }
                }



                DefaultGridSetting();
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
            }
        }
Ejemplo n.º 12
0
        private void onTouchKeyBoard()
        {
            try
            {
                using (var context = Spectrum.DAL.ContextFactory.CreateContext())
                {
                    var query = (from t in context.DefaultConfig where t.Sitecode == CommonModel.SiteCode && t.STATUS == true && t.FldLabel == "AllowOnScreenKeyBoard" select t.FldValue).SingleOrDefault();
                    if (query.ToUpper() == "TRUE")
                    {
                        var processs = Process.GetProcessesByName("osk");

                        if (processs.Length == 0)
                        {
                            Process.Start("osk");
                        }
                        else
                        {
                            foreach (Process processShow in Process.GetProcessesByName("osk"))
                            {
                                if (processShow.ProcessName == "osk")
                                {
                                    processShow.Kill();
                                    Process.Start("osk");
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
            }
        }
Ejemplo n.º 13
0
 private void txtLevel_MouseClick(object sender, MouseEventArgs e)
 {
     try
     {
         using (frmItemHierarchyPopup objItemHierarchyPopup = new frmItemHierarchyPopup())
         {
             if (objItemHierarchyPopup.ShowDialog() == DialogResult.OK)
             {
                 NodeCode = "";
                 var _selectedItemNode = objItemHierarchyPopup.selectedItemNode;
                 if (_selectedItemNode[0] != null)
                 {
                     if (_selectedItemNode[0].NodeName != null)
                     {
                         txtLevel.Text = _selectedItemNode[0].NodeName;
                         NodeCode      = _selectedItemNode[0].Nodecode;
                     }
                 }
                 else
                 {
                     txtLevel.Text = "";
                 }
             }
             objItemHierarchyPopup.Dispose();
         }
     }
     catch (System.Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 14
0
        private void dgTax_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                int gridCount = dgTax.Rows.Count;
                if (gridCount > 1)
                {
                    clearForm();
                    taxCode = dgTax.Rows[dgTax.Row][1].ToString();
                    doc     = dgTax.Rows[dgTax.Row][2].ToString();
                    taxName = dgTax.Rows[dgTax.Row][3].ToString();
                    if (taxCode != "Tax Code")
                    {
                        TaxModel           taxdata       = new TaxModel();
                        TaxSiteDocMapModel taxsitedocmap = new TaxSiteDocMapModel();
                        taxdata       = this.taxManager.GetTaxByID(taxCode);
                        taxsitedocmap = this.taxManager.GetTaxByDoc(taxCode, doc);
                        if (taxdata != null)
                        {
                            txtTaxName.Text               = taxdata.TaxName;
                            txtTaxValue.Value             = taxdata.Value;
                            cmbDocumentType.SelectedValue = taxsitedocmap.DocumentType;
                            cmbAppliedon.SelectedValue    = taxsitedocmap.Appliedon;
                            if (taxdata.Type == "Per")
                            {
                                rdoTVTPercent.Checked = true;
                            }
                            else
                            {
                                rdoTVTValue.Checked = true;
                            }

                            if (taxdata.Inclusive == true)
                            {
                                rdoTaxInclusive.Checked = true;
                            }
                            else
                            {
                                rdoTaxExclusive.Checked = true;
                            }

                            if (taxdata.InterStateTax == true)
                            {
                                chkInterStateTax.Checked = true;
                            }
                            else
                            {
                                chkInterStateTax.Checked = false;
                            }
                            flag = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 15
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     if (CommonFunc.ShowMessage("All the data entered by you shall be cleared. Do You wish to proceed?", Models.Enums.MessageType.OKCancel) == DialogResult.OK)
     {
         clearForm();
     }
 }
Ejemplo n.º 16
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     if (CommonFunc.ShowMessage("Are You Sure? All the changes will be lost", MessageType.OKCancel) == DialogResult.OK)
     {
         this.Close();
         this.Dispose();
     }
 }
Ejemplo n.º 17
0
        private void btnAddArticle_Click(object sender, EventArgs e)
        {
            try
            {
                bool isValid = true;
                if (!CommonFunc.SetErrorProvidertoControlForWindowsForm(ref Itemerrorprovider, ref cmbStockOutReason, "Stock Out Reason required"))
                {
                    this.cmbStockOutReason.Focus();
                    isValid = false;
                }
                if ((string)cmbStockOutReason.SelectedValue == "SupplierReturn" || (string)cmbStockOutReason.SelectedValue == "WriteOff")
                {
                    if (!CommonFunc.SetErrorProvidertoControlForWindowsForm(ref Itemerrorprovider, ref cmbFromLocation, "From Location Reason required"))
                    {
                        this.cmbFromLocation.Focus();
                        isValid = false;
                    }
                }

                if (!isValid)
                {
                    return;
                }
                string supplierCode = "";
                if (cmbSupplierName.SelectedValue != null)
                {
                    supplierCode = (cmbSupplierName.SelectedValue != "Select") ? cmbSupplierName.SelectedValue.ToString() : string.Empty;
                }
                var articleList = this.articleManager.GetArticlePurchaseList(supplierCode);



                frmCommonSearchTrueGrid objSearch = new frmCommonSearchTrueGrid(multipleSelect: true, defaultFilter: false);
                DataTable dtItems = CommonFunc.ConvertListToDataTable(articleList);

                objSearch.Text           = "Item Search";
                objSearch.boolWildSearch = true;
                objSearch.dtcommonSearch = dtItems;
                DataTable dtSelectedItems = new DataTable();

                if (objSearch.ShowDialog() == DialogResult.OK)
                {
                    dtSelectedItems = objSearch.dtSelectedList;
                    //  List<ArticlePurchaseModel> selectedIArticleList = DataTableToList.ConvertDataTableToList<ArticlePurchaseModel>(dtSelectedItems);
                    List <ArticlePurchaseStockoutModel> selectedIArticleList = DataTableToList.ToList <ArticlePurchaseStockoutModel>(dtSelectedItems);

                    AddSelectedArticlesIntoGrid(selectedIArticleList);
                }
                objSearch.Dispose();
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 18
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            try
            {
                if ((IsFormvalidate()))
                {
                    TenderModel tendermodel = new TenderModel();
                    tendermodel.TenderHeadCode = txtTenderCode.Text.Trim();
                    tendermodel.TenderHeadName = txtTenderName.Text.Trim();

                    if (chkRefundIssue.Checked == false && chkReturnedIssue.Checked == false)
                    {
                        tendermodel.Positive_Negative = "+";
                    }
                    else if (chkRefundIssue.Checked == true && chkReturnedIssue.Checked == true)
                    {
                        tendermodel.Positive_Negative = "*";
                    }
                    else if (chkRefundIssue.Checked == true)
                    {
                        tendermodel.Positive_Negative = "*";
                    }
                    else if (chkReturnedIssue.Checked == true)
                    {
                        tendermodel.Positive_Negative = "-";
                    }

                    tendermodel.SiteCode   = CommonModel.SiteCode;
                    tendermodel.TenderType = cboTenderType.SelectedValue.ToString();
                    if (cboProgramCode.SelectedIndex != -1)
                    {
                        tendermodel.ProgramId = cboProgramCode.SelectedValue.ToString();
                    }

                    bool status = false;

                    status = this.tenderManager.SaveTender(tendermodel);

                    if (status == true)
                    {
                        CommonFunc.ShowMessage(tendermodel.TenderHeadName + " Tender Saved Successfully.", MessageType.Information);
                        Fillgrid();
                    }
                    else
                    {
                        CommonFunc.ShowMessage("Error!!!", MessageType.Information);
                    }
                    clearForm();
                }
            }
            catch (System.Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 19
0
 private void dtpInvoiceDate_ValueChanged(object sender, EventArgs e)
 {
     if (!(dtpInvoiceDate.Text.ToString().Equals("")))
     {
         if (validateDate() == false)
         {
             CommonFunc.ShowMessage("Invoice Date cannot be back dated.", MessageType.Information);
             dtpInvoiceDate.Text = "";
         }
     }
 }
Ejemplo n.º 20
0
 private void btnCancel_Click(object sender, System.EventArgs e)
 {
     //if (!string.IsNullOrEmpty(txtSupplierCode.Text) || !string.IsNullOrEmpty(txtName.Text) ||  !string.IsNullOrEmpty(txtContactPerson.Text))
     //{
     if (CommonFunc.ShowMessage("All the data entered by you shall be cleared. Do You wish to proceed?", Models.Enums.MessageType.OKCancel) == DialogResult.Cancel)
     {
         return;
     }
     //}5
     //   this.Dispose();
     this.Close();
 }
Ejemplo n.º 21
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     try
     {
         ResetArticleStockOutData();
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnArticleDelete_Click(object sender, EventArgs e)
        {
            try
            {
                bool rowDeleted   = false;
                var  articleCodes = new List <string>();
                if (gridScanArticle.Rows.Count == 1)
                {
                    return;
                }

                for (int rowIndex = 1; rowIndex < gridScanArticle.Rows.Count; rowIndex++)
                {
                    if (Convert.ToBoolean(gridScanArticle.Rows[rowIndex][(int)GridColumnArticles.Select]))
                    {
                        if (gridScanArticle.Rows[rowIndex][(int)GridColumnArticles.ArticleCode] != null)
                        {
                            rowDeleted = true;
                            articleCodes.Add(gridScanArticle.Rows[rowIndex][(int)GridColumnArticles.ArticleCode].ToString());
                        }
                    }
                }

                if (!rowDeleted)
                {
                    CommonFunc.ShowMessage("Please select at least one item.", MessageType.Information);
                    return;
                }
                else
                {
                    if (CommonFunc.ShowMessage("The selected record(s) will be deleted. Are you sure?", MessageType.OKCancel) == DialogResult.OK)
                    {
                        var articleList = ArticleStockList.Where(a => articleCodes.Contains(a.ArticleCode)).ToList();

                        for (int iRow = 0; iRow < articleList.Count(); iRow++)
                        {
                            ArticleStockList.Remove(articleList[iRow]);
                        }

                        gridScanArticle.DataSource = ArticleStockList.ToList();
                        DefaultGridSetting();

                        chkSelectAll.Checked = false;
                    }
                }
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 23
0
 private void txtCurrencyCode_TextChanged(object sender, EventArgs e)
 {
     try
     {
         txtCurrencyCode.Text = txtCurrencyCode.Text;
         txtCurrencyCode.AutoCompleteCustomSource = currencyCollection;
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 24
0
        private void btnArticleDelete_Click(object sender, EventArgs e)
        {
            try
            {
                bool rowDeleted = false;
                for (int rowBarCode = 1; rowBarCode < dgTax.Rows.Count; rowBarCode++)
                {
                    if (Convert.ToBoolean(dgTax.Rows[rowBarCode][(int)enumTax.Select]) == true)
                    {
                        rowDeleted = true;
                        break;
                    }
                }
                if (rowDeleted == false)
                {
                    if (dgTax.Rows.Count > 1)
                    {
                        CommonFunc.ShowMessage("Please select at least 1 record to delete", Models.Enums.MessageType.Information);
                    }
                    else
                    {
                        CommonFunc.ShowMessage("No Record found", Models.Enums.MessageType.Information);
                    }
                    return;
                }
                if (CommonFunc.ShowMessage("The selected record(s) will be deleted. Are you sure?” ", Models.Enums.MessageType.OKCancel) == DialogResult.OK)
                {
                    int  ArticleCodeRowCount  = dgTax.Rows.Count;
                    var  deleteArticleCodeRow = new List <C1.Win.C1FlexGrid.Row>();
                    bool status = false;
                    for (int row = 1; row < ArticleCodeRowCount; row++)
                    {
                        if (Convert.ToBoolean(dgTax.Rows[row][(int)enumTax.Select]) == true)
                        {
                            //status = this.taxManager.DeleteByID(dgTax.Rows[row][(int)enumTax.TaxCode].ToString());
                            status = this.taxManager.DeleteByID(dgTax.Rows[row][(int)enumTax.TaxCode].ToString(), dgTax.Rows[row][(int)enumTax.DocumentType].ToString());
                        }
                    }

                    Fillgrid();

                    chkAll.Checked = false;
                }
            }
            catch (Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 25
0
        private void btnSave_Click(object sender, System.EventArgs e)
        {
            try
            {
                if ((IsFormValidate()))
                {
                    SiteDALModel siteDalModel = new SiteDALModel();
                    siteDalModel.SiteModel       = FillSiteModel();
                    siteDalModel.MstFinYearModel = FillFinYearModel();

                    bool Status = false;
                    if (flagAddEdit == true)
                    {
                        Status = this.siteManager.UpdateSite(siteDalModel.SiteModel, siteDalModel.MstFinYearModel);
                        if (Status == true)
                        {
                            CommonFunc.ShowMessage("Site " + txtSiteCode.Text.Trim() + " Updated Successfully", MessageType.Information);
                        }
                        else
                        {
                            CommonFunc.ShowMessage("Error!!!", MessageType.Information);
                        }
                    }
                    else
                    {
                        siteDalModel.MstAreaCodeModel        = FillAreaCodeModel();
                        siteDalModel.MstCurrencySiteModel    = FillCurrencyModel();
                        siteDalModel.MstSiteCurrancyMapModel = FillSiteCurrancyMapModel();
                        Status = this.siteManager.SaveSite(siteDalModel);

                        if (Status == true)
                        {
                            CommonFunc.ShowMessage("Site " + txtSiteCode.Text.Trim() + " Added Successfully", MessageType.Information);
                        }
                        else
                        {
                            CommonFunc.ShowMessage("Error!!!", MessageType.Information);
                        }
                    }

                    clearForm();
                }
            }
            catch (System.Exception ex)
            {
                CommonFunc.ShowMessage(ex.Message, MessageType.Information);
                Logger.Log(ex.Message, Logger.LogingLevel.Error);
            }
        }
Ejemplo n.º 26
0
 private void btnClear_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (CommonFunc.ShowMessage("Are You Sure? All entered data will be clear", Models.Enums.MessageType.OKCancel) == DialogResult.OK)
         {
             clearForm();
         }
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 27
0
 private void chkSelectAll_CheckedChanged_1(object sender, EventArgs e)
 {
     try
     {
         for (int rowArticleCode = 1; rowArticleCode < gridBarcode.Rows.Count; rowArticleCode++)
         {
             gridBarcode.Rows[rowArticleCode][(int)enumBarcode.Exclude] = chkSelectAll.Checked;
         }
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 28
0
 private void btnClear_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (CommonFunc.ShowMessage("All the data entered by you shall be cleared. Do You wish to proceed?", Models.Enums.MessageType.OKCancel) == DialogResult.OK)
         {
             clearForm();
         }
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 29
0
 private void btnCancel_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (CommonFunc.ShowMessage("All the data entered will be lost. Do you wish to proceed?", Models.Enums.MessageType.OKCancel) == DialogResult.OK)
         {
             this.Dispose();
             this.Close();
         }
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }
Ejemplo n.º 30
0
 private void chkAll_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         var chk = chkAll.Checked;
         for (int rowArticleCode = 1; rowArticleCode < dgTax.Rows.Count; rowArticleCode++)
         {
             dgTax.Rows[rowArticleCode][(int)enumTax.Select] = chk;
         }
     }
     catch (Exception ex)
     {
         CommonFunc.ShowMessage(ex.Message, MessageType.Information);
         Logger.Log(ex.Message, Logger.LogingLevel.Error);
     }
 }