Пример #1
0
 private void CloseNotify()
 {
     if (_selectedData == null || _selectedData.UID == 0)
     {
         return;
     }
     NotifyController.CloseNotify(_db, GlobalVar.Oper.OperName, _selectedData);
     EntitiesFactory.SaveDb(_db);
     Init();
 }
Пример #2
0
        public static void CloseNotify(int id, Form form)
        {
            var notify = NotifyList.SingleOrDefault(p => p.UID == id);

            if (notify == null)
            {
                return;
            }
            if (notify.State == (int)BillState.Finished)
            {
                return;
            }
            using (SpareEntities db = EntitiesFactory.CreateSpareInstance())
            {
                try
                {
                    NotifyController.CloseNotify(db, GlobalVar.Oper.OperName, notify);
                    EntitiesFactory.SaveDb(db);
                }
                catch (Exception ex)
                {
                    MessageHelper.ShowInfo(ex.ToString());
                }
            }
            NotifyType notifyType = (NotifyType)notify.NotifyType;
            var        formMain   = (FormMain)form;

            if (formMain == null)
            {
                return;
            }

            /*  switch (notifyType)
             * {
             *    case NotifyType.Ask:
             *        formMain.SetMdiForm("仓库申请单", typeof(FormWhseAskView));
             *        break;
             *    case NotifyType.Stock:
             *        formMain.SetMdiForm("仓库库存", typeof(FormStockProduct));
             *        break;
             *    case NotifyType.TransferSend:
             *        formMain.SetMdiForm("中转发运单", typeof(FormFactoryTransferSend));
             *        break;
             *    case NotifyType.DirectSend:
             *        formMain.SetMdiForm("直送发运单", typeof(FormFactoryDirectSend));
             *        break;
             *    case NotifyType.WhseSend:
             *        formMain.SetMdiForm("仓库发运单", typeof(FormWhseSend));
             *        break;
             * }*/
        }