Esempio n. 1
0
        public Master_Group Delete(string groupId)
        {
            var dc    = new eprocdbDataContext();
            var model = dc.Master_Groups.FirstOrDefault(v => v.GroupID == groupId);

            dc.Master_Groups.DeleteOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 2
0
        public GroupingVendorViewModel Edit(string groupId, GroupingVendorViewModel model)
        {
            var dc = new eprocdbDataContext();
            var md = (from c in dc.Master_Groups where c.GroupID == groupId select c).SingleOrDefault();

            md.Description = model.Description;
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 3
0
        public Log_Error AddLogError(Log_Error model)
        {
            var dc = new eprocdbDataContext();

            model.ErrorTime = DateTime.Now;
            dc.Log_Errors.InsertOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
        public Master_Menu Delete(string menuId)
        {
            var dc    = new eprocdbDataContext();
            var model = dc.Master_Menus.FirstOrDefault(v => v.MenuID == menuId);

            dc.Master_Menus.DeleteOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 5
0
        public Master_Menu Add(Master_Menu model)
        {
            var dc = new eprocdbDataContext();
            var id = "0" + (dc.Master_Menus.Count() + 1).ToString();

            model.MenuID = id;
            dc.Master_Menus.InsertOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 6
0
        public Log_Login AddLogLogin(Log_Login model)
        {
            var dc = new eprocdbDataContext();

            model.LoginID   = Guid.NewGuid();
            model.LoginDate = DateTime.Now;
            dc.Log_Logins.InsertOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 7
0
        public Master_Menu Edit(string menuId, Master_Menu model)
        {
            var dc = new eprocdbDataContext();
            var md = (from c in dc.Master_Menus where c.MenuID == menuId select c).SingleOrDefault();

            md.MenuID   = model.MenuID;
            md.MenuName = model.MenuName;
            md.Text     = model.Text;
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 8
0
        public GroupingVendorViewModel Add(GroupingVendorViewModel model)
        {
            var          dc  = new eprocdbDataContext();
            VENDOR_GROUP obj = new VENDOR_GROUP();

            obj.Group_VendorID   = model.GroupVendorId;
            obj.Group_VendorName = model.Description;

            dc.VENDOR_GROUPs.InsertOnSubmit(obj);
            dc.SubmitChanges();
            return(model);
        }
        public CUSTOMBPKB ReviseDetailBPKB(string PONumber, string ReasonForRevise)
        {
            var dc     = new eprocdbDataContext();
            var result = (from custbpkb in dc.CUSTOMBPKBs where custbpkb.PONUMBER == PONumber select custbpkb).SingleOrDefault();

            result.isRevised        = true;
            result.REASONREVISEBPKB = ReasonForRevise;
            result.MODIFIED_DATE    = DateTime.Now;
            result.MODIFIED_BY      = System.Web.HttpContext.Current.Session["UserID"].ToString();
            dc.SubmitChanges();
            return(result);
        }
Esempio n. 10
0
        public Master_User AddUser(Master_User model)
        {
            IHashingService sec      = new HashingService();
            var             dc       = new eprocdbDataContext();
            string          Password = "******";
            string          pwd      = sec.CreatePasswordHash(Password);

            model.Password = pwd;
            dc.Master_Users.InsertOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 11
0
        public Master_User Add(Master_User model)
        {
            IHashingService sec = new HashingService();
            string          pwd = sec.CreatePasswordHash(model.Password.Trim());

            var dc = new eprocdbDataContext();

            model.ID       = Guid.NewGuid();
            model.Password = pwd;
            dc.Master_Users.InsertOnSubmit(model);
            dc.SubmitChanges();
            return(model);
        }
        public Task InsertUploadFile(string PONumber, string ket, string fileName)
        {
            var dc   = new eprocdbDataContext();
            var data = (from a in dc.UPLOAD_FILEs where a.PONUMBER == PONumber select a).FirstOrDefault();

            if (data == null)
            {
                UPLOAD_FILE model = new UPLOAD_FILE();
                model.PONUMBER = PONumber;
                model.KET      = ket;
                model.FILE     = fileName;
                dc.UPLOAD_FILEs.InsertOnSubmit(model);
                dc.SubmitChanges();
            }
            else
            {
                data.PONUMBER = PONumber;
                data.FILE     = fileName;
                data.KET      = ket;
                dc.SubmitChanges();
            }
            return(null);
        }
Esempio n. 13
0
        public Master_User ChangedPassword(Master_User model, string NewPassword)
        {
            IHashingService sec = new HashingService();
            string          pwd = sec.CreatePasswordHash(NewPassword.Trim());

            var dc = new eprocdbDataContext();
            var md = (from c in dc.Master_Users
                      where c.UserID == model.UserID
                      select c).FirstOrDefault();

            md.Password = pwd;
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 14
0
        public Master_User Reset(string UserID, Master_User model)
        {
            IHashingService sec = new HashingService();
            string          pwd = sec.CreatePasswordHash("dc123");

            var dc = new eprocdbDataContext();
            var md = (from c in dc.Master_Users
                      where c.UserID == UserID
                      select c).FirstOrDefault();

            md.Password = pwd;
            dc.SubmitChanges();
            return(model);
        }
        public void UpdateInvoiceStatus(string ponumber)
        {
            var dc = new eprocdbDataContext();
            //string status = "";
            var rs = (from a in dc.CUSTOMIRs where a.PONUMBER == ponumber select a).FirstOrDefault();

            if (rs != null)
            {
                if (rs.TGLPEMBAYARAN != null && rs.TGLPEMBAYARAN.ToString() != "")
                {
                    rs.INVOICESTATUS = "Receipt";
                    dc.SubmitChanges();
                }
            }
        }
Esempio n. 16
0
        public CUSTOMBPKB UpdateInvoiceCustBpkb(string poNumber, CUSTOMBPKB model)
        {
            var dc = new eprocdbDataContext();

            var md = (from c in dc.CUSTOMBPKBs
                      where c.PONUMBER == poNumber.Trim()
                      select c).SingleOrDefault();

            md.NOFAKTUR      = model.NOFAKTUR;
            md.MODIFIED_BY   = model.MODIFIED_BY;
            md.MODIFIED_DATE = model.MODIFIED_DATE;
            dc.SubmitChanges();
            UpdateStatus(poNumber);
            return(model);
        }
Esempio n. 17
0
        public Master_Group Add(Master_Group model)
        {
            var          dc      = new eprocdbDataContext();
            Master_Group DataNew = new Master_Group();

            DataNew.ID           = model.ID;
            DataNew.GroupID      = model.GroupID;
            DataNew.Description  = model.Description;
            DataNew.CreatedBy    = model.CreatedBy;
            DataNew.CreatedDate  = model.CreatedDate;
            DataNew.DeleteStatus = model.DeleteStatus;
            DataNew.IsAdmin      = model.IsAdmin;
            dc.Master_Groups.InsertOnSubmit(DataNew);
            dc.SubmitChanges();
            return(model);
        }
        public DetailAssignmentPOProcViewModel UpdateAssignment(DetailAssignmentPOProcViewModel model)
        {
            var dc     = new eprocdbDataContext();
            var result = (from custgr in dc.CUSTOMGRs where custgr.PONUMBER == model.PONumber select custgr).SingleOrDefault();

            result.STATUSDELIVERYUNIT = model.TujuanDeliveryUnit;
            result.MODIFIED_DATE      = DateTime.Now;
            result.MODIFIED_BY        = System.Web.HttpContext.Current.Session["UserID"].ToString();
            var result2 = (from custpo in dc.CUSTOMPOs where custpo.PONUMBER == model.PONumber select custpo).FirstOrDefault();

            result2.MODIFIED_DATE = DateTime.Now;
            result2.MODIFIED_BY   = System.Web.HttpContext.Current.Session["UserID"].ToString();
            dc.SubmitChanges();
            UpdateStatus(model.PONumber);
            UpdateInvoiceStatus(model.PONumber);
            return(model);
        }
        public DetailBPKBPOVendorViewModel UpdateBPKB(DetailBPKBPOVendorViewModel model)
        {
            var dc       = new eprocdbDataContext();
            var prnumber = (from custpo in dc.CUSTOMPOs where custpo.PONUMBER == model.PONumber select custpo).SingleOrDefault();

            prnumber.ACTUALRECEIVEDBPKBHOFROMBRANCH = model.ActualReceivedBPKBHOFromBranch;
            string strPrNumber = prnumber.PRNUMBERSAP;
            var    result      = (from custbpkb in dc.CUSTOMBPKBs where custbpkb.PONUMBER == model.PONumber select custbpkb).SingleOrDefault();

            result.ACTUALDELIVERYBPKBTOFINANCE = model.ActualDeliveryBPKBDateHO;
            result.ACTUALRECEIVEDBPKBDICAB     = model.ActualDeliveredBPKBDateCabang;
            result.KETBPKB                      = model.RemarksBPKB;
            result.NOBPKB                       = model.BPKBNumber;
            result.KETSURATUBAHBENTUK           = model.KeteranganSuratUbahBentuk;
            result.KETERANGANSURATRUBAHWARNA    = model.KeteranganSuratUbahWarna;
            result.NOFAKTUR                     = model.NoFakturKendaraan;
            result.TGLFAKTUR                    = model.TanggalFakturKendaraan;
            result.NOSERTIFIKAT                 = model.NoSertifikat;
            result.TGLSERTIFIKAT                = model.TanggalSertifikat;
            result.NOFORMULIRA                  = model.NoFormulirA;
            result.TGLFORMULIRA                 = model.TanggalFormulirA;
            result.NOSURATUBAHBENTUK            = model.NoSuratUbahBentuk;
            result.TGLSURATUBAHBENTUK           = model.TanggalSuratUbahBentuk;
            result.NOSURATRUBAHWARNA            = model.NoSuratUbahWarna;
            result.TANGGALSURATRUBAHWARNA       = model.TanggalSuratUbahWarna;
            result.NOSERTIFIKATREGUJITIPE       = model.NoSertifikatRegistrasiUjiTipe;
            result.ACTUALRECEIVEDBPKBDIHO       = model.ActualDeliveryBPKBDateHO;
            result.ACTUALDELIVERYBPKBTOFINANCE  = model.ActualDeliveredDateBPKBToFinance;
            result.ACTUALRECEIVEDBPKBHOBACK     = model.BPKBDateSentBack;
            result.ACTUALRECEIVEDBPKBHOBACK     = model.ActualReceivedBPKBHOBack;
            result.DATEDELIVERYTOBRANCHORVENDOR = model.DateDeliveryToBranchVendor;
            result.REMARKSDETAILPROBLEM         = model.RemarksDetailProblem;
            result.POSISIBPKB                   = model.BPKBPosition;
            result.MODIFIED_DATE                = DateTime.Now;
            result.MODIFIED_BY                  = System.Web.HttpContext.Current.Session["UserID"].ToString();
            var result2 = (from custpr in dc.CUSTOMPRs where custpr.PRSAP == strPrNumber select custpr.YEAR).FirstOrDefault();

            result2 = model.Year;


            dc.SubmitChanges();
            UpdateStatus(model.PONumber);
            UpdateInvoiceStatus(model.PONumber);

            return(model);
        }
        public DetailAssignmentPOVendorViewModel SubmitAssignment(DetailAssignmentPOVendorViewModel model)
        {
            var dc     = new eprocdbDataContext();
            var result = (from custpo in dc.CUSTOMPOs where custpo.PONUMBER == model.PONumber select custpo).SingleOrDefault();

            result.POSTATUSID    = model.POStatus;
            result.MODIFIED_DATE = DateTime.Now;
            result.MODIFIED_BY   = System.Web.HttpContext.Current.Session["UserID"].ToString();

            var result2 = (from stream in dc.STREAMLINERs where stream.PONUMBER == model.PONumber select stream).SingleOrDefault();

            result2.BBN = model.BBN;
            dc.SubmitChanges();
            UpdateStatus(model.PONumber);
            UpdateInvoiceStatus(model.PONumber);
            return(model);
        }
Esempio n. 21
0
        public CUSTOMGR UpdateInvoiceCustGR(string poNumber, CUSTOMGR model)
        {
            var dc = new eprocdbDataContext();

            var md = (from c in dc.CUSTOMGRs
                      where c.PONUMBER == poNumber.Trim()
                      select c).SingleOrDefault();

            md.NOCHASIS_INPUT           = model.NOCHASIS_INPUT;
            md.NOENGINE_INPUT           = model.NOENGINE_INPUT;
            md.ACTUALRECEIVEDUNITINBDEL = model.ACTUALRECEIVEDUNITINBDEL;
            md.MODIFIED_BY   = model.MODIFIED_BY;
            md.MODIFIED_DATE = model.MODIFIED_DATE;
            dc.SubmitChanges();
            UpdateStatus(poNumber);
            return(model);
        }
        public CUSTOMCITY Edit(string cityId, CUSTOMCITY model)
        {
            var dc = new eprocdbDataContext();
            var md = (from c in dc.CUSTOMCITies where c.CITYID == cityId select c).SingleOrDefault();

            md.CITYNAME = model.CITYNAME;
            if (model.STATUS == null)
            {
                md.STATUS = md.STATUS;
            }
            else
            {
                md.STATUS = model.STATUS;
            }
            dc.SubmitChanges();
            return(model);
        }
        public Company_Code Edit(string companyCode, Company_Code model)
        {
            var dc = new eprocdbDataContext();
            var md = (from c in dc.Company_Codes where c.companyCode == companyCode select c).SingleOrDefault();

            md.companyName = model.companyName;
            if (model.status == null)
            {
                md.status = md.status;
            }
            else
            {
                md.status = model.status;
            }
            dc.SubmitChanges();
            return(model);
        }
        public CUSTOMCOMPANY Edit(string companyId, CUSTOMCOMPANY model)
        {
            var dc = new eprocdbDataContext();
            var md = (from c in dc.CUSTOMCOMPANies where c.COMPANYCODE == companyId select c).SingleOrDefault();

            md.COMPANYNAME    = model.COMPANYNAME;
            md.ALAMAT         = model.ALAMAT;
            md.KOTA           = model.KOTA;
            md.REGION         = model.REGION;
            md.POSTALCODE     = model.POSTALCODE;
            md.TELEPON        = model.TELEPON;
            md.NPWP           = model.NPWP;
            md.KTPTDP         = model.KTPTDP;
            md.COMPANYCODETSO = model.COMPANYCODETSO;
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 25
0
        public Master_User UpdateUser(string id, Master_User model)
        {
            var dc = new eprocdbDataContext();

            var md = (from c in dc.Master_Users
                      where c.UserID == id
                      select c).SingleOrDefault();


            md.FullName  = model.FullName;
            md.GroupID   = model.GroupID;
            md.id_vendor = model.id_vendor;

            dc.SubmitChanges();

            return(model);
        }
        public CUSTOMREGION Edit(string regionId, CUSTOMREGION model)
        {
            var dc = new eprocdbDataContext();
            var md = (from c in dc.CUSTOMREGIONs where c.REGIONID == regionId select c).SingleOrDefault();

            md.REGIONNAME = model.REGIONNAME;
            if (model.STATUS != null)
            {
                md.STATUS = model.STATUS;
            }
            else
            {
                md.STATUS = md.STATUS;
            }
            dc.SubmitChanges();
            return(model);
        }
Esempio n. 27
0
        public CUSTOMGR UpdateInvoiceCustGR(string poNumber, CUSTOMGR model)
        {
            var dc = new eprocdbDataContext();

            var md = (from c in dc.CUSTOMGRs
                      where c.PONUMBER == poNumber.Trim()
                      select c).SingleOrDefault();

            if (md != null)
            {
                md.STATUSDELIVERYUNIT = model.STATUSDELIVERYUNIT;
                md.MODIFIED_BY        = model.MODIFIED_BY;
                md.MODIFIED_DATE      = model.MODIFIED_DATE;
                dc.SubmitChanges();
                UpdateStatus(poNumber);
            }
            return(model);
        }
Esempio n. 28
0
        public CUSTOMPO UpdateInvoiceCustPO(string poNumber, CUSTOMPO model)
        {
            var dc = new eprocdbDataContext();

            var md = (from c in dc.CUSTOMPOs
                      where c.PONUMBER == poNumber.Trim()
                      select c).SingleOrDefault();

            if (md != null)
            {
                md.TGLGI         = model.TGLGI;
                md.MODIFIED_BY   = model.MODIFIED_BY;
                md.MODIFIED_DATE = model.MODIFIED_DATE;
                dc.SubmitChanges();
                UpdateStatus(poNumber);
            }
            return(model);
        }
        public DetailBPKBPOProcViewModel UpdateBPKB(DetailBPKBPOProcViewModel model)
        {
            var dc = new eprocdbDataContext();

            var resultpo = (from custpo in dc.CUSTOMPOs where custpo.PONUMBER == model.PONumber select custpo).SingleOrDefault();

            resultpo.ACTUALRECEIVEDBPKBHOFROMBRANCH = model.ActualReceivedDateBPKBHOFromBranch;
            resultpo.MODIFIED_DATE           = DateTime.Now;
            resultpo.MODIFIED_BY             = System.Web.HttpContext.Current.Session["UserID"].ToString();
            resultpo.ACTUALDATEDELIVEREDUNIT = model.TanggalBSTB;
            var result = (from custbpkb in dc.CUSTOMBPKBs where custbpkb.PONUMBER == model.PONumber select custbpkb).SingleOrDefault();

            result.ACTUALRECEIVEDBPKBDIHO  = model.ActualReceivedDateBPKBdiHO;
            result.ACTUALRECEIVEDBPKBDICAB = model.ActualReceivedDateBPKBdiCabang;
            result.DETAILPROBLEM           = model.DetailProblem;
            result.REASONREVISEBPKB        = model.ReasonForReviseBPKB;
            result.TGLSERAHBPKB            = model.BPKBGRDate;

            result.ACTUALDELIVERYBPKBTOFINANCE  = model.ActualDeliveredDateBPKBToFinance;
            result.TGLBPKBDIKIRIMKEMBALI        = model.BPKBDateSentBack;
            result.ACTUALRECEIVEDBPKBHOBACK     = model.ActualReceivedBPKBHOBack;
            result.DATEDELIVERYTOBRANCHORVENDOR = model.DateDeliveryToBranchVendor;
            result.NOBPKB                    = model.BPKBNumber;
            result.NOFAKTUR                  = model.NoFakturKendaraan;
            result.NOSERTIFIKAT              = model.NoSertifikatNIK;
            result.NOFORMULIRA               = model.NoFormulirA;
            result.KETSURATUBAHBENTUK        = model.KeteranganSuratUbahBentuk;
            result.NOSURATUBAHBENTUK         = model.NoSuratUbahBentuk;
            result.TGLSURATUBAHBENTUK        = model.TanggalSuratUbahBentuk;
            result.KETERANGANSURATRUBAHWARNA = model.KeteranganSuratUbahWarna;
            result.NOSURATRUBAHWARNA         = model.NoSuratUbahWarna;
            result.TANGGALSURATRUBAHWARNA    = model.TanggalSuratUbahWarna;
            result.NOSERTIFIKATREGUJITIPE    = model.NoSertifikatRegistrasiUjiTipe;
            result.REMARKSDETAILPROBLEM      = model.RemarksDetailProblem;
            result.KETBPKB                   = model.RemarksBPKB;
            result.STATUSBPKB                = model.StatusBPKB;
            result.MODIFIED_DATE             = DateTime.Now;
            result.MODIFIED_BY               = System.Web.HttpContext.Current.Session["UserID"].ToString();

            dc.SubmitChanges();
            UpdateStatus(model.PONumber);
            UpdateInvoiceStatus(model.PONumber);
            return(model);
        }
Esempio n. 30
0
        public CUSTOMGR UpdateDeliveryCustGR(string poNumber, CUSTOMGR model)
        {
            var dc = new eprocdbDataContext();

            var md = (from c in dc.CUSTOMGRs
                      where c.PONUMBER == poNumber.Trim()
                      select c).SingleOrDefault();

            if (md != null)
            {
                md.NOCHASIS_INPUT = model.NOCHASIS_INPUT;
                md.NOENGINE_INPUT = model.NOENGINE_INPUT;
                md.MODIFIED_BY    = model.MODIFIED_BY;
                md.MODIFIED_DATE  = model.MODIFIED_DATE;
                dc.SubmitChanges();
                UpdateStatus(poNumber);
            }
            return(model);
        }