Beispiel #1
0
        public static BusinessObject GetRealCompanyUnit(Guid companyUnitID)
        {
            GECompanyUnitsInfo comUnit = new GECompanyUnitsController().GetObjectByID(companyUnitID) as GECompanyUnitsInfo;

            if (comUnit == null)
            {
                return(null);
            }

            if (!comUnit.FK_GECompanyUnitTypeID.HasValue)
            {
                return(null);
            }

            GECompanyUnitTypesInfo comUnitType = new GECompanyUnitTypesController().GetObjectByID(comUnit.FK_GECompanyUnitTypeID.Value) as GECompanyUnitTypesInfo;

            if (comUnitType == null)
            {
                return(null);
            }

            BusinessObjectController ctrl = BusinessControllerFactory.GetBusinessController(comUnitType.TableName);

            if (ctrl != null)
            {
                return(ctrl.GetObjectByNo(comUnit.No));
            }

            return(null);
        }
Beispiel #2
0
        void btnRecalcInventory_Click(object sender, EventArgs e)
        {
            Control period = UIManager.GetControl("period");
            Control stock  = UIManager.GetControl("stock");

            if (period != null && stock != null && (period as ABCPeriodEdit).EditValue != null && (stock as ABCSearchControl).EditValue != null)
            {
                Guid periodID = ABCHelper.DataConverter.ConvertToGuid((period as ABCPeriodEdit).EditValue);
                Guid stockID  = ABCHelper.DataConverter.ConvertToGuid((stock as ABCSearchControl).EditValue);
                if (periodID != Guid.Empty && stockID != Guid.Empty)
                {
                    GEPeriodsInfo      preriodInfo = new GEPeriodsController().GetObjectByID(periodID) as GEPeriodsInfo;
                    GECompanyUnitsInfo stockInfo   = new GECompanyUnitsController().GetObjectByID(stockID) as GECompanyUnitsInfo;
                    if (preriodInfo != null && stockInfo != null)
                    {
                        ABCHelper.ABCWaitingDialog.Show("", String.Format("Tính tồn kho tháng {0}/{1} {2}. . .!", preriodInfo.Month, preriodInfo.Year, stockInfo.No));
                        InventoryProvider.PeriodEndingProcessing(periodID, stockID);

                        if (this.DataManager.DataObjectsList.ContainsKey((stock as ABCSearchControl).DataSource))
                        {
                            this.DataManager.DataObjectsList[(stock as ABCSearchControl).DataSource].Refresh();
                        }

                        ABCHelper.ABCWaitingDialog.Close();
                    }
                }
            }
        }
Beispiel #3
0
        public static bool IsInventory(Guid companyUnitID)
        {
            GECompanyUnitsInfo comUnit = new GECompanyUnitsController().GetObjectByID(companyUnitID) as GECompanyUnitsInfo;

            if (comUnit == null)
            {
                return(false);
            }

            return(comUnit.IsInventory);
        }