Esempio n. 1
0
        public StoreInPlan(SessionInfo _session = null, StoreInPlanHead model = null)
        {
            InitializeComponent();
            this._repo = new StoreInPlanRepo();
            this._repoIn = new StoreInRepo();
            this._repoCurr = new CurrenciesRepo();
            this._repoSupplier = new SupplierRepo();
            this._repoBT = new BussinessTypeRepo();
            this._repoMaker = new MakerRepo();
            this._repoMill = new MillRepo();
            this._repoCmdt = new Commodity();
            this._repoSpec = new SpecRepo();
            this._repoCoating = new CoatingRepo();
            this._repoWhse = new WharehouseRepo();
            this._repoPort = new ImportPortRepo();
            this._repoCust = new CustomerRepo();
            this._repoLookup = new LookupRepo();
            this.SourceStr = "";
            epiSession = _session;

            if (model == null || epiSession == null)
            {
                this.HeadContent = new StoreInPlanHead();
                this.IMEXReviewFlag = false;
            }
            else
            {
                this.HeadContent = model;                
                this.IMEXReviewFlag = true;
            }
            this.ModelClone = new StoreInPlanHead();
            this.POTrans = new POLineModel();
        }
Esempio n. 2
0
 public PackingOrder(SessionInfo _session = null, PackingOrderModel model = null)
 {
     InitializeComponent();
     epiSession = _session;
     this._repo = new PackingOrderRepo();
     this.HeaderContent = new PackingOrderModel();
 }
Esempio n. 3
0
 public ProductionPlan(SessionInfo _session, ProductionPlanModel model = null)
 {
     InitializeComponent();
     this._repo = new ProductionPlanRepo();
     this.domain = new ProductionPlanModel();
     epiSession = _session;
 }
Esempio n. 4
0
 public SimulateEntry(SessionInfo _session = null, PlanningHeadModel model = null, SimulateActionModel simModel = null)
 {
     InitializeComponent();
     this._repo = new WorkEntryRepo();
     HeadModel = model;
     SimModel = simModel;
     epiSession = _session;
 }
Esempio n. 5
0
 public StoreInBalance(SessionInfo _session = null, StoreInPlanDialogModel model = null)
 {
     InitializeComponent();
     this._repoPln = new StoreInPlanRepo();
     this._repo = new StoreInRepo();
     this.StoreInPlanBln = new List<StoreInPlanDialogModel>();
     this.FilterData = model;
 }
Esempio n. 6
0
 public OrderHeadDialog(SessionInfo _session, IEnumerable<OrderHeadModel> model)
 {
     InitializeComponent();
     _repo = new SaleOrderRepo();
     _selected = new OrderHeadModel();
     list = model;
     epiSession = _session;
 }
Esempio n. 7
0
 public DieMaster(SessionInfo _session, DieModel model = null)
 {
     InitializeComponent();
     this._repo = new DieMasterRepo();
     epiSession = _session;
     //epiSession = _session;
     DieHeader = model;
 }
Esempio n. 8
0
 public CoilBackRuleDialog(SessionInfo _session)
 {
     InitializeComponent();
     this._repo = new CoilBackRuleRepo();
     this.Code = "";
     this.Description = "";
     epiSession = _session;
 }
Esempio n. 9
0
 public SimulateReShear(SessionInfo _session = null, PlanningHeadModel model = null, SimulateReshearHeadModel data = null)
 {
     InitializeComponent();
     this._repo = new WorkEntryRepo();
     HeadModel = model;
     ReshearHead = data;
     epiSession = _session;
 }
Esempio n. 10
0
 public MCSSDashborad(SessionInfo _session = null, MCSS model = null)
 {
     InitializeComponent();
     this._repo = new McssRepo();
     this.McssList = new List<MCSS>();
     this.McssNum = "";
     epiSession = _session;
 }
Esempio n. 11
0
        public IEnumerable<MaterialFindingModel> SaveMaterial(SessionInfo _session, MaterialFindingModel model)
        {
            //int id = 0;
            string sql = string.Format(@"IF NOT EXISTS
									    (
										    SELECT * FROM ucc_prd_MaterailTracker (NOLOCK)
										    WHERE MaterialTransLineID = {1}
									    )
                                        BEGIN
                                            INSERT INTO ucc_prd_MaterailTracker
                                                       (WorkOrderID
                                                       ,MaterialTransLineID
                                                       ,FoundFlag
                                                       ,UnPackFlag
                                                       ,ProcessFlag
                                                       ,CreationDate
                                                       ,LastUpdateDate
                                                       ,CreatedBy
                                                       ,UpdatedBy)
                                                 VALUES
                                                       ({0}  --<WorkOrderID, bigint,>
                                                       ,{1}  --<MaterialTransLineID, bigint,>
                                                       ,{2}  --<FoundFlag, int,>
                                                       ,{3}  --<UnPackFlag, int,>
                                                       ,{4}  --<ProcessFlag, int,>
                                                       ,GETDATE()  --<CreationDate, datetime,>
                                                       ,GETDATE()  --<LastUpdateDate, datetime,>
                                                       ,N'{5}'  --<CreatedBy, varchar(45),>
                                                       ,N'{5}' --<UpdatedBy, varchar(45),>
		                                    )
                                        END
                                    ELSE
                                        BEGIN
                                            UPDATE ucc_prd_MaterailTracker
                                               SET WorkOrderID = {0}  --<WorkOrderID, bigint,>
                                                  ,FoundFlag = {2}  --<FoundFlag, int,>
                                                  ,UnPackFlag = {3}  --<UnPackFlag, int,>
                                                  ,ProcessFlag = {4}  --<ProcessFlag, int,>
                                                  ,LastUpdateDate = GETDATE()  --<LastUpdateDate, datetime,>
                                                  ,UpdatedBy =  N'{5}' --<UpdatedBy, varchar(45),>
                                             WHERE  MaterialTransLineID = {1} --<Search Conditions,,>
                                        END" + Environment.NewLine
                                              , model.WorkOrderID
                                              , model.TransactionLineID
                                              , Convert.ToInt32(model.FoundFlag.GetBoolean())
                                              , Convert.ToInt32(model.UnPackFlag.GetBoolean())
                                              , Convert.ToInt32(model.ProcessFlag.GetBoolean())
                                              , _session.UserID
                                              );

            //Update PartLot.CheckBox01 = 1 to change status has already used.
//            sql += string.Format(@"UPDATE PartLot SET CheckBox01 = 1, ShortChar05 = N'{2}', Date03 = CONVERT(DATETIME, '{3}',103), Number08 = 2
//                                   WHERE PartNum = N'{0}' AND LotNum = N'{1}'"
//                                   , model.MCSSNo, model.SerialNo, model.WorkOrderNum, model.WorkDate.ToString("dd/MM/yyyy hh:mm:ss"));

            Repository.Instance.ExecuteWithTransaction(sql, "Save Material");
            return GetAllMaterailTracker(_session.PlantID);
        }
Esempio n. 12
0
 public SerialList(SessionInfo _session = null, IEnumerable<GeneratedSerialModel> model = null, PlanningHeadModel head = null)
 {
     InitializeComponent();
     this._repo = new WorkEntryRepo();
     epiSession = _session;
     snList = model;
     workParent = head;
     GenSNComplete = true;
 }
Esempio n. 13
0
 public MaterialSelecting(SessionInfo _session, IEnumerable<MaterialModel> data, PlanningHeadModel workOrder)
 {
     InitializeComponent();
     this._repo = new WorkEntryRepo();
     epiSession = _session;
     this.model = data;
     this._selected = new MaterialModel();
     this.baseOrder = workOrder;
 }
Esempio n. 14
0
 public DiePatternMaster(SessionInfo _session, DiePatternModel model = null)
 {
     InitializeComponent();
     this._repo = new DieMasterRepo();
     this.PatternPara = "";
     this.StorePerPcsPara = "";
     this.RemarkPara = "";
     epiSession = _session;
 }
Esempio n. 15
0
 public OrderLineDialog(SessionInfo _session, IEnumerable<OrderDetailModel> model)
 {
     InitializeComponent();
     _repo = new SaleOrderRepo();
     _selected = new OrderDetailModel();
     this.listAll = new List<OrderDetailModel>();
     listAll = model;
     epiSession = _session;
 }
Esempio n. 16
0
 public StoreInPlanDialog(SessionInfo _session, IList<StoreInPlanDialogModel> param = null)//, int Status = 2, string TransType = "")
 {
     InitializeComponent();
     this._repo = new StoreInPlanRepo();
     this.HeadContent = new StoreInPlanDialogModel();
     this.list = param;
     epiSession = _session;
     //this.status = Status;
     //this.Type = TransType;
 }
Esempio n. 17
0
        public IEnumerable<WorkOrderPlanModel> GetWorksPlan(SessionInfo _session)
        {
            string sql = @"SELECT 0 as Seq, uf.Name as PICName, busi.Character01 as BussinessTypeName, plh.*
                                            FROM ucc_pln_PlanHead plh (NOLOCK)
                                            LEFT JOIN UserFile uf ON(plh.PIC = uf.DcdUserID)
                                            LEFT JOIN UD25 busi ON(plh.BT = busi.Key1)
                                            WHERE OpenFlag = 1";

            var result = Repository.Instance.GetMany<WorkOrderPlanModel>(sql);
            return result;
        }
Esempio n. 18
0
 public ReceiveArticleDialog(StoreInPlanDetail model, SessionInfo _session, int LineReceive, decimal WeightReceive)
 {
     InitializeComponent();
     this._repo = new StoreInPlanRepo();
     this.ArticleList = new List<StoreInPlanDetail>();
     this.lineNum = model;
     this.numofline = LineReceive;
     this.WeightRcv = WeightReceive;
     this.DataFlag = false;
     epiSession = _session;
 }
Esempio n. 19
0
        public Progression(string moduleName, decimal tranactionID, SessionInfo session, int possession)
        {
            InitializeComponent();
            this._repoPlan = new StoreInPlanRepo();
            this._repo = new StoreInRepo();
            this._session = session;
            this.Possession = possession;

            this.TransactionID = tranactionID;

            timer1.Enabled = false;
        }
Esempio n. 20
0
 public WorkEntryDialog(SessionInfo _session, IEnumerable<PlanningHeadModel> param = null)
 {
     InitializeComponent();
     this._repo = new WorkEntryRepo();
     this._repoRes = new ResourceRepo();
     this._repoUcd = new UserCodeRepo();
     this._model = param;
     //this.PatternPara = "";
     //this.StorePerPcsPara = "";
     //this.RemarkPara = "";
     epiSession = _session;
 }
Esempio n. 21
0
        public ProductionPlanModel Get(SessionInfo _session)
        {
            ProductionPlanModel model = new ProductionPlanModel();
            model.WorkDateFrom = DateTime.Now;
            model.WorkDateTo = DateTime.Now;
            model.DueDateFrom = DateTime.Now;
            model.DueDateTo = DateTime.Now;
            model.Resources = _repoResrc.GetAll(_session.PlantID).ToList();
            model.WorkOrders = GetWorksPlan(_session).ToList();

            return model;
        }
Esempio n. 22
0
        public CultureInfo cul;            //declare culture info

        public BaseSession()
        {
            if (Thread.CurrentThread.CurrentCulture.Name == "th-TH")
            {
                Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
            }

            res_man = new ResourceManager("Epicoil.Appl.Resources.Res", typeof(BaseSession).Assembly);
            epiSession = new SessionInfo();

            //Set default theme.
            initail.UseTheme(this);
        }
Esempio n. 23
0
        public MaterialTracker(SessionInfo _session = null, string str = null)
        {
            InitializeComponent();
            epiSession = _session;
            _repoWork = new WorkEntryRepo();
            _repo = new MaterialFindingRepo();
            _repoResrc = new ResourceRepo();
            _repoUcode = new UserCodeRepo();

            list = new List<MaterialFindingModel>();
            possessionList = new List<UserCodeModel>();
            resourceList = new List<ResourceModel>();
            modelFilter = new MaterialFindingModel();
        }
Esempio n. 24
0
        public StoreIn(SessionInfo _session = null, StoreInHead model = null)
        {
            InitializeComponent();
            this._repoPlan = new StoreInPlanRepo();
            this._repo = new StoreInRepo();
            this._repoWhse = new WharehouseRepo();

            //Initial Session and content
            this.HeadContent = new StoreInHead();
            epiSession = _session;
            if (model != null) this.HeadContent = model;

            this.ModelClone = new StoreInHead();
            HeadContent.InsertState = false;
        }
Esempio n. 25
0
        public IEnumerable<DieModel> Save(DieModel data, SessionInfo epiSession)
        {
            try
            {
                Session currSession = new Session(epiSession.UserID, epiSession.UserPassword, epiSession.AppServer, Session.LicenseType.Default);
                UD107 myUD107 = new UD107(currSession.ConnectionPool);
                UD107DataSet dsUD107 = new UD107DataSet();

                string whereClause = string.Format(@"UD107.Key1 ='{0}' AND UD107.Key5 = '{1}'", data.DieCode, epiSession.PlantID);
                bool morePages = false;
                bool dataExisting = false;

                try
                {
                    UD107DataSet ds = myUD107.GetByID(data.DieCode, "", "", "", epiSession.PlantID);
                    dataExisting = true;
                }
                catch (Exception ex)
                {
                    if (ex.Message == "Record not found.") dataExisting = false;
                }

                if (dataExisting)
                {
                    dsUD107 = myUD107.GetRows(whereClause, "", "", 0, 1, out morePages);
                }
                else
                {
                    myUD107.GetaNewUD107(dsUD107);
                }

                DataRow drUD107 = dsUD107.Tables[0].Rows[0];
                drUD107.BeginEdit();
                drUD107["Key1"] = data.DieCode;
                drUD107["Key5"] = epiSession.PlantID;
                drUD107["Character01"] = data.DieName;
                drUD107["Character02"] = string.IsNullOrEmpty(data.DieRemark) ? "" : data.DieRemark;
                drUD107["ShortChar01"] = string.IsNullOrEmpty(data.PatternID) ? "" : data.PatternID;
                drUD107.EndEdit();
                myUD107.Update(dsUD107);
                currSession.Dispose();
                return GetDieAll(epiSession.PlantID);
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Esempio n. 26
0
 public ProductionSlitter(SessionInfo _session = null, ProductionHeadModel model = null)
 {
     InitializeComponent();
     epiSession = _session;
     this._repo = new ProductionRepo();
     this._repoPlan = new WorkEntryRepo();
     this._repoRes = new ResourceRepo();
     this._repoUcd = new UserCodeRepo();
     HeaderContent = new ProductionHeadModel();
     cuttingList = new Dictionary<int, string>();
     pauseFlag = false;
     if (model != null)
     {
         this.HeaderContent = model;
     }
 }
Esempio n. 27
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
        }
Esempio n. 28
0
        public WorkEntry(SessionInfo _session = null, PlanningHeadModel model = null)
        {
            InitializeComponent();
            this._repoRes = new ResourceRepo();
            this._repoUcd = new UserCodeRepo();
            this._repo = new WorkEntryRepo();
            this._reRes = new ResourceRepo();
            this._repoSale = new SaleOrderRepo();
            this._repoCls = new ClassMasterRepo();

            this.HeaderContent = new PlanningHeadModel();
            this._class = new ClassMasterModel();

            //Initial Session and content
            this.HeaderContent = new PlanningHeadModel();
            epiSession = _session;
            if (model != null)
            {
                this.HeaderContent = model;
            }
        }
Esempio n. 29
0
        public bool ClearSerialInEpicor(SessionInfo _session, PlanningHeadModel model, out string msg)
        {
            msg = string.Empty;
            bool IsSuccess = true;
            string sql = string.Empty;
            Session currSession = null;
            var resultContinue = GetSerialAllByWorkOrder(model.WorkOrderID).ToList();
            try
            {
                currSession = new Session(_session.UserID, _session.UserPassword, _session.AppServer, Session.LicenseType.Default);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                IsSuccess = false;
            }

            foreach (var item in resultContinue)
            {
                try
                {
                    LotSelectUpdate lotPart = new LotSelectUpdate(currSession.ConnectionPool);
                    lotPart.DeleteByID(string.IsNullOrEmpty(item.NORNum) ? item.MCSSNo : item.NORNum, item.SerialNo);
                }
                catch (Exception ex)
                {
                    msg = ex.Message;
                    IsSuccess = false;
                }

                //TODO : There are has one more case for delete S/N.
                sql += string.Format(@"DELETE FROM ucc_pln_SerialGenerated WHERE WorkOrderID = {0} AND SerialNo = '{1}' {2}{3}{4}"
                                        , item.WorkOrderID, item.SerialNo, Environment.NewLine, "", Environment.NewLine);
            }

            sql += string.Format(@"UPDATE ucc_pln_PlanHead SET GenSerialFlag = 0 WHERE WorkOrderID = {0} ", model.WorkOrderID);
            Repository.Instance.ExecuteWithTransaction(sql, "Delete Serial");
            return IsSuccess;
        }
Esempio n. 30
0
 public NorDialog(SessionInfo _epiSession, IEnumerable<ProductsMasterModel> data)
 {
     InitializeComponent();
     epiSession = _epiSession;
     _model = data;
 }