Пример #1
0
        public McssMaster(MCSS model = null, SessionInfo _session = null)
        {
            InitializeComponent();
            this._repo = new McssRepo();
            this._repoCustomer = new CustomerRepo();
            this._repoCoating = new CoatingRepo();
            this._repoSpec = new SpecRepo();
            this._repoCommodity = new Commodity();
            this._repoSupplier = new SupplierRepo();
            this._repoBT = new BussinessTypeRepo();
            this._repoMaker = new MakerRepo();
            this._repoMill = new MillRepo();
            this._repoCatg = new CategoryGroupRepo();
            specialRef = new Dictionary<int, string>();

            #region Dashboard
            if (model == null)
            {
                this.McssContent = new MCSS();
                this.ModelClone = new MCSS();
                this.Initail = new InitialModel();
            }
            else
            {
                this.McssContent = model;
                ModelClone = (MCSS)model.Clone();
            }
            epiSession = _session;
            #endregion

            #region Direct form
            //epiSession = new SessionInfo();
            //if (epiSession.SessionID == null)
            //{
            //    Login frm = new Login();
            //    frm.ShowDialog();
            //}
            //else if (epiSession.SessionID == "x")
            //{
            //    Application.Exit();
            //}
            //else
            //{
            //    this.Text = epiSession.CompanyName;
            //}
            #endregion
        }
Пример #2
0
        private void SetMode(InitialModel model)
        {
            McssContent = new MCSS();
            McssContent.SpecialRefs = new List<SpecialRef>();
            McssContent.InsertState = true;
            McssContent.Thick = model.Thick;
            McssContent.Width = model.Width;
            McssContent.Length = model.Length;
            McssContent.SupplierCode = model.SupplierCode;
            McssContent.SupplierName = model.SupplierName;
            McssContent.CustID = model.CustID;
            McssContent.CustomerName = model.CustomerName;
            McssContent.MakerCode = model.MakerCode;
            McssContent.MakerName = model.MakerName;
            McssContent.MillCode = model.MillCode;
            McssContent.MillName = model.MillName;
            McssContent.CommodityCode = model.CommodityCode;
            McssContent.CommodityName = model.CommodityName;
            McssContent.MatSpec1 = model.MatSpec1;
            McssContent.MatSpec2 = model.MatSpec2;

            SetContent(McssContent);

            ModelClone = (MCSS)McssContent.Clone();

            _repo.ClearInitial(model.Key1);
        }