Ejemplo n.º 1
0
        public DataTable LoadSimalateMRPHeader(string strMRP_NO)
        {
            MRPHDAO dao = new MRPHDAO(Common.CurrentDatabase);

            return(dao.LoadSimalateMRPHeader(null, strMRP_NO));
        }
Ejemplo n.º 2
0
        public DataTable LoadMRPList(NZDateTime dtmDate, NZDateTime dtmDateTo)
        {
            MRPHDAO dao = new MRPHDAO(Common.CurrentDatabase);

            return(dao.LoadMRPList(null, dtmDate, dtmDateTo));
        }
Ejemplo n.º 3
0
        public void SaveData(MRPHDTO dtoHeader, List <MRPDDTO> dtoInsert, List <MRPDDTO> dtoUpdate, List <MRPDDTO> dtoDelete)
        {
            try {
                CheckBeforeSave();

                Common.CurrentDatabase.KeepConnection = true;
                Common.CurrentDatabase.BeginTransaction(IsolationLevel.Serializable);

                //Update Header
                MRPHDAO daoMRPH = new MRPHDAO(Common.CurrentDatabase);
                daoMRPH.UpdateMRPRevision(null, dtoHeader);

                MRPDDAO daoMRPD = new MRPDDAO(Common.CurrentDatabase);

                if (dtoDelete != null && dtoDelete.Count > 0)
                {
                    foreach (MRPDDTO dto in dtoDelete)
                    {
                        dto.CRT_BY      = Common.CurrentUserInfomation.UserCD;
                        dto.CRT_DATE    = DateTime.Now.ToNZDateTime();
                        dto.CRT_MACHINE = Common.CurrentUserInfomation.Machine;
                        dto.UPD_BY      = Common.CurrentUserInfomation.UserCD;
                        dto.UPD_DATE    = DateTime.Now.ToNZDateTime();
                        dto.UPD_MACHINE = Common.CurrentUserInfomation.Machine;
                        daoMRPD.Delete(null, dto.MRP_NO, dto.ITEM_CD, dto.ORDER_LOC_CD, dto.AT_DATE);
                    }
                }

                if (dtoInsert != null && dtoInsert.Count > 0)
                {
                    foreach (MRPDDTO dto in dtoInsert)
                    {
                        dto.CRT_BY      = Common.CurrentUserInfomation.UserCD;
                        dto.CRT_DATE    = DateTime.Now.ToNZDateTime();
                        dto.CRT_MACHINE = Common.CurrentUserInfomation.Machine;
                        dto.UPD_BY      = Common.CurrentUserInfomation.UserCD;
                        dto.UPD_DATE    = DateTime.Now.ToNZDateTime();
                        dto.UPD_MACHINE = Common.CurrentUserInfomation.Machine;
                        daoMRPD.AddNewOrUpdate(null, dto);
                    }
                }

                if (dtoUpdate != null && dtoUpdate.Count > 0)
                {
                    foreach (MRPDDTO dto in dtoUpdate)
                    {
                        dto.CRT_BY      = Common.CurrentUserInfomation.UserCD;
                        dto.CRT_DATE    = DateTime.Now.ToNZDateTime();
                        dto.CRT_MACHINE = Common.CurrentUserInfomation.Machine;
                        dto.UPD_BY      = Common.CurrentUserInfomation.UserCD;
                        dto.UPD_DATE    = DateTime.Now.ToNZDateTime();
                        dto.UPD_MACHINE = Common.CurrentUserInfomation.Machine;
                        daoMRPD.AddNewOrUpdate(null, dto);
                    }
                }

                //Call Update Balance Stock
                daoMRPD.UpdateBalanceStock(null, dtoHeader);

                Common.CurrentDatabase.Commit();
            }
            catch (Exception) {
                Common.CurrentDatabase.Rollback();
                throw;
            }
        }
Ejemplo n.º 4
0
        public List <MRPHDTO> LoadMRPH(string strMRP_NO)
        {
            MRPHDAO dao = new MRPHDAO(Common.CurrentDatabase);

            return(dao.LoadMRPHeader(null, strMRP_NO));
        }
Ejemplo n.º 5
0
        public MRPHDTO LoadMRPHByPK(string strMRP_NO, string strITEM_CD, string strLOC_CD)
        {
            MRPHDAO dao = new MRPHDAO(Common.CurrentDatabase);

            return(dao.LoadByPK(null, strMRP_NO.ToNZString(), strITEM_CD.ToNZString(), strLOC_CD.ToNZString()));
        }