예제 #1
0
        public static int count()
        {
            erpsystemEntities1 xe = new erpsystemEntities1();
            var v = from p in xe.t_store_advance select p;

            return(v.Count());
        }
예제 #2
0
        public static IQueryable GetXunjiaDetail(string id)
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = from p in t.buysearchdetails where p.sid == id
                    select new
            {
                sdacess     = p.sdacess,
                line        = p.line,
                sdtaxmoney  = p.sdtaxmoney,
                sdtaxmoneys = p.sdtaxmoneys,
                sfenremark  = p.sfenremark,
                sid         = p.sid,
                sisdel      = p.sisdel,
                smodel      = p.smodel,

                smoney      = p.smoney,
                snum        = p.snum,
                soriginid   = p.soriginid,
                sorigintype = p.sorigintype,
                sprice      = p.sprice,
                sunit       = p.sunit,
                swuid       = p.swuid,
                swuname     = p.swuname,
                szengping   = p.szengping,
                szheshu     = p.szheshu,
                szprice     = p.szprice
            };

            return(v);
        }
예제 #3
0
        public static IQueryable showzhu(int PageIndex)
        {
            erpsystemEntities1 xe = new erpsystemEntities1();
            var v = from p in xe.t_store_advance
                    orderby p.Bill_advance descending
                    select new
            {
                Bill_advance      = p.Bill_advance,
                Coin_stop         = p.Coin_stop,
                Compound_human_ID = p.td_personnel_table.Personal_name,
                Bumenbianhao      = p.department.Departmentname,
                Deposit_rate      = p.Deposit_rate,
                Document_date     = p.Document_date,
                Exchange_rate     = p.Exchange_rate,
                Money1            = p.Money1,
                Money2            = p.Money2,
                Settle_accounts1  = p.Settle_accounts1,
                Settle_accounts2  = p.Settle_accounts2,
                Single_person_ID  = p.td_personnel_table1.Personal_name,
                Supplier_ID       = p.funds.FulName,
                Termination_month = p.Termination_month.Value,
                supid             = p.Supplier_ID,
                perid             = p.Single_person_ID != null ? p.Single_person_ID : null,
                compuid           = p.Compound_human_ID != null ? p.Compound_human_ID : null,
                bianhao           = p.department.Bumenbianhao
            };

            return(v.Skip((PageIndex - 1) * 1).Take(1));
        }
예제 #4
0
        public static IQueryable zdtXunjias()
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = from p in t.buysearchmaster
                    orderby p.stoid descending
                    select new
            {
                saddress    = p.saddress,
                sdel        = p.sdel,
                sfooter     = p.sfooter,
                sheader     = p.sheader,
                sotaxrate   = p.sotaxrate,
                sremark     = p.sremark,
                stobuy      = p.stobuy,
                stodate     = p.stodate,
                stodid      = p.stodid,
                stoistax    = p.stoistax,
                stomake     = p.stomake,
                stopid      = p.stopid,
                stopname    = p.stopname,
                store       = p.store,
                stoshen     = p.stoshen,
                soshort     = p.stoshort,
                stostate    = p.stostate,
                stoydate    = p.stoydate,
                stunum      = p.stunum,
                szione      = p.szione,
                szitwo      = p.szitwo,
                stodep      = p.stodep,
                stosaddress = p.stosaddress,
            };

            return(v);
        }
예제 #5
0
        public static int Add(t_preturn a)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();

            stu.t_preturn.Add(a);
            return(stu.SaveChanges());
        }
예제 #6
0
        public static int AddOrders(orders info, List <orderdetails> list)
        {
            erpsystemEntities1 t = new erpsystemEntities1();

            info.orderid = info.ostoid;

            info.oscaidepid  = "1";
            info.osisdel     = 1;
            info.ospercaiid  = 1;
            info.ostoreorder = 1;
            info.oshestate   = "未审核";
            info.ostoreorder = 1;
            info.osunittax   = 1;
            info.ostodate    = DateTime.Now;
            info.osperid     = "1";
            t.orders.Add(info);
            if (list != null)
            {
                //int i=0;
                foreach (var item in list)
                {
                    item.orderid = info.ostoid;
                    if (item.orderid == info.ostoid)
                    {
                        //item.oline = i + 1;
                        t.orderdetails.Add(item);
                    }
                }
            }
            return(t.SaveChanges());
        }
예제 #7
0
        public static int Editzhu(t_preturn a, List <t_preturn_zi> b)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.t_preturn where p.Pbillno == a.Pbillno select p).First();

            v.Pbillno      = a.Pbillno;
            v.supplierid   = a.supplierid;
            v.Pdata        = a.Pdata;
            v.PriceOfTax   = a.PriceOfTax;
            v.storehouseID = a.storehouseID;
            v.CoinId       = a.CoinId;
            v.ExchRate     = a.ExchRate;
            v.warehouseid  = a.warehouseid;
            var c = (from p in stu.t_preturn_zi where p.Pbillno == a.Pbillno select p);

            foreach (var items in c)
            {
                stu.t_preturn_zi.Remove(items);
            }

            if (b != null)
            {
                foreach (var item in b)
                {
                    stu.t_preturn_zi.Add(item);
                }
            }
            return(stu.SaveChanges());
        }
예제 #8
0
        //销售退货单修改
        public static int Getenid(billtui blii, List <billtutype> list)
        {
            erpsystemEntities1 ent = new erpsystemEntities1();
            var v = (from p in ent.billtui where p.billno == blii.billno select p).First();

            v.billno      = blii.billno;
            v.billdate    = blii.billdate;
            v.checkstatus = blii.checkstatus;
            //v.clientmaster = blii.clientmaster;
            v.customerid = blii.customerid;
            var data = from p in ent.billtutype where p.billno == blii.billno select p;

            foreach (var item in data)
            {
                ent.billtutype.Remove(item);
            }
            if (list != null)
            {
                foreach (var item in list)
                {
                    ent.billtutype.Add(item);
                }
            }
            return(ent.SaveChanges());
        }
예제 #9
0
        // 销售退货单显示明细
        public static IQueryable GetWLZWJ_list(string billno)
        {
            erpsystemEntities1 ent = new erpsystemEntities1();
            var v = from p in ent.billtutype
                    where p.billno == billno
                    select new
            {
                billno     = p.billno,
                amountatax = p.amountatax,

                discount = p.discount,
                fromno   = p.fromno,
                fromrow  = p.fromrow,
                lineid   = p.lineid,
                num      = p.num,
                oidprice = p.oidprice,

                sprice  = p.sprice,
                taxamt  = p.taxamt,
                taxrate = p.taxrate,

                wuliaoid = p.wuliaoid
            };

            return(v);
        }
예제 #10
0
        //客户类别新增
        public static int Getcloss_Add(closstype type)
        {
            erpsystemEntities1 ent = new erpsystemEntities1();

            ent.closstype.Add(type);
            return(ent.SaveChanges());
        }
예제 #11
0
        public List <quotedprice> selectzhuan()
        {
            erpsystemEntities1 db = new erpsystemEntities1();

            db.quotedprice.Where(x => x.Shenhe == 2 && (x.youxiaoriqi > DateTime.Now || x.youxiaoriqi == null));
            return(db.quotedprice.ToList());
        }
예제 #12
0
 public bool update(salesorder info)
 {
     using (erpsystemEntities1 db = new erpsystemEntities1())
     {
         db.Database.ExecuteSqlCommand("delete from orderdetails where Documentnumber='" + info.Documentnumber + "'");
         var info1 = db.salesorder.Find(info.Documentnumber);
         if (info1 != null)
         {
             info1.Customer          = info.Customer;
             info1.BillDate          = info.BillDate;
             info1.Documentnumber    = info.Documentnumber;
             info1.yesandno          = info.yesandno;
             info1.Singlecondition   = info.Singlecondition;
             info1.exchangerate      = info.exchangerate;
             info1.Ordertype         = info.Ordertype;
             info1.Businesspersonnel = info.Businesspersonnel;
             info1.Producer          = info.Producer;
             info1.bumenbianhao      = info.bumenbianhao;
             info1.Compoundstaff     = info.Compoundstaff;
             info1.Totalamount       = info.Totalamount;
             info1.isshenhe          = info.isshenhe;
             info1.orderdetails      = info.orderdetails;
             return(db.SaveChanges() > 0);
         }
         else
         {
             return(false);
         }
     }
 }
예제 #13
0
        public static IQueryable GetOrdersDetail(string id)
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = from p in t.orderdetails where p.orderid == id
                    select new
            {
                oisprent     = p.oisprent,
                oline        = p.oline,
                omoney       = p.omoney,
                onum         = p.onum,
                oprice       = p.oprice,
                oprodsize    = p.oprodsize,
                orderid      = p.orderid,
                oremark      = p.oremark,
                originno     = p.originno,
                origintype   = p.origintype,
                osperid      = p.osperid,
                ospername    = p.ospername,
                osperprice   = p.osperprice,
                ostoragedate = p.ostoragedate,
                oszheshu     = p.oszheshu,
                otaxmoney    = p.otaxmoney,
                otaxrate     = p.otaxrate,
                ounitname    = p.ounitname,
                otaxmoneys   = p.otaxmoneys,
                oweinum      = p.oweinum
            };

            return(v);
        }
예제 #14
0
        public static int fShenHedingdan(string id)
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = (from p in t.orders where p.ostoid == id select p).First();

            v.oshestate = "未审核";
            return(t.SaveChanges());
        }
예제 #15
0
        public bool add(salesorder info)
        {
            erpsystemEntities1 db = new erpsystemEntities1();

            db.salesorder.Add(info);

            return(db.SaveChanges() > 0);
        }
예제 #16
0
        public static int fShenHeXunjia(string id)
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = (from p in t.buysearchmaster where p.stunum == id select p).First();

            v.stostate = "未审核";
            return(t.SaveChanges());
        }
예제 #17
0
        public static int poi()
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.t_preturn
                     where p.job == 1
                     select p).Count();

            return(v);
        }
예제 #18
0
        public static int Counts(String name)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.t_preturn
                     where p.Pbillno == name
                     select p).Count();

            return(v);
        }
예제 #19
0
        //客户类别修改
        public static int Getcloss_Eind(closstype type)
        {
            erpsystemEntities1 ent = new erpsystemEntities1();
            var enid = (from p in ent.closstype where p.clossid == type.clossid select p).First();

            enid.clossid     = type.clossid;
            enid.clossname   = type.clossname;
            enid.englishname = type.englishname;
            enid.remarks     = type.remarks;
            return(ent.SaveChanges());
        }
예제 #20
0
        public static IQueryable CKID(String name)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.warehousetable
                     select new
            {
                Warehousenumber = p.Warehousenumber
            });

            return(v);
        }
예제 #21
0
        public static IQueryable gyscx()
        {
            erpsystemEntities1 xe = new erpsystemEntities1();
            var v = from p in xe.funds
                    select new
            {
                ID      = p.ID,
                FulName = p.FulName
            };

            return(v);
        }
예제 #22
0
        //客户类别删除
        public static int Getcloss_del(int type)
        {
            erpsystemEntities1 ent = new erpsystemEntities1();
            var f = from p in ent.closstype where p.clossid == type select p;

            foreach (var item in f)
            {
                ent.closstype.Remove(item);
            }

            return(ent.SaveChanges());
        }
예제 #23
0
        public static IQueryable pzi(String no)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.t_preturn_zi
                     where p.Bill_number == no
                     select new
            {
                Tid = p.Tid
            });

            return(v);
        }
예제 #24
0
        public static IQueryable GetGYS()
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = from p in t.gmeans
                    select new
            {
                gid    = p.gid,
                gnname = p.gnname
            };

            return(v);
        }
예제 #25
0
        public static IQueryable GetWuliao()
        {
            erpsystemEntities1 t = new erpsystemEntities1();
            var v = from p in t.wlzwj
                    select new
            {
                matid   = p.matid,
                matname = p.matname
            };

            return(v);
        }
예제 #26
0
        public static string zdbh(string time)
        {
            erpsystemEntities1 xe   = new erpsystemEntities1();
            string             date = Convert.ToDateTime(time).ToString("yyyyMMdd");
            var v = from p in xe.t_store_advance where p.Bill_advance.Contains(date) select p.Bill_advance;

            if (v.Count() > 0)
            {
                return((long.Parse(v.Max()) + 1).ToString());
            }
            return(date + "001");
        }
예제 #27
0
        public static int Addzi(List <t_preturn_zi> b)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();

            if (b != null)
            {
                foreach (var item in b)
                {
                    stu.t_preturn_zi.Add(item);
                }
            }
            return(stu.SaveChanges());
        }
예제 #28
0
        public static IQueryable Funds(int ID)
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.funds
                     where p.ID == ID
                     select new
            {
                PersonID = (from pp in stu.td_personnel_table where p.PersonID == pp.Personnel select pp.Personal_name),
                department = (from c in stu.department where (from pp in stu.td_personnel_table where p.PersonID == pp.Personnel select pp.department).Contains(c.Bumenbianhao) select c.Departmentname)
            });

            return(v);
        }
예제 #29
0
        public static IQueryable GYS()
        {
            erpsystemEntities1 stu = new erpsystemEntities1();
            var v = (from p in stu.funds
                     select new
            {
                ID = p.ID,
                FundsAttribution = p.FundsAttribution,
                ShortName = p.ShortName
            });

            return(v);
        }
예제 #30
0
        public static IQueryable cxcgdd(int gysid)
        {
            erpsystemEntities1 xe = new erpsystemEntities1();
            var v = from p in xe.purchasing_ordermain
                    where p.Individual_ondition == 0 && p.Audit_status == 1 && p.Supplier_Id == gysid
                    select new
            {
                Bill_number   = p.Bill_number,
                Document_date = p.Document_date
            };

            return(v);
        }