Esempio n. 1
0
        public void EditRun(int p_id)
        {
            System.DateTime nowTime = System.DateTime.Now;
            var             query   = from d in db.CfProposalV where d.proposal == p_id select d;

            foreach (Models.CfProposalV cfp in query)
            {
                cfp.used     = 1;
                cfp.status   = 3;
                cfp.lastTime = nowTime;
                // Insert any additional changes to column values.
            }

            db.SaveChanges();
        }
Esempio n. 2
0
        public void Upload_2(int id, System.DateTime nowTime)
        {
            this.lastid = id;

            var query2 = from d in db.CfDirFile select d;

            Models.CfDirFile dirfile = new Models.CfDirFile()
            {
                parentDir = 1,
                fileid    = this.lastid
            };

            db.CfDirFile.Add(dirfile);
            db.SaveChanges();

            //return this.lastid;
        }
Esempio n. 3
0
        public String NewsAddRun(String title2, String content2)
        {
            System.DateTime nowTime = System.DateTime.Now;
            var             query   = from d in db.CfBulletin select d;

            Models.CfBulletin bulletin = new Models.CfBulletin()
            {
                id       = new int(),
                title    = title2,
                content  = content2,
                status   = 0,
                makeTime = nowTime,
                lastTime = nowTime,
                stEnable = "Y"
            };

            db.CfBulletin.Add(bulletin);

            db.SaveChanges();

            return(HttpUtility.HtmlDecode(content2));
        }
Esempio n. 4
0
        /*前台 提案*/

        //新增方案表單

        public void DraftRunMen(String name, String phone, DateTime now_time)
        {
            var query = from d in db.CfMember select d;

            Models.CfMember cfm = new Models.CfMember();

            cfm.name     = name;
            cfm.phone    = phone;
            cfm.makeTime = now_time;
            cfm.stEnable = "Y";

            db.CfMember.Add(cfm);
            db.SaveChanges();

            this.lastid = cfm.id;
        }
Esempio n. 5
0
        public int Upload(String fileName)
        {
            db = new CrowdfundingEntities();

            String[] substrings = fileName.Split('.');
            String   firstname  = "";
            String   secondname = "";

            for (int i = 0; i < (substrings.Length - 1); i++)
            {
                if (i != 0)
                {
                    firstname = firstname + "." + substrings[i];
                }
                else
                {
                    firstname = substrings[i];
                }
            }
            secondname = substrings[(substrings.LongLength - 1)];


            secondname = secondname.ToLower();

            System.DateTime nowTime = System.DateTime.Now;
            this.mTime = nowTime;
            String datestrs = nowTime.ToString("yyyy/MM/dd hh:mm:ss");

            this.temp_str_array = datestrs.Split(' ');
            this.temp_str_array = this.temp_str_array[0].Split('/');

            var query = from d in db.CfFile select d;

            Models.CfFile qfile = new Models.CfFile();
            qfile.firstName  = firstname;
            qfile.secondName = secondname;
            qfile.makeTime   = nowTime;
            qfile.stEnable   = "Y";

            db.CfFile.Add(qfile);
            db.SaveChanges();

            this.lastid = qfile.id;

            return(this.lastid);
        }