Example #1
0
        public compmaster GetCompMasterbyId(string compid, string custid)
        {
            frssdbEntities entities = new frssdbEntities();
            compmaster     compmst  = entities.compmasters.FirstOrDefault(s => s.compid == compid && s.custid == custid);

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

            return(compmst);
        }
Example #2
0
        public string AddNewEvent(string compid, long compid1, string compcode, string compname, string compaddr1, string compaddr2, string compaddr3,
                                  string compcity, long?compzip, string compstate, string compcontry, long?compstdcode, long?compphone,
                                  long?compmobile1, long?compmobile2, string compweb, string compemail, long?compstatecode, string compgstno,
                                  string comppanno, long syncflg, string custid, string area, string tanno, DateTime?regdate, string regno, long?faxno)
        {
            string ip        = Common.GetUserIp;
            string result    = string.Empty;
            long?  compid1_1 = 0;
            string compid_1  = "";

            compid1_1 = GetMaxNo(custid);
            compid_1  = custid + "-" + compid1_1.ToString();

            using (frssdbEntities entities = new frssdbEntities())
            {
                compmaster entry = new compmaster
                {
                    compid        = compid_1,
                    compid1       = compid1_1,
                    compcode      = compcode,
                    compname      = compname,
                    compaddr1     = compaddr1,
                    compaddr2     = compaddr2,
                    compaddr3     = compaddr3,
                    compcity      = compcity,
                    compzip       = compzip,
                    compstate     = compstate,
                    compcontry    = compcontry,
                    compstdcode   = compstdcode,
                    compphone     = compphone,
                    compmobile1   = compmobile1,
                    compmobile2   = compmobile2,
                    compweb       = compweb,
                    compemail     = compemail,
                    compstatecode = compstatecode,
                    compgstno     = compgstno,
                    comppanno     = comppanno,
                    syncflg       = syncflg,
                    custid        = custid,
                    area          = area,
                    tanno         = tanno,
                    regdate       = regdate,
                    regno         = regno,
                    faxno         = faxno,
                    adddatetime   = System.DateTime.Now
                };
                entities.compmasters.Add(entry);
                entities.SaveChanges();
                return(entry.compid);
            }
        }
Example #3
0
        public void UpdateEvent(string compid, long compid1, string compcode, string compname, string compaddr1, string compaddr2, string compaddr3,
                                string compcity, long?compzip, string compstate, string compcontry, long?compstdcode, long?compphone,
                                long?compmobile1, long?compmobile2, string compweb, string compemail, long?compstatecode, string compgstno,
                                string comppanno, long syncflg, string custid, string area, string tanno, DateTime?regdate, string regno, long?faxno)
        {
            using (frssdbEntities entities = new frssdbEntities())
            {
                compmaster entry = entities.compmasters.FirstOrDefault(p => p.compid == compid && p.custid == custid);

                if (entry != null)
                {
                    entry.compid        = compid;
                    entry.compid1       = compid1;
                    entry.compcode      = compcode;
                    entry.compname      = compname;
                    entry.compaddr1     = compaddr1;
                    entry.compaddr2     = compaddr2;
                    entry.compaddr3     = compaddr3;
                    entry.compcity      = compcity;
                    entry.compzip       = compzip;
                    entry.compstate     = compstate;
                    entry.compcontry    = compcontry;
                    entry.compstdcode   = compstdcode;
                    entry.compphone     = compphone;
                    entry.compmobile1   = compmobile1;
                    entry.compmobile2   = compmobile2;
                    entry.compweb       = compweb;
                    entry.compemail     = compemail;
                    entry.compstatecode = compstatecode;
                    entry.compgstno     = compgstno;
                    entry.comppanno     = comppanno;
                    entry.syncflg       = syncflg;
                    entry.custid        = custid;
                    entry.area          = area;
                    entry.tanno         = tanno;
                    entry.regdate       = regdate;
                    entry.regno         = regno;
                    entry.faxno         = faxno;

                    entities.SaveChanges();
                }
            }
        }