예제 #1
0
        public void AddFiledtl(filemanagerdtl record)
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.filemanagerdtls.Add(record);

            entities.SaveChanges();
        }
예제 #2
0
        public void UpdateFiledtl(filemanagerdtl record)
        {
            frssdbEntities entities = new frssdbEntities();

            entities.Entry(record).State = System.Data.Entity.EntityState.Modified;
            entities.SaveChanges();
        }
예제 #3
0
        public SigninStatus SigninUser(string userName, string password)
        {
            usermaster user;

            using (frssdbEntities entities = new frssdbEntities())
            {
                //password = CryptograpyHelper.ToSha256(password);
                user = entities.usermasters.FirstOrDefault(s => s.username == userName && s.userpwd == password);
                if (user != null)
                {
                    user.lockuser = "******";
                    entities.SaveChanges();
                }
                if (user == null)
                {
                    return(SigninStatus);
                }
                else
                {
                    SigninStatus = SigninStatus.Success;
                }
                User         = user;
                User.userpwd = string.Empty;

                return(SigninStatus);
            }
        }
예제 #4
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);
            }
        }
예제 #5
0
        public void AddUpdateCompfinYear(bool addmode, string compfinid, string compid, string finyearstart, string finyearend, string custid, string addedby)
        {
            string result           = string.Empty;
            string ip               = Common.GetUserIp;
            long?  compfinyearid1_1 = 0;
            string compfinyearid_1  = "";

            if (addmode == true)
            {
                compfinyearid1_1 = GetMaxNo(custid);
                compfinyearid_1  = custid + "-" + compfinyearid1_1.ToString();

                using (frssdbEntities entities = new frssdbEntities())
                {
                    compfinyear entry = new compfinyear
                    {
                        compfinid   = compfinyearid_1,
                        compfinid1  = compfinyearid1_1,
                        compid      = compid,
                        finyrstart  = finyearstart,
                        finyrend    = finyearend,
                        custid      = custid,
                        syncflg     = '0',
                        addedby     = addedby,
                        adddatetime = DateTime.Now
                    };
                    entities.compfinyears.Add(entry);
                    entities.SaveChanges();
                }
            }
            else
            {
                using (frssdbEntities entities = new frssdbEntities())
                {
                    compfinyear entry = entities.compfinyears.FirstOrDefault(p => p.compfinid == compfinid && p.custid == custid);

                    if (entry != null)
                    {
                        entry.compfinid   = compfinid;
                        entry.compid      = compid;
                        entry.finyrstart  = finyearstart;
                        entry.finyrend    = finyearend;
                        entry.custid      = custid;
                        entry.syncflg     = '0';
                        entry.addedby     = addedby;
                        entry.adddatetime = DateTime.Now;
                    }
                    entities.SaveChanges();
                }
            }
        }
예제 #6
0
        public void Changepassword(string userid, string userpwd, string custid)
        {
            using (frssdbEntities entities = new frssdbEntities())
            {
                usermaster entry = entities.usermasters.FirstOrDefault(p => p.userid == userid && p.custid == custid);

                if (entry != null)
                {
                    entry.userpwd = userpwd;
                    entry.custid  = custid;
                }
                entities.SaveChanges();
            }
        }
예제 #7
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();
                }
            }
        }
예제 #8
0
        public void AddUpdatemanageuserinfo(bool formmode, long?infoid, string compcode, string compname, string compaddr1, string compaddr2, string compaddr3, long?compzip, string compcity, string compstate, long?compstatecode, string compcontry, long?compstdcode, long?compphone, long?compmobile1, long?compmobile2, string compemail, string compweb, string compgstno, string comppanno, string compdruglicno, string compserialkey, string custid)
        {
            string result    = string.Empty;
            string ip        = Common.GetUserIp;
            long   infoid1_1 = 0;

            if (formmode == true)
            {
                infoid1_1 = Convert.ToInt32(GetMaxNo(custid));

                using (frssdbEntities entities = new frssdbEntities())
                {
                    userinfo entry = new userinfo
                    {
                        infoid        = infoid1_1,
                        compcode      = compcode,
                        compname      = compname,
                        compaddr1     = compaddr1,
                        compaddr2     = compaddr2,
                        compaddr3     = compaddr3,
                        compzip       = compzip,
                        compcity      = compcity,
                        compstate     = compstate,
                        compstatecode = compstatecode,
                        compcontry    = compcontry,
                        compstdcode   = compstdcode,
                        compphone     = compphone,
                        compmobile1   = compmobile1,
                        compmobile2   = compmobile2,
                        compemail     = compemail,
                        compweb       = compweb,
                        compgstno     = compgstno,
                        comppanno     = comppanno,
                        compdruglicno = compdruglicno,
                        compserialkey = compserialkey,
                        syncflg       = '0',
                        custid        = custid,
                    };
                    entities.userinfoes.Add(entry);
                    entities.SaveChanges();
                }
            }
            else
            {
                using (frssdbEntities entities = new frssdbEntities())
                {
                    userinfo entry = entities.userinfoes.FirstOrDefault(p => p.infoid == infoid && p.custid == custid);

                    if (entry != null)
                    {
                        entry.compcode      = compcode;
                        entry.compname      = compname;
                        entry.compaddr1     = compaddr1;
                        entry.compaddr2     = compaddr2;
                        entry.compaddr3     = compaddr3;
                        entry.compzip       = compzip;
                        entry.compcity      = compcity;
                        entry.compstate     = compstate;
                        entry.compstatecode = compstatecode;
                        entry.compcontry    = compcontry;
                        entry.compstdcode   = compstdcode;
                        entry.compphone     = compphone;
                        entry.compmobile1   = compmobile1;
                        entry.compmobile2   = compmobile2;
                        entry.compemail     = compemail;
                        entry.compweb       = compweb;
                        entry.compgstno     = compgstno;
                        entry.comppanno     = comppanno;
                        entry.compdruglicno = compdruglicno;
                        entry.compserialkey = compserialkey;
                        entry.syncflg       = '1';
                        entry.custid        = custid;
                    }
                    entities.SaveChanges();
                }
            }
        }
예제 #9
0
        public void AddUpdateUserMaster(bool addmode, string userid, string username, string userpwd, string usermobile, string useremail, string userstatus, string custid, bool?addrights, bool?editrights, bool?deleterights, bool?uploadrights, bool?downloadrights, bool?sendmailrights)
        {
            string result    = string.Empty;
            string ip        = Common.GetUserIp;
            long?  userid1_1 = 0;
            string userid_1  = "";

            if (addmode == true)
            {
                userid1_1 = GetMaxNo(custid);
                userid_1  = custid + "-" + userid1_1.ToString();

                using (frssdbEntities entities = new frssdbEntities())
                {
                    usermaster entry = new usermaster
                    {
                        userid         = userid_1,
                        userid1        = userid1_1,
                        username       = username,
                        userpwd        = userpwd,
                        usermobile     = usermobile,
                        useremail      = useremail,
                        userstatus     = userstatus,
                        syncflg        = '0',
                        addrights      = addrights,
                        editrights     = editrights,
                        deleterights   = deleterights,
                        uploadrights   = uploadrights,
                        downloadrights = downloadrights,
                        sendmailrights = sendmailrights,
                        custid         = custid
                    };
                    entities.usermasters.Add(entry);
                    entities.SaveChanges();
                }
            }
            else
            {
                using (frssdbEntities entities = new frssdbEntities())
                {
                    usermaster entry = entities.usermasters.FirstOrDefault(p => p.userid == userid && p.custid == custid);

                    if (entry != null)
                    {
                        entry.username       = username;
                        entry.userpwd        = userpwd;
                        entry.usermobile     = usermobile;
                        entry.useremail      = useremail;
                        entry.userstatus     = userstatus;
                        entry.syncflg        = '1';
                        entry.addrights      = addrights;
                        entry.editrights     = editrights;
                        entry.deleterights   = deleterights;
                        entry.uploadrights   = uploadrights;
                        entry.downloadrights = downloadrights;
                        entry.sendmailrights = sendmailrights;
                        entry.custid         = custid;
                    }
                    entities.SaveChanges();
                }
            }
        }