Exemplo n.º 1
0
        private string SendSMS()
        {
            SendSMSRespData respData = new SendSMSRespData();

            try
            {
                string requestData = Request["ReqContent"];
                if (!string.IsNullOrEmpty(requestData))
                {
                    Loggers.DEFAULT.Debug(new DebugLogInfo
                    {
                        Message = "发送短信消息请求数据:" + requestData
                    });
                    var            reqObj     = requestData.DeserializeJSONTo <SendSMSReqData>();
                    ReceiveService smsService = new ReceiveService();
                    string         ret        = smsService.Recieve(reqObj.special.mobileNo, reqObj.special.content, reqObj.special.sign);
                    respData.code = ret;
                }
            }
            catch (Exception ex)
            {
                respData.code        = "103";
                respData.description = "操作失败:" + ex.Message;
                respData.exception   = ex.Message;
            }
            return(respData.ToJSON());
        }
Exemplo n.º 2
0
        //protected void ddlPurchaseOrder_SelectedIndexChanged(object sender, Telerik.Web.UI.DropDownListEventArgs e)
        //{
        //    Detail = ReceiveService.GetUnReceivingPO(Convert.ToInt32(ddlPurchaseOrder.SelectedValue), RowID);
        //    RefreshDetail();
        //}

        //protected void btnAddDetail_Click(object sender, EventArgs e)
        //{
        //    Page.Validate("AddDetail");
        //    if (Page.IsValid)
        //    {
        //        if (Convert.ToInt32(ntbQty.Value) == 0)
        //            ntbQty.Value = 1;

        //        try
        //        {

        //            var detailLine = new ReceivingDetailViewModel();
        //            var item = ItemService.GetItem(Convert.ToInt32(cboItem.SelectedValue));

        //            detailLine.ItemID = item.ID;
        //            detailLine.ItemCode = item.Code;
        //            detailLine.ItemName = item.Name;
        //            detailLine.UnitName = ddlUnit.SelectedItem.Text;
        //            detailLine.QtyReceived = Convert.ToInt32(ntbQty.Value);
        //            detailLine.Notes = txtNoteDetail.Text;
        //            Detail.Add(detailLine);

        //            RefreshDetail();

        //            cboItem.Text = "";
        //            ntbQty.Value = 1;
        //            ddlUnit.SelectedIndex = -1;


        //            cboItem.Focus();
        //        }
        //        catch (Exception ex)
        //        {
        //            WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, ex.Message, LabelStyleNames.ErrorMessage);
        //        }

        //    }
        //}

        protected void btnProcessVoid_Click(object sender, EventArgs e)
        {
            try
            {
                ReceiveService.VoidReceiving(RowID, txtVoidReason.Text);
                LoadData();
                WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, String.Format("Purchase Order {0} has been marked as void", string.Empty), LabelStyleNames.AlternateMessage);

                btnSave.Enabled = false;
                btnVoid.Enabled = false;
            }
            catch (Exception ex)
            {
                WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, ex.Message, LabelStyleNames.ErrorMessage);
            }
        }
Exemplo n.º 3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Page.Validate("AddEdit");
            if (Page.IsValid)
            {
                try
                {
                    if (Detail.Count == 0)
                    {
                        WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit,
                                                               "Cannot save empty detail",
                                                               LabelStyleNames.ErrorMessage);
                        return;
                    }

                    foreach (GridItem row in grdDetail.Items)
                    {
                        int itemID = Convert.ToInt32(((Label)row.FindControl("lblQtyPO")).Text);
                        ReceivingDetailViewModel detail = Detail.Single(x => x.ItemID == itemID);
                        detail.QtyReceived = Convert.ToInt32(((RadNumericTextBox)row.FindControl("txtQtyReceived")).Value);
                        detail.Notes       = ((RadTextBox)row.FindControl("txtNotes")).Text;
                    }

                    string result = ReceiveService.AddOrUpdateReceiving(
                        RowID,
                        Convert.ToInt32(hidPOID.Value),
                        receivingDate.SelectedDate.GetValueOrDefault(),
                        txtGoodIssueNo.Text,
                        txtFreightInfo.Text,
                        Convert.ToInt32(ddlWarehouse.SelectedValue),
                        txtNotes.Text,
                        Detail);

                    btnPrint.Enabled = true;

                    ReloadCurrentPage();
                }
                catch (Exception ex)
                {
                    WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, ex.Message, LabelStyleNames.ErrorMessage);
                    LogService.ErrorException(GetType().FullName, ex);
                }
            }
        }
Exemplo n.º 4
0
        static void Main()
        {
            ////MissDataSerial mcc = new MissDataSerial(300);
            ////mcc.OpList = new[] { 0, 2, 3, 1, 200, 90, 1, 1, 1, 1, 0 }.ToList();
            ////for(int i=1;i<10;i++)
            ////{
            ////    mcc = mcc.getAdd(i%10==0?1:0);
            ////}
            //return;
            Main1();
            return;

            Application.Run(new frm_ImageTextRead());
            return;

            //////////测试读取数据
            //////////GlobalObj gb = new GlobalObj();
            ////////GlobalClass gc = new GlobalClass();
            ////////string str = GlobalClass.dbName;//触发静态
            ////////KL12_HtmlDataClass hd = new KL12_HtmlDataClass(GlobalClass.TypeDataPoints["SCKL12"]);
            ////////ExpectList<TimeSerialData> el = hd.getExpectList<TimeSerialData>();
            ////////return;
            splitFile("share", "function(", '}');
            //return;
            LogableClass.ToLog("初始化服务器全局设置", "开始");
            InitSystem <TimeSerialData>();
            LogableClass.ToLog("启动通道", "开始");
            new CommuniteClass().StartIPCServer();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            GlobalObj gb = new GlobalObj();
            ////gb.w = new WindAPI();
            ////gb.w.start();
            ReceiveService <TimeSerialData> rc = new ReceiveService <TimeSerialData>();

            rc.Start();
            Form2 frm = new Form2(gb);

            Application.Run(frm);
        }
Exemplo n.º 5
0
        private void LoadData()
        {
            var receiveHeader = ReceiveService.GetReceiving(RowID);

            hypLookUpPO.Attributes["onclick"] =
                String.Format("showPromptPopUp('PromptPurchaseOrder.aspx?Code=cphMainContent_hidPOID&Name=ctl00_cphMainContent_txtDocumentPO&BranchID={0}', null, 550, 900);", receiveHeader.PurchaseOrderHeader.BranchID);

            ddlWarehouse.Items.Clear();
            ddlWarehouse.DataSource     = WarehouseService.GetWarehouses(Convert.ToInt32(ddlFindBranch.SelectedValue));
            ddlWarehouse.DataTextField  = "Name";
            ddlWarehouse.DataValueField = "ID";
            ddlWarehouse.DataBind();

            lblBranch.Text = receiveHeader.PurchaseOrderHeader.Branch.Name;

            Detail = ReceiveService.GetreceiveDetail(RowID).ToList();
            receivingDate.SelectedDate = receiveHeader.Date;
            txtDocumentNo.Text         = receiveHeader.DocumentNo;
            txtDocumentNo.ReadOnly     = true;

            txtDocumentPO.Text = receiveHeader.PurchaseOrderHeader.DocumentNo;
            hidPOID.Value      = Convert.ToString(receiveHeader.PurchaseOrderHeader.ID);
            //ddlPurchaseOrder.SelectedValue = Convert.ToString(receiveHeader.PurchaseOrderID);
            txtDocumentPO.ReadOnly     = true;
            txtGoodIssueNo.Text        = receiveHeader.GoodIssueNo;
            txtFreightInfo.Text        = receiveHeader.FreightInfo;
            txtNotes.Text              = receiveHeader.Notes;
            ddlWarehouse.SelectedValue = Convert.ToString(receiveHeader.WarehouseID);
            btnVoid.Enabled            = true;
            btnPrint.Enabled           = true;
            RefreshDetail();

            if (receiveHeader.VoidDate.HasValue)
            {
                btnSave.Enabled  = false;
                btnPrint.Enabled = false;
                btnVoid.Enabled  = false;
            }
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            var requestKey     = "ReceiveService.DoReceive";
            var receiveService = new ReceiveService();

            receiveService.Register();
            var input = string.Empty;

            do
            {
                input = Console.ReadLine();
                var result = MessageBus.Send <string>(new Message {
                    Body = input, Header = new MessageHeader {
                        RequestKey = requestKey, MessageKey = Guid.NewGuid().ToString()
                    }
                });

                Console.WriteLine(result);
            } while (input != "q");

            Console.ReadLine();
        }
        public void InitializeCommit(int userId, int warehouseID)
        {
            var user = new User();

            user.LoadByPrimaryKey(userId);
            InventoryCommitMemberInstance.User = user;

            // open transaction
            InventoryCommitMemberInstance.Transaction = TransactionMgr.ThreadTransactionMgr();


            // create the order here
            InventoryCommitMemberInstance.Order = Order.GenerateOrder(null, OrderType.CONSTANTS.INVENTORY,
                                                                      OrderStatus.Constant.ISSUED, ActivityID,
                                                                      PaymentType.Constants.INVENTORY, user.FullName,
                                                                      GeneralInfo.Current.InstitutionID, user.ID, 0);


            // create the picklist here
            InventoryCommitMemberInstance.PickList = PickList.GeneratePickList(InventoryCommitMemberInstance.Order.ID);


            // create the issue header
            IssueService issueService = new IssueService();

            InventoryCommitMemberInstance.Issue = issueService.CreateSTVLog(null, false
                                                                            , InventoryCommitMemberInstance.PickList
                                                                            , InventoryCommitMemberInstance.Order
                                                                            , null, ActivityID, false, user.ID);


            // create the reciept header
            ReceiveService receiveService = new ReceiveService();

            InventoryCommitMemberInstance.Receipt = receiveService.CreateFakeReceiptWithInvoicePO(OrderType.CONSTANTS.INVENTORY
                                                                                                  , ActivityID, GeneralInfo.Current.SupplierID, "Inventory"
                                                                                                  , InventoryCommitMemberInstance.Issue.IDPrinted
                                                                                                  , ReceiptType.CONSTANTS.BEGINNING_BALANCE, user.ID, ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, warehouseID);
        }
Exemplo n.º 8
0
        static void Main1()
        {
            //splitFile("share", "function(", '}');
            //return;
            LogableClass.ToLog("初始化服务器全局设置", "开始");
            InitSystem <TimeSerialData>();
            LogableClass.ToLog("启动通道", "开始");
            new CommuniteClass().StartIPCServer();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            GlobalObj gb = new GlobalObj();
            ////gb.w = new WindAPI();
            ////gb.w.start();
            ReceiveService <TimeSerialData> rc = new ReceiveService <TimeSerialData>();

            rc.setGlobalClass(AllServiceConfig.gc);
            rc.CalcProcess = new CalcService <TimeSerialData>();
            rc.Start();
            Form2 frm = new Form2(gb);

            Application.Run(frm);
        }
Exemplo n.º 9
0
        private void initData()
        {
            lvData.Items.Clear();

            List <UploadData> list = SqliteDataService.GetUnUploadDataList();

            if (list != null && list.Count > 0)
            {
                btnUpload.Enabled = true;
                foreach (UploadData item in list)
                {
                    ResultDataInfo data = item.Data as ResultDataInfo;
                    ListViewItem   lvi  = new ListViewItem(data.Doc != null && data.Doc.DOCNO != null ? data.Doc.DOCNO : "异常单号");
                    lvi.SubItems.Add(data.BoxNO != null ? data.BoxNO : "异常箱码");
                    lvi.SubItems.Add(data.ErrorMsg != null ? data.ErrorMsg : "异常");
                    lvi.SubItems.Add(data.CurrentNum.ToString());

                    string sapRe = ReceiveService.GetSaveDataSapResult(item.Guid);
                    if (string.IsNullOrEmpty(sapRe))
                    {
                        lvi.SubItems.Add(item.IsUpload == 0 ? "未上传" : "已上传");
                    }
                    else
                    {
                        lvi.SubItems.Add("SAP:" + sapRe);
                    }
                    lvi.Tag = item;
                    lvData.Items.Add(lvi);
                }
            }
            else
            {
                btnUpload.Enabled = false;
                MessageBox.Show("没有未上传的数据", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 10
0
        private void LoadData()
        {
            var receiveHeader = ReceiveService.GetReceiving(RowID);

            Detail = ReceiveService.GetreceiveDetail(RowID).ToList();
            receivingDate.SelectedDate = receiveHeader.Date;
            txtDocumentNo.Text         = receiveHeader.DocumentNo;
            txtDocumentPO.Text         = receiveHeader.PurchaseOrderHeader.DocumentNo;
            hidPOID.Value = Convert.ToString(receiveHeader.PurchaseOrderHeader.ID);
            //ddlPurchaseOrder.SelectedValue = Convert.ToString(receiveHeader.PurchaseOrderID);
            txtGoodIssueNo.Text = receiveHeader.GoodIssueNo;
            txtFreightInfo.Text = receiveHeader.FreightInfo;
            txtNotes.Text       = receiveHeader.Notes;
            btnVoid.Enabled     = true;
            btnPrint.Enabled    = true;
            RefreshDetail();

            if (receiveHeader.VoidDate.HasValue)
            {
                btnSave.Enabled  = false;
                btnPrint.Enabled = false;
                btnVoid.Enabled  = false;
            }
        }
Exemplo n.º 11
0
 protected void radBtnRefreshPO_Click(object sender, EventArgs e)
 {
     Detail = ReceiveService.GetUnReceivingOrder(Convert.ToInt32(hidPOID.Value), RowID);
     RefreshDetail();
 }
Exemplo n.º 12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Page.Validate("AddEdit");
            if (Page.IsValid)
            {
                try
                {
                    if (Detail.Count == 0)
                    {
                        WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, "Cannot save empty detail", LabelStyleNames.ErrorMessage);
                        return;
                    }

                    foreach (GridItem row in grdDetail.Items)
                    {
                        int itemID = Convert.ToInt32(((Label)row.FindControl("lblQtyPO")).Text);
                        ReceivingDetailViewModel detail = Detail.Single(x => x.ItemID == itemID);
                        detail.QtyReceived = Convert.ToDecimal(((RadNumericTextBox)row.FindControl("txtQtyReceived")).Value);
                        detail.Notes       = ((RadTextBox)row.FindControl("txtNotes")).Text;
                    }

//                    if (ReceiveService.CheckItemIsFullReceive(RowID, Convert.ToInt32(hidPOID.Value), Detail))
//                    {
//                        WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit,
//                            @"Item receiving is not valid in qty or does not exist in
//                        Purchase Order or surpass the item quantity in Purchase Order",
//                            LabelStyleNames.ErrorMessage);
//                        return;
//                    }


                    string result = ReceiveService.AddOrUpdateReceiving(
                        RowID,
                        Convert.ToInt32(hidPOID.Value),
                        receivingDate.SelectedDate.GetValueOrDefault(),
                        txtGoodIssueNo.Text,
                        txtFreightInfo.Text,
                        txtNotes.Text,
                        Detail);

                    btnPrint.Enabled = true;

                    //if (result == "F")
                    //{
                    //    btnSave.Enabled = false;
                    //    btnVoid.Enabled = false;
                    //}
                    //ScriptManager.RegisterStartupScript(this,
                    //    this.GetType(),
                    //    "save",
                    //    String.Format("alert('Receiving has been saved');"),
                    //    true);

                    ReloadCurrentPage();
                }
                catch (Exception ex)
                {
                    WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, ex.Message, LabelStyleNames.ErrorMessage);
                }
            }
        }
        internal void Commit(DateTime ethiopianDate, BackgroundWorker backgroundWorker = null)
        {
            InventoryCommitMemberInstance.Transaction.BeginTransaction();
            //TODO: Create the order detail, pass the order id above this inventory object
            int count = 0;

            if (backgroundWorker != null)
            {
                backgroundWorker.ReportProgress(0, "Detail");
            }
            //Add the System Damaged quantity, System Sound Quantity and System Expired Quantity to generate this.
            decimal endingSoundBalance, endingDamagedBalance, endExpiredBalance;

            endingSoundBalance   = !IsColumnNull("SystemSoundQuantity") ? SystemSoundQuantity : 0;
            endingDamagedBalance = !IsColumnNull("SystemDamagedQuantity") ? SystemDamagedQuantity : 0;
            endExpiredBalance    = !IsColumnNull("SystemExpiredQuantity") ? SystemExpiredQuantity : 0;

            decimal endingTotalBalance = endingSoundBalance + endingDamagedBalance + endExpiredBalance;

            ItemUnit itemUnit = new ItemUnit();

            itemUnit.LoadByPrimaryKey(UnitID);
            if (IsColumnNull("ReceiveDocID") && IsColumnNull("DamagedReceiveDocID")) // This has been recently added to
            {
                if (endingTotalBalance > 0)
                {
                    OrderDetail.GenerateOrderDetail(UnitID, ActivityID, endingTotalBalance,
                                                    InventoryCommitMemberInstance.Order.ID, itemUnit.QtyPerUnit, ItemID);

                    //TODO: Get the receive doc details for this inventory object
                    ReceivePallet receivePallet = new ReceivePallet();
                    receivePallet.LoadForInventory(this);
                    receivePallet.Rewind();

                    while (!receivePallet.EOF)
                    {
                        //Review: New Code
                        PickListDetail pickListDetail = PickListDetail.GeneratePickListDetail(receivePallet,
                                                                                              InventoryCommitMemberInstance
                                                                                              .PickList.ID,
                                                                                              Convert.ToDecimal(
                                                                                                  receivePallet.Balance));

                        //TODO: Create the issueDoc, pass the picklistdetail, orderid and picklist above
                        IssueService issueService = new IssueService();

                        IssueDoc issueDoc = issueService.CreateIssueFromPicklist(pickListDetail,
                                                                                 InventoryCommitMemberInstance.Order,
                                                                                 ethiopianDate,
                                                                                 InventoryCommitMemberInstance.Issue,
                                                                                 InventoryCommitMemberInstance.User);

                        //Link IssueDoc to InventoryTable
                        // Could have put it on the issueService method but it would have decrease the useablity
                        IssueDocInventory issueDocInventory = new IssueDocInventory();
                        issueDocInventory.AddNew();
                        issueDocInventory.InventoryID = ID;
                        issueDocInventory.IssueDocID  = issueDoc.ID;
                        issueDocInventory.Save();

                        receivePallet.MoveNext();
                        count++;
                        if (backgroundWorker != null)
                        {
                            backgroundWorker.ReportProgress(
                                Convert.ToInt32((Convert.ToDecimal(count) / Convert.ToDecimal(receivePallet.RowCount)) * 100),
                                "Detail");
                        }
                    }
                }
                //TODO: Create the receive (use the inventory object itself)
                ReceiveService receiveService = new ReceiveService();
                if (!IsColumnNull("InventorySoundQuantity") && InventorySoundQuantity > 0)
                {
                    ReceiveDoc receiveDoc = receiveService.CreateInventoryReceive(this,
                                                                                  InventoryCommitMemberInstance.Receipt.
                                                                                  ID, QuantityType.Sound,
                                                                                  ethiopianDate,
                                                                                  InventoryCommitMemberInstance.User);
                    ReceiveDocID = receiveDoc.ID;
                }

                if (!IsColumnNull("InventoryExpiredQuantity") && InventoryExpiredQuantity > 0)
                {
                    ReceiveDoc receiveDoc = receiveService.CreateInventoryReceive(this,
                                                                                  InventoryCommitMemberInstance.Receipt.
                                                                                  ID, QuantityType.Expired,
                                                                                  ethiopianDate,
                                                                                  InventoryCommitMemberInstance.User);
                    ReceiveDocID = receiveDoc.ID;
                }

                if (!IsColumnNull("InventoryDamagedQuantity") && InventoryDamagedQuantity > 0)
                {
                    ReceiveDoc receiveDoc = receiveService.CreateInventoryReceive(this,
                                                                                  InventoryCommitMemberInstance.Receipt.
                                                                                  ID, QuantityType.Damaged,
                                                                                  ethiopianDate,
                                                                                  InventoryCommitMemberInstance.User);
                    DamagedReceiveDocID = receiveDoc.ID;
                }

                if (backgroundWorker != null)
                {
                    backgroundWorker.ReportProgress(100, "Detail");
                }
            }
            else
            {
                if (!IsColumnNull("ReceiveDocID"))
                {
                    ReceiveDoc receiveDoc = new ReceiveDoc();
                    receiveDoc.LoadByPrimaryKey(ReceiveDocID);
                    receiveDoc.ChangeQuantity(!IsColumnNull("InventorySoundQuantity") ? InventorySoundQuantity
                                                            : !IsColumnNull("InventoryExpiredQuantity") ? InventoryExpiredQuantity
                                                                                        : 0);
                }

                if (!IsColumnNull("DamagedReceiveDocID"))
                {
                    ReceiveDoc receiveDoc = new ReceiveDoc();
                    receiveDoc.LoadByPrimaryKey(DamagedReceiveDocID);
                    receiveDoc.ChangeQuantity(InventoryDamagedQuantity);
                }
            }
            IsDraft = false;
            Save();
            InventoryCommitMemberInstance.Transaction.CommitTransaction();
        }