Example #1
0
 public 原料选择()
 {
     InitializeComponent();
     mm    = new MaterialManager();
     pm    = new ProductionManager();
     index = 0;
 }
Example #2
0
        protected override bool SaveData()
        {
            view.CloseEditor();
            bsGrid.EndEdit();

            DS_WarehouseDescription.SP_GetWarehouseDescriptionDetailDataTable t1 = DataSetHelper.PackAlternationTypedDataTable <DS_WarehouseDescription.SP_GetWarehouseDescriptionDetailDataTable>(ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail);
            DataSetHelper.RemoveColumns(t1, true,
                                        t1.WarehouseDescriptionDetailIDColumn,
                                        t1.OrdinalNumberColumn,
                                        t1.ProductIDColumn,
                                        t1.MedicamentIDColumn,
                                        t1.CountryCodeColumn,
                                        t1.BrandIDColumn,
                                        t1.UnitPriceColumn,
                                        t1.QuantityColumn,
                                        t1.DescrQtyColumn,
                                        t1.CommentColumn,
                                        t1.ActionColumn
                                        );

            var id = ProductionManager.AddOrEditWarehouseDescription(WarehouseDescriptionID, BranchID, Date, ProductCount, ProductQty, DescrQty, ProductTotalDue, DescrTotalDue, CurrencyCode, DataSetHelper.InnerBytesData(t1), Status, CreateDate, CreatorID, BaseGlobalVariable.ServerDateTime, BaseGlobalVariable.UserID, ApproverID, Action);

            if (id > 0)
            {
                WarehouseDescriptionID = id;

                if (!OptionsEditForm.IsSaveAndCloseExecuting)
                {
                    BindingDetail();
                }
            }
            return(id > 0);
        }
Example #3
0
        private void init(string filePath)
        {
            LoadData     ld          = new LoadData();
            InitDataLoad initDataSet = ld.LoadInitData(filePath);

            CurrnetTime = initDataSet.InitParameters.startDate;

            dataManager = new DataManager(initDataSet.MetaData);
            dataManager.UpdateTime(CurrnetTime);

            clock       = new Clock(CurrnetTime);
            clock.Tick += ClockTick;

            WarehouseManager  = new WarehouseManager(initDataSet.InitParameters.InitWarehouseInventory, initDataSet.InitParameters.WarehouseMaxCapacity);
            financeManager    = new FinanceManager(initDataSet.InitParameters.InitBankStartBalance);
            DataSummary       = new DataSummaryClass(WarehouseManager, dataManager, financeManager, CurrnetTime, marketingManager, purchaseManager);
            productionManager = new ProductionManager(initDataSet.InitLists.InitToolsList, initDataSet.MetaData.ToolTypeMetaData);
            purchaseManager   = new PurchaseManager(initDataSet.InitLists.InitPurchaseOrders);
            marketingManager  = new MarketingManager(initDataSet.InitLists.InitCustomersOrderList, initDataSet.InitLists.InitFutureCustomersOrderList);


            foreach (ProductionOrder productionOrder in initDataSet.InitLists.InitProductionOrderList.GetProductionOrderList())
            {
                productionManager.AddProductionOrder(productionOrder);
            }

            productionManager.tempStartProduction();
        }
        public async Task <bool> JobCompletedSuccessfullyAsync(int workspaceArtifactId, int productionSetArtifactId, int maxWaitInMinutes)
        {
            bool      jobComplete                   = false;
            const int maxTimeInMilliseconds         = (Constants.Waiting.MAX_WAIT_TIME_IN_MINUTES * 60 * 1000);
            const int sleepTimeInMilliSeconds       = Constants.Waiting.SLEEP_TIME_IN_SECONDS * 1000;
            int       currentWaitTimeInMilliseconds = 0;

            Guid fieldGuid = Constants.Guids.Fields.ProductionSet.Status;

            try
            {
                while (currentWaitTimeInMilliseconds < maxTimeInMilliseconds && jobComplete == false)
                {
                    Thread.Sleep(sleepTimeInMilliSeconds);

                    Production production = await ProductionManager.ReadSingleAsync(workspaceArtifactId, productionSetArtifactId);

                    ProductionStatus productionStatus = production.ProductionMetadata.Status;
                    if (productionStatus == ProductionStatus.Produced || productionStatus == ProductionStatus.ProducedWithErrors)
                    {
                        jobComplete = true;
                    }

                    currentWaitTimeInMilliseconds += sleepTimeInMilliSeconds;
                }

                return(jobComplete);
            }
            catch (Exception ex)
            {
                throw new Exception($@"Error when checking for Production Job Completion. [ErrorMessage: {ex}]", ex);
            }
        }
Example #5
0
 public 产品库管理()
 {
     InitializeComponent();
     pdm = new ProductionManager();
     odm = new OrderManager();
     ppm = new ProductPlanManager();
 }
Example #6
0
        protected override void BindData()
        {
            if (Action == DatabaseAction.Edit)
            {
                ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader.Clear();
                ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader.Merge(ProductionManager.GetWarehouseDescriptionHeader(WarehouseDescriptionID));
                if (ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader.Count == 0)
                {
                    throw new ArgumentException("მონაცემი არ მოიძებნა.", "RecordID");
                }

                WarehouseDescriptionID = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].WarehouseDescriptionID;
                BranchID     = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].BranchID;
                Date         = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].Date;
                CurrencyCode = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].CurrencyCode;

                Status       = (DatabaseStatus)ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].Status;
                CreateDate   = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].CreateDate;
                CreatorID    = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].CreatorID;
                ModifiedDate = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].ModifiedDate;
                ModifierID   = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].ModifierID;
                ApproverID   = ds_WarehouseDescription.SP_GetWarehouseDescriptionHeader[0].ApproverID;

                BindingDetail();
            }
            else
            {
                BranchID             = GlobalVariable.BranchID;
                Date                 =
                    CreateDate       =
                        ModifiedDate = BaseGlobalVariable.ServerDateTime;
                CreatorID            =
                    ModifierID       = BaseGlobalVariable.UserID;
            }
        }
 public CharacterCleaner(MarketHelper marketHelper, SparkHelper sparkHelper, ProductionManager productionManager, MissionProcessor missionProcessor)
 {
     _marketHelper      = marketHelper;
     _sparkHelper       = sparkHelper;
     _productionManager = productionManager;
     _missionProcessor  = missionProcessor;
 }
Example #8
0
        private void btnGenerate_Click(object sender, EventArgs e)
        {
            if (ReadOnly)
            {
                return;
            }


            var productLocation = ProductLocationManager.GetVWByBranchAndDate(BranchID, Date);

            DataSetHelper.DeleteAllRows(ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail);

            short i         = 0;
            var   rate      = CurrencyRate;
            var   id        = WarehouseDescriptionID;
            var   t_product = new DS_PurchaseOrderInfo.T_ProductDataTable();

            foreach (var row in productLocation)
            {
                i++;
                var newRow = ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail.NewSP_GetWarehouseDescriptionDetailRow();
                newRow.WarehouseDescriptionID = id;
                newRow.OrdinalNumber          = i;
                newRow.MedicamentID           = row.MedicamentID;
                newRow.MedicamentName         = row.MedicamentName;
                newRow.UnitsInStock           = row.UnitsInStock;
                newRow.ProductID = row.ProductID;
                newRow[ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail.CountryCodeColumn] = row[productLocation.CountryCodeColumn.ColumnName];
                newRow[ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail.BrandIDColumn]     = row[productLocation.BrandIDColumn];
                newRow.UnitPrice = row.StandardCost * rate;
                newRow.Quantity  = row.Quantity;
                newRow.DescrQty  = 0m;
                ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail.AddSP_GetWarehouseDescriptionDetailRow(newRow);
                t_product.AddT_ProductRow(row.ProductID);
            }

            DataTable t_xml        = DataSetHelper.PackAlternationDataTable(t_product);
            var       purchaseInfo = ProductionManager.GetPurchaseOrderInfo(0, CurrencyCode, DataSetHelper.InnerBytesData(t_xml));
            var       view         = new DataView(purchaseInfo);

            view.Sort = purchaseInfo.ProductIDColumn.ColumnName;

            foreach (var row in ds_WarehouseDescription.SP_GetWarehouseDescriptionDetail)
            {
                if (DataSetHelper.IsDataRowDeleted(row))
                {
                    continue;
                }

                var j = view.Find(row.ProductID);
                if (j == -1)
                {
                    continue;
                }

                var purchaseRow = (DS_PurchaseOrderInfo.SP_GetPurchaseOrderInfoRow)view[j].Row;
                row.UnitPrice = ProductionManager.GetPurchaseUnitPrice(purchaseRow.UnitPrice, purchaseRow.AverageRate1, purchaseRow.AverageRate2);
            }
        }
Example #9
0
 public 生产管理()
 {
     InitializeComponent();
     ppm     = new ProductPlanManager();
     oMgr    = new OrderManager();
     product = new ProductionManager();
     plan    = new ProductionPlan();
 }
Example #10
0
 public 产品出库(string oId)
 {
     InitializeComponent();
     orderId = oId;
     pdm     = new ProductionManager();
     odm     = new OrderManager();
     ppm     = new ProductPlanManager();
 }
Example #11
0
 /// <summary>
 /// Выводит результат работы
 /// </summary>
 private void DisplayResult(ClipInfo clip)
 {
     header.text           = $"Завершена работа над клипом трека \"{ProductionManager.GetTrackName(clip.TrackId)}\"";
     viewsAmount.text      = $"ПРОСМОТРЫ: {clip.Views}";
     likesAndDislikes.text = $"{clip.Likes} лайков / {clip.Dislikes} дизлайков";
     fansIncome.text       = $"ФАНАТЫ: +{clip.FansIncome}";
     moneyIncome.text      = $"ДЕНЬГИ: +{clip.MoneyIncome}$";
 }
Example #12
0
 public 原料选择(string str)
 {
     InitializeComponent();
     mm    = new MaterialManager();
     pm    = new ProductionManager();
     index = 0;
     PID   = str;
 }
        // Create a production with page level numbering
        public async Task <int> CreatePageLevelProductionAsync(int workspaceArtifactId)
        {
            Console2.WriteDisplayStartLine($"Creating Production [Name: {Constants.Production.NAME}]");

            try
            {
                // Construct the production object that you want to create
                Production production = new Production
                {
                    Name    = Constants.Production.NAME,
                    Details = new ProductionDetails
                    {
                        DateProduced           = Constants.Production.DateProduced,
                        EmailRecipients        = Constants.Production.EMAIL_RECIPIENTS,
                        ScaleBrandingFont      = Constants.Production.SCALE_BRANDING_FONT,
                        BrandingFontSize       = Constants.Production.BRANDING_FONT_SIZE,
                        PlaceholderImageFormat = Constants.Production.PLACEHOLDER_IMAGE_FORMAT
                    },

                    Numbering = new PageLevelNumbering
                    {
                        BatesPrefix      = Constants.Production.BATES_PREFIX,
                        BatesSuffix      = Constants.Production.BATES_SUFFIX,
                        BatesStartNumber = Constants.Production.BATES_START_NUMBER,
                        NumberOfDigitsForDocumentNumbering = Constants.Production.NUMBER_OF_DIGITS_FOR_DOCUMENT_NUMBERING
                    },

                    Footers = new ProductionFooters
                    {
                        LeftFooter = new HeaderFooter(Constants.Production.HEADER_FOOTER_FRIENDLY_NAME)
                        {
                            Type     = Constants.Production.HEADER_FOOTER_TYPE,
                            FreeText = Constants.Production.HEADER_FOOTER_FREE_TEXT
                        }
                    },

                    Keywords = Constants.Production.KEYWORDS,
                    Notes    = Constants.Production.NAME
                };

                // Save the production into the specified workspace
                int productionArtifactId = await ProductionManager.CreateSingleAsync(workspaceArtifactId, production);

                Console2.WriteDebugLine($"Production ArtifactId: {productionArtifactId}");
                Console2.WriteDisplayEndLine("Created Production!");

                return(productionArtifactId);
            }
            catch (ValidationException validationException)
            {
                throw new Exception("There are validation errors when creating Production", validationException);
            }
            catch (Exception ex)
            {
                throw new Exception("An error occured when creating Production", ex);
            }
        }
Example #14
0
 public 批量导入()
 {
     InitializeComponent();
     odMgr   = new OrderManager();
     userMgr = new UserManager();
     //sMgr = new SalesManager();
     pdtMgr = new ProductionManager();
     mtMgr  = new MaterialManager();
 }
Example #15
0
 public 领料生产()
 {
     InitializeComponent();
     ppm = new ProductPlanManager();
     pm  = new ProductionManager();
     mt  = new MaterialManager();
     //  mat = new Material();
     index3 = 0;
 }
Example #16
0
 public 产品原料关系()
 {
     InitializeComponent();
     odm     = new OrderManager();
     userMgr = new UserManager();
     pm      = new ProductionManager();
     mm      = new MaterialManager();
     产品编号    = "0";
 }
Example #17
0
 protected override void BindGrid()
 {
     _BindGridCount++;
     if (_BindGridCount <= 1)
     {
         return;
     }
     ds.SP_GetRealIncomeExpence.Clear();
     ds.SP_GetRealIncomeExpence.Merge(ProductionManager.GetRealIncomeExpence(ConvertHelper.ToDateTime(dateFromDate.EditValue), ConvertHelper.ToDateTime(dateToDate.EditValue), ConvertHelper.ToString(lookCurrency.EditValue), chkAddVatAmt.Checked, ConvertHelper.ToInt32(bbCustomer.RecordValue)));
 }
Example #18
0
 public 审核()
 {
     InitializeComponent();
     showdata  = new OperationAuditDAO();
     ppm       = new ProductPlanManager();
     pm        = new ProductionManager();
     odm       = new OrderManager();
     index订单   = -1;
     index生产计划 = -1;
 }
Example #19
0
 public 根据订单生成计划()
 {
     InitializeComponent();
     odm     = new OrderManager();
     userMgr = new UserManager();
     pm      = new ProductionManager();
     mt      = new MaterialManager();
     ppm     = new ProductPlanManager();
     index3  = 0;
 }
Example #20
0
        /// <summary>
        /// Сохраняет результаты батла
        /// </summary>
        private void SaveResult()
        {
            PlayerManager.Instance.AddFans(_result.FansIncome, rewardExp);
            PlayerManager.Instance.AddHype(_result.HypeIncome);

            if (_result.IsWin)
            {
                ProductionManager.AddBattle(_result.RapperInfo);
            }
        }
Example #21
0
 public 新增报价单()
 {
     InitializeComponent();
     odm         = new OrderManager();
     userMgr     = new UserManager();
     pm          = new ProductionManager();
     ppm         = new ProductPlanManager();
     selectorder = 0;
     selectpro   = 0;
 }
Example #22
0
        /// <summary>
        /// Сохраняет результаты трека
        /// </summary>
        private void SaveResult(TrackInfo track)
        {
            track.Timestamp = TimeManager.Instance.Now;
            PlayerManager.Instance.GiveReward(track.FansIncome, track.MoneyIncome, rewardExp);
            ProductionManager.AddTrack(track);

            if (track.Feat != null)
            {
                ProductionManager.AddFeat(track.Feat);
            }
        }
Example #23
0
        public Unary() : base()
        {
            Mod = new Mod();
            Mod.Load();

            MapManager        = new MapManager(this);
            StrategyManager   = new StrategyManager(this);
            EconomyManager    = new EconomyManager(this);
            ProductionManager = new ProductionManager(this);
            OperationsManager = new OperationsManager(this);
        }
Example #24
0
 public 领料清单生成(string 订单编号, int 产品编号, int 产品数量, int[] 原料编号)
 {
     InitializeComponent();
     pm       = new ProductionManager();
     mtm      = new MaterialManager();
     ppm      = new ProductPlanManager();
     material = new MaterialManager();
     订单       = 订单编号;
     产品       = 产品编号;
     数量       = 产品数量;
     原料       = 原料编号;
     select原料 = -1;
 }
Example #25
0
        public void SavePrices()
        {
            if (!_IsAllowedChangePrice)
            {
                return;
            }
            if (!IsValidGrid())
            {
                return;
            }

            try
            {
                Application.DoEvents();
                Cursor = Cursors.WaitCursor;

                OptionsGrid.GridView.CloseEditor();
                bsGridControl.EndEdit();

                DS_Product.VW_ProductDataTable table = Zek.Data.DataSetHelper.PackAlternationTypedDataTable <DS_Product.VW_ProductDataTable>(ds.VW_Product);
                Zek.Data.DataSetHelper.RemoveColumns(table, true, table.ProductIDColumn,
                                                     table.NewListPriceColumn,
                                                     table.NewDealerPriceColumn,
                                                     table.NewDiscountPctColumn,
                                                     table.ActionColumn);


                using (var tmpds = new DataSet("root"))
                {
                    tmpds.Tables.Add(table);
                    var id = ProductionManager.AddOrEditProducts(BaseGlobalVariable.UserID, BaseGlobalVariable.ServerDateTime, DatabaseAction.Import, Zek.Data.DataSetHelper.InnerBytesData(tmpds));
                    if (id > 0)
                    {
                        ds.VW_Product.AcceptChanges();
                        XtraMessageBox.Show(this, "ცვლილებები შენახულია.", "ინფორმაცია", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        throw new Exception("id <= 0");
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionHelper.Show(ex, "ცვლილებები არ შენახულა", MessageBoxIcon.Error);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
        // Run the Production
        public async Task RunProductionAsync(int workspaceArtifactId, int productionArtifactId)
        {
            Console2.WriteDisplayStartLine("Running Production");

            try
            {
                ProductionJobResult productionJobResult = await ProductionManager.RunProductionAsync(workspaceArtifactId, productionArtifactId, true);

                bool wasJobCreated = productionJobResult.WasJobCreated;

                const int maxTimeInMilliseconds         = (Constants.Waiting.MAX_WAIT_TIME_IN_MINUTES * 60 * 1000);
                const int sleepTimeInMilliSeconds       = Constants.Waiting.SLEEP_TIME_IN_SECONDS * 1000;
                int       currentWaitTimeInMilliseconds = 0;

                while (currentWaitTimeInMilliseconds < maxTimeInMilliseconds && wasJobCreated == false)
                {
                    Thread.Sleep(sleepTimeInMilliSeconds);

                    string errors = productionJobResult.Errors.FirstOrDefault();
                    Console2.WriteDebugLine($"Errors: {errors}");

                    List <string> warnings = productionJobResult.Warnings;
                    Console2.WriteDebugLine($"Warnings: {string.Join("; ", warnings)}");

                    List <string> messages = productionJobResult.Messages;
                    Console2.WriteDebugLine($"Message: {string.Join("; ", messages)}");

                    // Okay, so maybe you've looked at the errors and found some document conflicts
                    // and you want to override it anyway.
                    //bool overrideConflicts = true;
                    //bool suppressWarnings = false;

                    productionJobResult = await ProductionManager.RunProductionAsync(workspaceArtifactId, productionArtifactId, true);

                    wasJobCreated = productionJobResult.WasJobCreated;

                    currentWaitTimeInMilliseconds += sleepTimeInMilliSeconds;
                }

                Console2.WriteDisplayEndLine("Ran Production!");
            }
            catch (ValidationException validationException)
            {
                throw new Exception("There are validation errors when Running Production", validationException);
            }
            catch (Exception ex)
            {
                throw new Exception("An error occured when Running Production", ex);
            }
        }
Example #27
0
    public void SaveProduction(ProductionUI objUI)
    {
        bool flagTransation = true;

        ProductionDB objDB = new ProductionDB();
        objDB.S = objUI.S;
        objDB.Material = objUI.Material;
        objDB.SerialNo = objUI.SerialNo;
        objDB.Plnt = objUI.Plnt;
        objDB.SLoc = objUI.SLoc;
        objDB.Description = objUI.Description;
        objDB.Production_Month = objUI.Production_Month;
        objDB.Production_Month_Year = objUI.Production_Month_Year;
        //objDB.Model_Code = objUI.Model_Code;
        objDB.FromDate = objUI.FromDate;
        objDB.ToDate = objUI.ToDate;
        objDB.MonthID = objUI.MonthID;
        objDB.YearID = objUI.YearID;
        objDB.Quarter = objUI.Quarter;
        objDB.ModelMappingID = objUI.ModelMappingID;
        DataAccessLayer objDataAccess = new DataAccessLayer();
        SqlTransaction objTrans = null;
        try
        {

            if (objTrans == null)
            {
                flagTransation = false;
                objDataAccess.GetConnection.Open();
                SqlTransaction objTransaction = objDataAccess.GetConnection.BeginTransaction();
                objTrans = objTransaction;
            }
            ProductionManager objManager = new ProductionManager();
            objManager.SaveProduction(objDB, objTrans);
            if (!flagTransation)
                objTrans.Commit();

        }
        catch (Exception ex)
        {
            if (!flagTransation)
                objTrans.Rollback();
            throw ex;
        }
        finally
        {
            objDataAccess.GetConnection.Close();
        }
    }
Example #28
0
        protected override void BindData()
        {
            if (Action == DatabaseAction.Edit)
            {
                ds_Production.SP_GetProductDistributionHeader.Clear();
                ds_Production.SP_GetProductDistributionHeader.Merge(ProductionManager.GetProductDistributionHeader(ProductDistributionID));
                if (ds_Production.SP_GetProductDistributionHeader.Count == 0)
                {
                    throw new ArgumentException("მონაცემი არ მოიძებნა.", "RecordID");
                }

                ProductDistributionID = ds_Production.SP_GetProductDistributionHeader[0].ProductDistributionID;
                FromBranchID          = ds_Production.SP_GetProductDistributionHeader[0].FromBranchID;
                ToBranchID            = ds_Production.SP_GetProductDistributionHeader[0].ToBranchID;
                StartDate             = ds_Production.SP_GetProductDistributionHeader[0].StartDate;
                dateEndDate.EditValue = ds_Production.SP_GetProductDistributionHeader[0][ds_Production.SP_GetProductDistributionHeader.EndDateColumn];
                RevisionNumber        = ds_Production.SP_GetProductDistributionHeader[0].RevisionNumber;
                //Comment = ds_Production.SP_GetProductDistributionHeader[0].Comment;

                Status         = (DatabaseStatus)ds_Production.SP_GetProductDistributionHeader[0].Status;
                ModifiedUserID = ds_Production.SP_GetProductDistributionHeader[0].ModifiedUserID;
                ModifiedDate   = ds_Production.SP_GetProductDistributionHeader[0].ModifiedDate;
                ApproverUserID = ds_Production.SP_GetProductDistributionHeader[0].ApproverUserID;

                ds_Production.SP_GetProductDistributionDetail.Clear();
                ds_Production.SP_GetProductDistributionDetail.Merge(ProductionManager.GetProductDistributionDetail(ProductDistributionID));

                var rate = CurrencyRate;
                foreach (var row in ds_Production.SP_GetProductDistributionDetail)
                {
                    row._UnitPrice         = row.UnitPrice * rate;
                    row._ResidualQty       = row.Quantity;
                    row.Quantity          += row.DistributeQty;
                    row._DistributeUnitQty = MathHelper.RoundUnit(row.DistributeQty, row.UnitsInStock, 4);
                }

                ds_Production.AcceptChanges();
            }
            else
            {
                ModifiedUserID = BaseGlobalVariable.UserID;
                ModifiedDate   = BaseGlobalVariable.ServerDateTime;

                FromBranchID = GlobalVariable.BranchID;
                StartDate    = BaseGlobalVariable.ServerDateTime;

                AddHeader();
            }
        }
Example #29
0
        private void OnPrint(object sender, EventArgs e)
        {
            //if (IsChanged || Action == DatabaseAction.Add)
            //{
            //    XtraMessageBox.Show(this, "გთხოვთ შეინახოთ ჩანაწერი და შემდეგ გაიმეოროთ ოპერაცია.", "გაფრთხილება", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    return;
            //}
            //if (Status == DatabaseStatus.Pending)
            //{
            //    XtraMessageBox.Show(this, "მხოლოდ დადასტურებული შეკვეთის ამობეჭვდაა შესაძლებელი.", "ამობეჭვდა", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    return;
            //}

            ProductionManager.UpdateProductDistributionStatus(ProductDistributionID, (int)DatabaseStatus.Shipped, BaseGlobalVariable.UserID);
        }
        static void Main(string[] args)

        {
            var unitOfWork = new UnitOfWork();
            var manager    = new ProductionManager(unitOfWork);

            var items = unitOfWork.Items.GetAllFinalItems();

            foreach (var item in items)
            {
                Console.WriteLine(item.Name);
            }

            Console.ReadLine();
        }
        // Stage the production
        public async Task StageProductionAsync(int workspaceArtifactId, int productionArtifactId)
        {
            Console2.WriteDisplayStartLine("Staging Production");

            try
            {
                ProductionJobResult productionJobResult = await ProductionManager.StageProductionAsync(workspaceArtifactId, productionArtifactId);

                ProductionStatusDetailsResult productionStatusDetailsResult = await ProductionManager.GetProductionStatusDetails(workspaceArtifactId, productionArtifactId);

                const int maxTimeInMilliseconds         = (Constants.Waiting.MAX_WAIT_TIME_IN_MINUTES * 60 * 1000);
                const int sleepTimeInMilliSeconds       = Constants.Waiting.SLEEP_TIME_IN_SECONDS * 1000;
                int       currentWaitTimeInMilliseconds = 0;

                while (currentWaitTimeInMilliseconds < maxTimeInMilliseconds && (string)productionStatusDetailsResult.StatusDetails.FirstOrDefault().Value != "Staged")
                {
                    Thread.Sleep(sleepTimeInMilliSeconds);

                    productionStatusDetailsResult = await ProductionManager.GetProductionStatusDetails(workspaceArtifactId, productionArtifactId);

                    currentWaitTimeInMilliseconds += sleepTimeInMilliSeconds;
                }

                if (productionJobResult.Errors.Count != 0)
                {
                    const string errorMessage = "There was an error when Staging Production";
                    Console2.WriteDebugLine(errorMessage);
                    foreach (string item in productionJobResult.Errors)
                    {
                        Console2.WriteDebugLine(item);
                    }

                    throw new Exception(errorMessage);
                }

                foreach (string item in productionJobResult.Messages)
                {
                    Console2.WriteDebugLine(item);
                }

                Console2.WriteDebugLine(productionStatusDetailsResult.StatusDetails.Last() + "\r\n");
                Console2.WriteDisplayEndLine("Staged Production!");
            }
            catch (Exception ex)
            {
                throw new Exception("An error occured when Staging Production", ex);
            }
        }
Example #32
0
    public void SaveProductionData()
    {
        bool flagTransation = true;

        DataAccessLayer objDataAccess = new DataAccessLayer();
        SqlTransaction objTrans = null;
        try
        {

            if (objTrans == null)
            {
                flagTransation = false;
                objDataAccess.GetConnection.Open();
                SqlTransaction objTransaction = objDataAccess.GetConnection.BeginTransaction();
                objTrans = objTransaction;
            }
            ProductionManager objManager = new ProductionManager();
            objManager.SaveProductionData(objTrans);
            if (!flagTransation)
                objTrans.Commit();

        }
        catch (Exception ex)
        {
            if (!flagTransation)
                objTrans.Rollback();
            throw ex;
        }
        finally
        {
            objDataAccess.GetConnection.Close();
        }
    }