コード例 #1
0
        public ActionResult AddItemToOrder(AddItemToOrderModel obj)
        {
            MessageModel model = new MessageModel();

            OrderBusinessLogic objOrderBusinessLogic = new OrderBusinessLogic();

            try
            {
                objOrderBusinessLogic.AddItemToOrder(obj);
                model.Message = "Item added in Order successfully";
            }
            catch (System.Exception ex)
            {
                model.Message = "An error has occured while adding Item to Order";
                model.Type    = Enumeration.MessageType.Error;
                logger.Error(model.Message, ex);
            }

            var response = new
            {
                //Status = updatedStatus,
                MessageModel = model
            };

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        /// <summary>
        /// 单击选项卡事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            if (this.tabControl1.SelectedIndex == 1)
            {
                List <Order> orderlist = orderBusinessLogic.GetOrderByStatus("未提交");
                this.dgvOrder.DataSource = orderlist;
            }
            else
            if (this.tabControl1.SelectedIndex == 2)
            {
                List <Order> submitOrderlist = orderBusinessLogic.GetOrderByStatus("未审核");
                this.dgvSubmitOrder.DataSource = submitOrderlist;
            }
            else
            if (this.tabControl1.SelectedIndex == 3)
            {
                List <Order> passOrderlist = orderBusinessLogic.GetOrderByStatus("审核通过");
                this.dgvPassOrder.DataSource = passOrderlist;
            }
            else
            if (this.tabControl1.SelectedIndex == 4)
            {
                List <Order> noPassOrderlist = orderBusinessLogic.GetOrderByStatus("不通过");
                this.dgvNoPassOrder.DataSource = noPassOrderlist;
            }
        }
コード例 #3
0
        public void loadOrderList()
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
            List <Order>       orderlist          = orderBusinessLogic.GetOrderByStatus("已发送");

            dataGridView1.DataSource = orderlist;
        }
コード例 #4
0
ファイル: ControllerTests.cs プロジェクト: tobsc/FHTW-BA2-BIF
        protected ControllerTests()
        {
            var mockPrincipal = new Mock <IBusinessLogicPrincipal>();

            mockPrincipal.Setup(x => x.IsAllowed).Returns(true);
            mockPrincipal.Setup(x => x.IsAdmin).Returns(true);
            mockPrincipal.Setup(x => x.IsVerwalter).Returns(false);
            mockPrincipal.Setup(x => x.CurrentUid).Returns("if15b032");
            var abl  = new AccessoryBusinessLogic(Dal, mockPrincipal.Object);
            var cbl  = new CustomFieldsBusinessLogic(Dal, mockPrincipal.Object);
            var dbl  = new DamageBusinessLogic(Dal, mockPrincipal.Object);
            var debl = new DeviceBusinessLogic(Dal, mockPrincipal.Object);
            var blbl = new BusinessLogic.BusinessLogic(Dal, mockPrincipal.Object);
            var obl  = new OrderBusinessLogic(Dal, mockPrincipal.Object);
            var sbl  = new SettingBusinessLogic(Dal, mockPrincipal.Object);
            var ubl  = new UserBusinessLogic(Dal, mockPrincipal.Object);

            Bl = new BusinessLogicFacade(Dal, blbl, abl, cbl, dbl, debl, obl, sbl, ubl);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            var subject = new ClaimsIdentity("Federation", ClaimTypes.Name, ClaimTypes.Role);

            subject.AddClaim(new Claim(ClaimTypes.Role, "Admin", ClaimValueTypes.String));
            subject.AddClaim(new Claim(ClaimTypes.Name, "if15b032", ClaimValueTypes.String));
            _controllerContext = new ControllerContext
            {
                HttpContext = new DefaultHttpContext
                {
                    User = new ClaimsPrincipal(subject)
                }
            };
        }
コード例 #5
0
        public ActionResult Process(int orderId)
        {
            OrderBusinessLogic objOrderBusinessLogic = new OrderBusinessLogic();
            var model = objOrderBusinessLogic.GetOrderDetail(orderId, true);

            return(View(model));
        }
コード例 #6
0
        public ActionResult DispatchItemInOrder(long orderDetailId)
        {
            MessageModel model = new MessageModel();

            OrderBusinessLogic objOrderBusinessLogic = new OrderBusinessLogic();

            try
            {
                objOrderBusinessLogic.DispatchItemInOrder(orderDetailId);
                model.Message = "Item dispatch successfully";
            }
            catch (System.Exception ex)
            {
                model.Message = "An error has occured while adding Item to Order";
                model.Type    = Enumeration.MessageType.Error;
                logger.Error(model.Message, ex);
            }

            var response = new
            {
                OrderDetailId = orderDetailId,
                MessageModel  = model
            };

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
        public void loadOrderList()
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
            List <Order>       orderlist          = orderBusinessLogic.GetOrderByStatusAndCreator("已发送", user.RealName);

            dataGridView1.DataSource = orderlist;
        }
コード例 #8
0
        public ActionResult GetOrders([DataSourceRequest] DataSourceRequest request)
        {
            OrderBusinessLogic obj      = new OrderBusinessLogic();
            DataSourceResult   lstItems = obj.GetOrders(request);

            return(Json(lstItems, JsonRequestBehavior.AllowGet));
        }
コード例 #9
0
        public CheckFrom(string orderID, Users user)
        {
            MORBusinessLogic   mORBusinessLogic   = new MORBusinessLogic();
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            InitializeComponent();
            this.orderID = orderID;
            this.user    = user;
            Order order = orderBusinessLogic.GetOrderByID(orderID);

            txbOrderId.Text          = order.OrderNumber;
            txbDepartment.Text       = order.Department;
            txbCreator.Text          = order.Creator;
            txbStatus.Text           = order.Status;
            txbProvider.Text         = order.Provider;
            dtpOrderTime.Text        = order.InputDate.ToString();
            label7.Text              = order.TotalMoney.ToString();
            this.dt                  = mORBusinessLogic.GetMOR(orderID);
            dgvOrderCheck.DataSource = this.dt;
            if (user.Remark == "班组")
            {
                btnSubmit.Visible = false;
            }
            setColumn();
        }
コード例 #10
0
        public ActionResult AddToOrderPartial(int itemId = 0)
        {
            OrderBusinessLogic bl = new OrderBusinessLogic();
            var view = bl.GetItemFromOrder(itemId);

            return(PartialView("_AddToOrder", view));
        }
コード例 #11
0
        public JsonResult InsertOrder(Order order, int num)
        {
            Order o       = new Order();
            var   orderBL = new OrderBusinessLogic(new OrderDataAccess());

            var datos = Json(orderBL.InsertOrder(order));

            return(datos);
        }
コード例 #12
0
        public static String ProcessCPShipto(String _so, String _sopo, Boolean _istesting)
        {
            System.Net.Mail.SmtpClient smtpClient1 = new System.Net.Mail.SmtpClient(ConfigurationManager.AppSettings["SMTPServer"]);

            Ship_to_Information ship_info = GetShipToInfo_BySOPO(_sopo).FirstOrDefault();

            DataAccess.SAPModel.SAPAccount s = new DataAccess.SAPModel.SAPAccount();

            s.SoldtoID        = "UZISCHE01";
            s.ShiptoID        = OrderBusinessLogic.GenerateNewUSShipToID(ship_info.ship_to_country_code, ship_info.ship_to_stateName, ship_info.ship_to_name, _istesting);
            s.CompanyName     = ship_info.ship_to_name;
            s.CountryCode     = ship_info.ship_to_country_code;
            s.OrgID           = "US01";
            s.City            = ship_info.ship_to_city;
            s.Address         = ship_info.ship_to_address;
            s.Region          = ship_info.ship_to_stateName;
            s.PostalCode      = ship_info.ship_to_postal_code;
            s.TEL             = ship_info.ship_to_telnumber;
            s.VatNumber       = ship_info.ship_to_country_code.Equals("US", StringComparison.CurrentCultureIgnoreCase) ? GetVATNumber(ship_info.ship_to_stateName) : " ";
            s.Currency        = GetSoDetail_Currency(_so);
            s.TaxJurisdiction = ship_info.ship_to_country_code.Equals("US", StringComparison.CurrentCultureIgnoreCase) ? ship_info.ship_to_stateName + ship_info.ship_to_postal_code.Substring(0, 5) : " ";
            s.Creator         = "VALERIE.MO";
            s.CreateDate      = DateTime.Now.ToString("yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture);
            s.SalesGroupCode  = " ";
            s.SalesOfficeCode = "2200";
            s.ContactPerson   = ship_info.contact_person_first + ship_info.contact_person_last;

            DataAccess.SAPModel.SAPShipTo _objShipTo = CheckShiptoExistSAP(s.Address, s.ShiptoID);
            if (_objShipTo != null)
            {
                // Ship-to ID has already existed in SAP, return the exist one
                return(_objShipTo.SHIPTOID);
            }
            else
            {
                // Ship-to ID is not existed, need to create a new one.
                try
                {
                    DataAccess.SAPDAL.CreateUSShiptoAccount(s, _istesting); // Auto Creation
                    System.Threading.Thread.Sleep(3000);
                    DataAccess.SAPDAL.UpdateSAPSalesAreaData(s.SoldtoID, s.ShiptoID, s.OrgID, _istesting);

                    // Send Mail to Javian
                    smtpClient1.Send("*****@*****.**", "[email protected],[email protected],[email protected],[email protected]",
                                     string.Format("Check Point Auto-Create Shipto,  NewERPID: {0}", s.ShiptoID),
                                     string.Format("NewERPID: {0}", s.ShiptoID) + "\r\nTime: " + DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"));
                }
                catch (Exception ex)
                {
                    String errmsg = ex.ToString();
                }
                return(!String.IsNullOrEmpty(s.ShiptoID) ? s.ShiptoID : "");
            }
        }
コード例 #13
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            //ColumnIndex == 0是验收一列
            if (e.ColumnIndex == 0 && e.RowIndex != -1)
            {
                string    orderID   = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();//id在cells[1]这一列
                CheckFrom checkForm = new CheckFrom(orderID, user);
                checkForm.ShowDialog();
                this.dataGridView1.DataSource = orderBusinessLogic.GetOrderByStatus("已发送");
            }
        }
コード例 #14
0
        /// <summary>
        /// 单击操作列触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvOrder_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();

            //单击编辑执行的操作
            if (e.ColumnIndex == 0 && e.RowIndex != -1)
            {
                string        orderID       = this.dgvOrder.Rows[e.RowIndex].Cells[3].Value.ToString();
                OrderEditForm orderEditForm = new OrderEditForm(orderID, user);
                orderEditForm.ShowDialog();
                this.dgvOrder.DataSource = orderBusinessLogic.GetOrderByStatus("未提交");
            }
            //单击删除执行的操作
            if (e.ColumnIndex == 1 && e.RowIndex != -1)
            {
                DialogResult result = MessageBox.Show("确定删除此订单?", "提示", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    string orderID = this.dgvOrder.Rows[e.RowIndex].Cells[3].Value.ToString();
                    orderBusinessLogic.DeleteOrderById(orderID);//删除已经做级联
                    MessageBox.Show("删除成功!");
                    this.dgvOrder.DataSource = orderBusinessLogic.GetOrderByStatus("未提交");
                }
                else
                {
                    MessageBox.Show("删除取消!");
                }
            }
            //单击提交执行的操作
            if (e.ColumnIndex == 2 && e.RowIndex != -1)
            {
                //OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
                DialogResult result = MessageBox.Show("确定提交此订单?", "提示", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    string orderID = this.dgvOrder.Rows[e.RowIndex].Cells[3].Value.ToString();
                    Order  order   = orderBusinessLogic.GetOrderByID(orderID);
                    order.Status    = "未审核";
                    order.InputDate = System.DateTime.Now;
                    orderBusinessLogic.UpdataOrder(order);
                    MessageBox.Show("提交成功!");
                    this.dgvOrder.DataSource = orderBusinessLogic.GetOrderByStatus("未提交");
                }
                else
                {
                    MessageBox.Show("提交取消!");
                }
            }
        }
コード例 #15
0
 public OrderEditForm(string orderID, Users user)
 {
     this.orderBusinessLogic = new OrderBusinessLogic();
     this.mORBusinessLogic   = new MORBusinessLogic();
     InitializeComponent();
     this.user               = user;
     order                   = this.orderBusinessLogic.GetOrderByID(orderID);
     txbGroup.Text           = order.Department;
     txbCreator.Text         = order.Creator;
     txbStatus.Text          = order.Status;
     dtpOrderTime.Text       = order.InputDate.ToString();
     txbRemark.Text          = order.Remark;
     menuOrder_RList         = this.mORBusinessLogic.GetMORByOrderID(orderID);
     dgvOrderEdit.DataSource = menuOrder_RList;
     setColumn();
 }
コード例 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Order _order = new Order();

            _order.OrgID       = "US01";
            _order.Currency    = "USD";
            _order.DistChannel = "30";
            _order.Division    = "20";
            _order.District    = "D35";
            _order.SetOrderPartnet(new OrderPartner("UAGI5001", "US01", OrderPartnerType.SoldTo));
            _order.SetOrderPartnet(new OrderPartner("UAGI5001", "US01", OrderPartnerType.ShipTo));
            _order.RequireDate = DateTime.Now;
            _order.PODate      = new DateTime(2015, 1, 19);

            //_order.AddLooseItem("PCA-6011G2-00A1E");
            //_order.AddLooseItem("ADAM-4520-EE", 2);

            Product _LineItem = new Product();

            _LineItem.PartNumber   = "ADAM-4520-EE";
            _LineItem.SellingPrice = 90;
            _LineItem.Quantity     = 2;
            _LineItem.PlantID      = "USH1";
            _LineItem.RequireDate  = DateTime.Now;

            _order.AddLooseItem(_LineItem);

            String _errmsg = string.Empty;


            bool _IsSuccess = OrderBusinessLogic.ConvertMyAdvantechCartToSAPOrder("AUSO018986", "US01", ref _errmsg, false, "", false);



            //SAPDAL.CreateOrder(ref _order, DateTime.Now, true, ref _errmsg);

            this.GVPart.DataSource = _order.LineItems;
            this.GVPart.DataBind();

            this.GVConvertOrderResult.DataSource = _order.ConvertToOrderResult;
            this.GVConvertOrderResult.DataBind();

            int a = 3;
        }
コード例 #17
0
        //加载订单数据
        public void loadMenu()
        {
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
            List <Order>       orderlist          = orderBusinessLogic.GetOrderByStatus("未提交");

            dgvOrder.DataSource = orderlist;
            List <Order> submitOrderlist = orderBusinessLogic.GetOrderByStatus("未审核");

            dgvSubmitOrder.DataSource = submitOrderlist;
            List <Order> passOrderlist = orderBusinessLogic.GetOrderByStatus("审核通过");

            dgvPassOrder.DataSource = passOrderlist;
            List <Order> noPassOrderlist = orderBusinessLogic.GetOrderByStatus("不通过");

            this.dgvNoPassOrder.DataSource = noPassOrderlist;
            List <Model.Menu> menuList = menuBusinessLogic.GetAllMenu();

            dgvMenu.DataSource = menuList;
        }
コード例 #18
0
 public OrderController()
 {
     _business = new OrderBusinessLogic();
     _product  = new ProductBusinessLogic();
 }
コード例 #19
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("确定验收后此订单不可更改!\n是否确定?", "提示!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (result == DialogResult.Yes)
            {
                OrderBusinessLogic        orderBusinessLogic        = new OrderBusinessLogic();
                CheckedOrderBusinessLogic checkedOrderBusinessLogic = new CheckedOrderBusinessLogic();
                MCORBusinessLogic         mCORBusinessLogic         = new MCORBusinessLogic();
                CheckedOrder checkedOrder = new CheckedOrder();//验收单
                Order        order        = orderBusinessLogic.GetOrderByID(orderID);
                checkedOrder.CheckedOrderID = order.OrderID;
                checkedOrder.OrderNumber    = order.OrderNumber;
                checkedOrder.Provider       = order.Provider;
                checkedOrder.Status         = "已验收";
                checkedOrder.VeriDate       = order.VeriDate;
                checkedOrder.Verifier       = order.Verifier;
                checkedOrder.Remark         = textBox1.Text.Trim();
                checkedOrder.Department     = order.Department;
                checkedOrder.Creator        = order.Creator;
                checkedOrder.TotalMoney     = Convert.ToDouble(label7.Text);
                checkedOrder.InputDate      = order.InputDate;
                order.Status = "已验收";
                bool flag1, flag2;
                try
                {
                    flag1 = checkedOrderBusinessLogic.AddOrder(checkedOrder);
                    flag2 = orderBusinessLogic.UpdataOrder(order);
                }
                catch (Exception)
                {
                    throw;
                }
                if (flag1 && flag2)
                {
                    int count = dgvOrderCheck.Rows.Count;
                    for (int i = 0; i < count; i++)
                    {
                        if (dgvOrderCheck.Rows[i].Cells[3].Value != null && dgvOrderCheck.Rows[i].Cells[8].Value != null)
                        {
                            MenuCheckedOrder_R MCOR = new MenuCheckedOrder_R();
                            MCOR.MenuCheckedOrderID = Guid.NewGuid().ToString();
                            MCOR.CheckedOrderID     = order.OrderID;
                            MCOR.MenuName           = dgvOrderCheck.Rows[i].Cells[3].Value.ToString();
                            MCOR.Unit      = dgvOrderCheck.Rows[i].Cells[4].Value.ToString();
                            MCOR.Quote     = Convert.ToDouble(dgvOrderCheck.Rows[i].Cells[5].Value);
                            MCOR.Rate      = Convert.ToDouble(dgvOrderCheck.Rows[i].Cells[6].Value);
                            MCOR.Price     = Convert.ToDouble(dgvOrderCheck.Rows[i].Cells[7].Value);
                            MCOR.Count     = Convert.ToDouble(dgvOrderCheck.Rows[i].Cells[8].Value);
                            MCOR.Money     = Convert.ToDouble(dgvOrderCheck.Rows[i].Cells[9].Value);
                            MCOR.InputDate = order.InputDate;
                            //MOR.Remark = null;
                            mCORBusinessLogic.AddMCOR(MCOR);
                        }
                    }
                    MessageBox.Show("您已成功保存验收单!", "提示");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("保存失败!");
                }
            }
        }
コード例 #20
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            MenuBusinessLogic  menuBusinessLogic  = new MenuBusinessLogic();
            OrderBusinessLogic orderBusinessLogic = new OrderBusinessLogic();
            MORBusinessLogic   mORBusinessLogic   = new MORBusinessLogic();
            Order order = new Order();
            bool  flag  = orderBusinessLogic.IscontainOrder(txbOrderNumber.Text.Trim());

            if (flag)
            {
                MessageBox.Show("订单已存在!", "提示");
                return;
            }
            if (dataGridView1.Rows[0].Cells[0].Value == null)
            {
                MessageBox.Show("订单不能为空!", "提示");
                return;
            }
            if (dataGridView1.Rows[cellRowIndex].Cells[0].Value != null && dataGridView1.Rows[cellRowIndex].Cells[3].Value == null)
            {
                MessageBox.Show("数量不能为空!", "提示");
                return;
            }
            if (dataGridView1.Rows[cellRowIndex].Cells[0].Value == null && dataGridView1.Rows[cellRowIndex].Cells[3].Value != null)
            {
                MessageBox.Show("请填写菜品!", "提示");
                return;
            }
            order.OrderID     = Guid.NewGuid().ToString();
            order.OrderNumber = txbOrderNumber.Text.Trim();
            order.Department  = txbDepartment.Text.Trim();
            order.Creator     = txbCreater.Text.Trim();
            order.InputDate   = Convert.ToDateTime(txbOrderDate.Text.Trim());
            order.TotalMoney  = Convert.ToDouble(this.dataGridView1.Rows[this.dataGridView1.Rows.Count - 1].Cells[7].Value);
            order.Status      = "未发送";
            orderBusinessLogic.AddOrder(order);
            int count = dataGridView1.Rows.Count;

            for (int i = 0; i < count - 1; i++)
            {
                if (dataGridView1.Rows[i].Cells[0].Value != null && dataGridView1.Rows[i].Cells[3].Value != null)
                {
                    string      menuName = dataGridView1.Rows[i].Cells[0].Value.ToString();
                    Model.Menu  menu     = menuBusinessLogic.GetMenuByName(menuName);
                    MenuOrder_R MOR      = new MenuOrder_R();
                    MOR.MenuOrderID = Guid.NewGuid().ToString();
                    MOR.OrderID     = order.OrderID;
                    MOR.MenuName    = menu.MenuName;
                    MOR.Unit        = menu.Unit;
                    MOR.InputDate   = Convert.ToDateTime(txbOrderDate.Text.Trim());
                    MOR.Money       = Convert.ToDouble(dataGridView1.Rows[i].Cells[7].Value);
                    MOR.Quote       = menu.MenuQuote;
                    MOR.Rate        = menu.MenuRate;
                    MOR.Price       = menu.MenuPrice;
                    MOR.Count       = Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value);
                    //MOR.Remark = null;
                    mORBusinessLogic.AddMOR(MOR);
                }
            }
            MessageBox.Show("提交成功!", "提示");
        }