Exemplo n.º 1
0
        public int ReturnData(pin dat)
        {
            string usernamet = dat.usernamet;
            string phonet    = dat.phonet;
            string usernameb = dat.usernameb;
            string sexb      = dat.sexb;
            string money     = dat.money;
            string baodanid  = dat.baodanid;
            string number    = dat.number;
            string datel     = dat.datel;

            try
            {
                MydataDataContext datas = new MydataDataContext();
                gus guss = new gus();
                guss.usernamet = usernamet;
                guss.phonet    = phonet;
                guss.usernameb = usernameb;
                guss.sexb      = sexb;
                guss.money     = money;
                guss.baodanid  = baodanid;
                guss.number    = number;
                guss.datel     = datel;
                datas.gus.InsertOnSubmit(guss);
                datas.SubmitChanges();
                var pass = from r in datas.data
                           where r.mouth == DateTime.Now.Month.ToString()
                           select r;
                if (pass != null)
                {
                    foreach (data r in pass)
                    {
                        int data3 = int.Parse(r.data3) + int.Parse(money);
                        int data1 = int.Parse(r.data1) + 1;
                        r.data1 = Convert.ToString(data1);
                        r.data3 = Convert.ToString(data3);
                        r.data4 = Convert.ToString(data3 * 0.4);
                    }

                    datas.SubmitChanges();
                }
            }
            catch (Exception)
            {
                Response.Write(" <script>function window.onload() {alert( '此保单号已注册' ); } </script> ");
            }

            return(0);
        }
Exemplo n.º 2
0
        public int ReturnData(teh dat)
        {
            string username  = dat.username;
            string sext      = dat.sext;
            string datet     = dat.datet;
            string phonet    = dat.phonet;
            string jiguan    = dat.jiguan;
            string numbernew = dat.numbernew;
            string number    = dat.number;
            string datel     = dat.datel;

            try
            {
                MydataDataContext datas = new MydataDataContext();
                manpower          manp  = new manpower();
                manp.username  = username;
                manp.sext      = sext;
                manp.datet     = datet;
                manp.phone     = phonet;
                manp.jiguan    = jiguan;
                manp.numbernew = numbernew;
                manp.number    = number;
                manp.datel     = datel;
                datas.manpower.InsertOnSubmit(manp);
                datas.SubmitChanges();
                var pass = from r in datas.data
                           where r.mouth == DateTime.Now.Month.ToString()
                           select r;
                if (pass != null)
                {
                    foreach (data r in pass)
                    {
                        int data2 = int.Parse(r.data2) + 1;
                        r.data2 = Convert.ToString(data2);
                    }
                    datas.SubmitChanges();
                }
            }
            catch (Exception)
            {
                Response.Write(" <script>function window.onload() {alert( '此工号已注册' ); } </script> ");
            }

            return(0);
        }
Exemplo n.º 3
0
        public int ReturnData(huq dat)
        {
            int    s         = 1;
            string numbernew = dat.numbernew;

            try
            {
                MydataDataContext datas = new MydataDataContext();
                var pass = from r in datas.manpower
                           where r.numbernew == numbernew
                           select r;
                datas.manpower.DeleteAllOnSubmit(pass);
                datas.SubmitChanges();
                s = 0;
            }
            catch (Exception)
            {
                Response.Write(" <script>function window.onload() {alert( '此保单删除失败' ); } </script> ");
            }
            return(s);
        }
Exemplo n.º 4
0
        public int ReturnData(man dat)
        {
            int    s        = 1;
            string baodanid = dat.baodanid;

            try
            {
                MydataDataContext datas = new MydataDataContext();
                var pass = from r in datas.gus
                           where r.baodanid == baodanid
                           select r;
                datas.gus.DeleteAllOnSubmit(pass);
                datas.SubmitChanges();
                s = 0;
            }
            catch (Exception)
            {
                Response.Write(" <script>function window.onload() {alert( '此保单删除失败' ); } </script> ");
            }
            return(s);
        }