示例#1
0
        private void btnWh_Click(object sender, RoutedEventArgs e)
        {
            Button             btn = sender as Button;
            ProductMaintenance pm  = new ProductMaintenance();

            pm.id = Convert.ToInt32(btn.Tag.ToString());
            pm.ShowDialog();
            //MessageBox.Show(btn.Tag.ToString());

            //ArchivesOper oper = new ArchivesOper(this);
            //oper.oper = Convert.ToInt32(btn.Tag.ToString());
            //oper.ShowDialog();
        }
示例#2
0
        private void addProductBtn_Click(object sender, EventArgs e)
        {
            product               = new Product();
            _productMaintenance   = new ProductMaintenance(stockInfo);
            product.ProductCode   = productCodeDataTxtBox.Text;
            product.ProductName   = productNameDataTxtBox.Text;
            product.ProductStatus = productStatusComboBox.SelectedIndex;

            _productMaintenance.AddProduct(product);

            MessageBox.Show(_productMaintenance.Message);

            productCodeDataTxtBox.Clear();
            productNameDataTxtBox.Clear();

            // Read the Data from the Products table
            showProductTable();
        }
示例#3
0
        public string DeleteAppView()
        {
            //if (!(Map is DuradosMap && Maps.IsSuperDeveloper(null)))
            //{
            //    Maps.Instance.DuradosMap.Logger.Log("DeleteAppApplication"+SystemInformation.ComputerName, this.ControllerContext.RouteData.Values["action"].ToString(), null, "Accessd by non-super developer in a spesific app", null, 1, null, DateTime.Now);
            //    return "This action is not allowd";
            //}
            ProductMaintenance productMaintenece = new  ProductMaintenance(resultOutput);

            try
            {
                return(productMaintenece.RemoveApps(null, null));
            }
            catch (Exception ex)
            {
                logger.Log("DeleteAppApplication" + SystemInformation.ComputerName, "DeleteAppView", null, ex, 1, null);
                return("An Error occured while tring to delete apps:" + ex.Message);
            }
        }
示例#4
0
        public string DeleteApp(string appId, string appName)
        {
            //if (!(Map is DuradosMap && Maps.IsSuperDeveloper(null)))
            //{
            //    Maps.Instance.DuradosMap.Logger.Log("DeleteAppApplication"+SystemInformation.ComputerName, this.ControllerContext.RouteData.Values["action"].ToString(), null, "Accessd by non-super developer in a spesific app", null, 1, null, DateTime.Now);
            //    return "This action is not allowd";
            //}
            int id;

            int.TryParse(appId, out id);
            if (id <= 0 && string.IsNullOrEmpty(appName))
            {
                return("AppId or App Name could not be parsed.");
            }

            ProductMaintenance productMaintenece = new  ProductMaintenance();

            try
            {
                if (id > 0)
                {
                    productMaintenece.RemoveApp(id);
                }
                else
                {
                    productMaintenece.RemoveApp(appName);
                }

                return("App number " + ((id == 0) ? appName : appId) + " was deleted");
            }
            catch (Exception ex)
            {
                logger.Log("DeleteAppApplication on " + System.Windows.Forms.SystemInformation.ComputerName, "DeleteApp", null, ex, 1, null);
                return("An error occuered while deleteing te app ,message: " + ex.Message);
            }
        }