Esempio n. 1
0
        /// <summary>Приемка нового коплектующего</summary>
        /// <param name="MainProcess"></param>
        /// <param name="topic">Заголовок</param>
        /// <param name="accessory">Тип комплектующего</param>
        public AcceptanceOfNewAccessory(WMSClient MainProcess, string topic, TypeOfAccessories accessory)
            : base(MainProcess, 1)
        {
            MainProcess.ToDoCommand = topic;
            FormNumber          = 1;
            BusinessProcessType = ProcessType.Registration;
            typeOfAccessory     = accessory;
            acceptanceDoc       = new AcceptanceOfNewComponents();

            IsLoad = true;
            DrawControls();
        }
Esempio n. 2
0
        /// <summary>Синхронизировать документы "Приемка нового компл." с сервера</summary>
        private void SyncAccepmentsDocFromServer()
        {
            DataTable acceptedDoc    = AcceptanceOfNewComponents.GetAcceptedDocuments();
            DataTable notAcceptedDoc = AcceptanceOfNewComponents.GetNotAcceptedDocuments();

            PerformQuery("GetAcceptDocs", acceptedDoc, notAcceptedDoc);

            if (IsExistParameters)
            {
                AcceptanceOfNewComponents.ClearAcceptedDocuments();
                DataTable table = ResultParameters[0] as DataTable;

                if (table != null)
                {
                    foreach (DataRow row in table.Rows)
                    {
                        string contractorBarcode = row["Contractor"].ToString();
                        string partyRef          = row["InvoiceNumber"].ToString();
                        string caseModelRef      = row["CaseModel"].ToString();
                        string lampModelRef      = row["LampModel"].ToString();
                        string unitModelRef      = row["UnitModel"].ToString();
                        object contractorObj     = BarcodeWorker.GetIdByBarcode(typeof(Contractors), contractorBarcode);
                        object partyObj          = BarcodeWorker.GetIdByRef(typeof(Party), partyRef);
                        object caseModelObj      = BarcodeWorker.GetIdByRef(typeof(Models), caseModelRef);
                        object lampModelObj      = BarcodeWorker.GetIdByRef(typeof(Models), lampModelRef);
                        object unitModelObj      = BarcodeWorker.GetIdByRef(typeof(Models), unitModelRef);

                        AcceptanceOfNewComponents doc = new AcceptanceOfNewComponents
                        {
                            Id               = Convert.ToInt64(row["Id"]),
                            Contractor       = Convert.ToInt64(contractorObj),
                            Date             = Convert.ToDateTime(row["Date"]),
                            InvoiceDate      = Convert.ToDateTime(row["InvoiceDate"]),
                            InvoiceNumber    = Convert.ToInt64(partyObj),
                            MarkForDeleting  = false,
                            CaseModel        = Convert.ToInt64(caseModelObj),
                            LampModel        = Convert.ToInt64(lampModelObj),
                            UnitModel        = Convert.ToInt64(unitModelObj),
                            TypesOfWarrantly = (TypesOfLampsWarrantly)
                                               Convert.ToInt32(row["TypesOfWarrantly"]),
                            TypeOfAccessories = (TypeOfAccessories)
                                                Convert.ToInt32(row["TypeOfAccessories"]),
                            WarrantlyHours = Convert.ToInt32(row["WarrantlyHours"]),
                            WarrantlyYears = Convert.ToInt32(row["WarrantlyYears"]),
                            State          = (TypesOfLampsStatus)Convert.ToInt32(row["State"])
                        };
                        doc.Sync <AcceptanceOfNewComponents>();
                    }
                }
            }
        }