コード例 #1
0
        public List <compmaster> GetCompany()
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.compmasters.ToList();

            return(data);
        }
コード例 #2
0
ファイル: ChallanForm.cs プロジェクト: adipsingh/asdss
 public mstchallandown ChallanFormById(int id)
 {
     using (frssdbEntities entities = new frssdbEntities())
     {
         return(entities.mstchallandowns.Where(ch => ch.id == id).FirstOrDefault());
     }
 }
コード例 #3
0
        public void UpdateFiledtl(filemanagerdtl record)
        {
            frssdbEntities entities = new frssdbEntities();

            entities.Entry(record).State = System.Data.Entity.EntityState.Modified;
            entities.SaveChanges();
        }
コード例 #4
0
        public void AddFiledtl(filemanagerdtl record)
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.filemanagerdtls.Add(record);

            entities.SaveChanges();
        }
コード例 #5
0
 public string GetUserIdByUserName(string userName)
 {
     using (frssdbEntities entity = new frssdbEntities())
     {
         return(entity.usermasters.FirstOrDefault(s => s.username == userName).userid);
     }
 }
コード例 #6
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);
            }
        }
コード例 #7
0
        public async Task <SigninStatus> SigninUserAsync(string userName, string password, string custid)
        {
            usermaster user;

            using (frssdbEntities entities = new frssdbEntities())
            {
                Task <usermaster> objlogin = entities.usermasters.FirstOrDefaultAsync(s => s.username == userName && s.userpwd == password && s.custid == custid);

                user = await objlogin;
                if (user != null)
                {
                    user.lockuser = "******";
                    await entities.SaveChangesAsync();
                }
            }

            if (user == null)
            {
                return(SigninStatus);
            }
            else
            {
                SigninStatus = SigninStatus.Success;
            }
            User         = user;
            User.userpwd = string.Empty;
            return(SigninStatus);
        }
コード例 #8
0
        public List <mstfilecategory> GetFileCategory()
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.mstfilecategories.ToList();

            return(data);
        }
コード例 #9
0
        public List <mstfilesubcategory> GetFileSubCategory(int catid)
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.mstfilesubcategories.Where(cat => cat.catid == catid).ToList();

            return(data);
        }
コード例 #10
0
        public List <compfinyearlist> GetCompFinYear(string compid)
        {
            frssdbEntities entities = new frssdbEntities();
            var            compcode = entities.compmasters.FirstOrDefault(c => c.compid == compid).compcode;
            var            data     = entities.compfinyearlists.Where(cat => cat.compcode == compcode).ToList();

            return(data);
        }
コード例 #11
0
ファイル: ManageCompFinYear.cs プロジェクト: adipsingh/asdss
        public bool GetFinYearByCompYear(string compid, string finyrstart, string finyrend, string custid)
        {
            frssdbEntities entities      = new frssdbEntities();
            compfinyear    compfinyrlist = entities.compfinyears.FirstOrDefault(s => s.compid == compid && s.finyrstart == finyrstart && s.finyrend == finyrend && s.custid == custid);

            if (compfinyrlist == null)
            {
                return(false);
            }
            return(true);
        }
コード例 #12
0
ファイル: ManageCompFinYear.cs プロジェクト: adipsingh/asdss
        public compfinyear GetFinYearbyId(string compfinyrid, string custid)
        {
            frssdbEntities entities  = new frssdbEntities();
            compfinyear    compfinyr = entities.compfinyears.FirstOrDefault(s => s.compfinid == compfinyrid && s.custid == custid);

            if (compfinyr == null)
            {
                return(null);
            }
            return(compfinyr);
        }
コード例 #13
0
        public IEnumerable <filemanagerdtl> GetFileDetailsById(string fileid, string custid)
        {
            frssdbEntities entities = new frssdbEntities();
            IEnumerable <filemanagerdtl> filemgr = entities.filemanagerdtls.Where(s => s.fileid == fileid && s.custid == custid);

            if (filemgr == null)
            {
                return(null);
            }
            return(filemgr);
        }
コード例 #14
0
        public usermaster GetUserbyId(string userid, string custid)
        {
            frssdbEntities entities = new frssdbEntities();
            usermaster     usermstr = entities.usermasters.FirstOrDefault(s => s.userid == userid && s.custid == custid);

            if (usermstr == null)
            {
                return(null);
            }
            return(usermstr);
        }
コード例 #15
0
        public userinfo GetUserInfoById(string custid)
        {
            frssdbEntities entities  = new frssdbEntities();
            userinfo       userinfo1 = entities.userinfoes.FirstOrDefault(s => s.custid == custid);

            if (userinfo1 == null)
            {
                return(null);
            }
            return(userinfo1);
        }
コード例 #16
0
        public static emailsetting GetEmailSettings(string custid)
        {
            frssdbEntities entities = new frssdbEntities();
            emailsetting   settings = entities.emailsettings.FirstOrDefault(s => s.custid == custid);

            if (settings == null)
            {
                return(null);
            }
            return(settings);
        }
コード例 #17
0
        public filemanagerdtl GetFileDetailsById(string fileid, string custid)
        {
            frssdbEntities entities = new frssdbEntities();
            filemanagerdtl filemgr  = entities.filemanagerdtls.FirstOrDefault(s => s.fileid == fileid && s.custid == custid);

            if (filemgr == null)
            {
                return(null);
            }
            return(filemgr);
        }
コード例 #18
0
        public bool UserEmailExist(string useremail, string custid)
        {
            frssdbEntities entities = new frssdbEntities();
            usermaster     usermstr = entities.usermasters.FirstOrDefault(s => s.useremail == useremail && s.custid == custid);

            if (usermstr == null)
            {
                return(false);
            }
            return(true);
        }
コード例 #19
0
ファイル: Manageabcmmxyz.cs プロジェクト: adipsingh/asdss
        public abcmmxyz getabcmmxyz(string custid)
        {
            frssdbEntities entities     = new frssdbEntities();
            abcmmxyz       abcmmxyzlist = entities.abcmmxyzs.FirstOrDefault(s => s.agdfgcidrttr == custid);

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

            return(abcmmxyzlist);
        }
コード例 #20
0
        public long?GetMaxNo(string custid)
        {
            long?getmaxno = 0;

            frssdbEntities entities = new frssdbEntities();

            getmaxno = (from c in entities.userinfoes
                        where c.custid == custid
                        select c.infoid).Max();

            return(getmaxno + 1);
        }
コード例 #21
0
ファイル: ManageCompMaster.cs プロジェクト: adipsingh/asdss
        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);
        }
コード例 #22
0
ファイル: ManageCompMaster.cs プロジェクト: adipsingh/asdss
        public long?GetMaxNo(string custid)
        {
            long?getmaxno = 0;

            frssdbEntities entities = new frssdbEntities();

            //getmaxno = entities.compmasters.Max(s => s.compid1);
            getmaxno = (from c in entities.compmasters
                        where c.custid == custid
                        select c.compid1).Max();

            return(getmaxno + 1);
        }
コード例 #23
0
ファイル: ManageCompFinYear.cs プロジェクト: adipsingh/asdss
        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();
                }
            }
        }
コード例 #24
0
ファイル: ManageCompMaster.cs プロジェクト: adipsingh/asdss
        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);
            }
        }
コード例 #25
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();
            }
        }
コード例 #26
0
        public long GetLastFiledtlId()
        {
            long   lastFieldId = 0;
            string value       = string.Empty;

            using (frssdbEntities entities = new frssdbEntities())
            {
                filemanagerdtl lastRecord = entities.filemanagerdtls.OrderByDescending(fm => fm.filedtlid1).FirstOrDefault();

                if (lastRecord != null)
                {
                    lastFieldId = lastRecord.filedtlid1.Value;
                }
            }
            return(lastFieldId);
        }
コード例 #27
0
ファイル: ManageCompMaster.cs プロジェクト: adipsingh/asdss
        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();
                }
            }
        }
コード例 #28
0
ファイル: ManageCompMaster.cs プロジェクト: adipsingh/asdss
 public IList <compmaster> compmastersListByCustId(string custId)
 {
     using (frssdbEntities entities = new frssdbEntities())
     {
         return(entities.compmasters.AsEnumerable().
                Where(s => s.custid == custId && (s.deletedflg == null ? false : (s.deletedflg == 0 || s.deletedby == null)))
                .Select(s => new compmaster
         {
             compid = s.compid,
             compid1 = s.compid1,
             compcode = s.compcode,
             compname = s.compname,
             compaddr1 = s.compaddr1,
             compaddr2 = s.compaddr2,
             compaddr3 = s.compaddr3,
             compcity = s.compcity,
             compzip = s.compzip,
             compstate = s.compstate,
             compcontry = s.compcontry,
             compstdcode = s.compstdcode,
             compphone = s.compphone,
             compmobile1 = s.compmobile1,
             compmobile2 = s.compmobile2,
             compweb = s.compweb,
             compemail = s.compemail,
             compstatecode = s.compstatecode,
             compgstno = s.compgstno,
             comppanno = s.comppanno,
             syncflg = s.syncflg,
             custid = s.custid,
             area = s.area,
             tanno = s.tanno,
             regdate = s.regdate,
             regno = s.regno,
             faxno = s.faxno,
         }).ToList());
     }
 }
コード例 #29
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();
                }
            }
        }
コード例 #30
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();
                }
            }
        }