• 大小: 845KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: C#
  • 标签:

资源简介

一个基于C#和Oracle开发的进销存系统,现在将源代码公布给大家,这个例子只为学习,有需要的兄弟们可以拿去参考参考,大家多交流交流 由于数据库之间的主外键关系以及多表查询,为了方便,我创建了视图,这和SqlServer里面是一样的(Oracle里面是Create Or Replace),当然你也可以建立外键对象,我上个项目就是这么干的,当然ORM我们就不讨论了。 再补充一点:Oracle的自动增长列并不是像SqlServer那样设置一下,就会自动增长,Oracle里面需要你自己创建Sequences,图形操作也行,命令也行,我导出的Oracle脚本里面已经包含了相应的Sequences,应该可以看懂的。其余差别不大,相信你能看懂。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Insigma.Eyes.PSS.IDAL;
using Insigma.Eyes.PSS.OracleDAL;

namespace Insigma.Eyes.PSS.BLLWCFService
{
    // 注意: 使用“重构”菜单上的“重命名”命令,可以同时更改代码、svc 和配置文件中的类名“CommodityManagerService”。
    public class CommodityManagerService : ICommodityManagerService
    {
        public Model.CommodityModel[] GetCommodities(string name string type string manufacturer string priceLow string priceHigh)
        {
            string sqlWhere = ““;
            if (!string.IsNullOrWhiteSpace(name))
            {
                sqlWhere += string.Format(“ and Name like ‘%{0}%‘“name);
            }
            if (!string.IsNullOrWhiteSpace(type))
            {
                sqlWhere += string.Format(“ and Type like ‘%{0}%‘“ type);
            }
            if (!string.IsNullOrWhiteSpace(manufacturer))
            {
                sqlWhere += string.Format(“ and Manufacturer like ‘%{0}%‘“ manufacturer);
            }
            if (!string.IsNullOrWhiteSpace(priceLow))
            {
                try
                {
                    decimal dPriceLow=decimal.Parse(priceLow);//调试一下,是否需要赋值
                    sqlWhere += string.Format(“ and UnitPrice>={0}“ dPriceLow);
                }
                catch
                {
                    Exception e = new Exception();
                    throw new FaultException(e“单价下限有误!“);
                }
            }
            if (!string.IsNullOrWhiteSpace(priceHigh))
            {
                try
                {
                    decimal dPriceHigh = decimal.Parse(priceHigh);
                    sqlWhere += string.Format(“ and UnitPrice<={0}“dPriceHigh);
                }
                catch 
                {
                    Exception e = new Exception();
                    throw new FaultException(e “单价上限有误会!“);
                }
            }
            ICommodityService commodityService = new OracleDAL.CommodityService();
            return commodityService.GetCommodities(sqlWhere).ToArray();
        }


        public Model.CommodityModel[] GetCommoditiesByCondition(string condition)
        {
            string sqlWhere = ““;
            if (string.IsNullOrWhiteSpace(condition))
            {
                sqlWhere+=string.Format(“and (Name Like ‘%{0}%‘ or Type Like ‘%{0}%‘ or Manufacturer Like ‘%{0}%‘ )“condition);
            }
            return new OracleDAL.CommodityService().GetCommodities(sqlWhere).ToArray();
        }

        /// 
        /// 获取一个产品信息
        /// 

        /// 
        /// 
        public Model.CommodityModel GetOneCommodity(int id)
        {
            return new OracleDAL.CommodityService().GetOneCommodityByID(id);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        159  2012-06-23 01:48  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\CommodityManagerService.svc

     文件       3148  2012-06-25 13:04  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\CommodityManagerService.svc.cs

     文件        856  2012-06-25 11:46  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\ICommodityManagerService.cs

     文件       5717  2012-06-25 00:03  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\Insigma.Eyes.PSS.BLLWCFService.csproj

     文件       1086  2012-06-25 00:03  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\Insigma.Eyes.PSS.BLLWCFService.csproj.user

     文件        513  2012-06-24 23:46  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\IPurchaseManagerService.cs

     文件       1096  2012-06-25 00:02  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\ISalesManagerService.cs

     文件       1369  2012-06-23 01:40  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\Properties\AssemblyInfo.cs

     文件        157  2012-06-24 23:45  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\PurchaseManagerService.svc

     文件        571  2012-06-24 23:47  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\PurchaseManagerService.svc.cs

     文件        151  2012-06-24 23:47  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\SalesManagerService.svc

     文件       5561  2012-06-25 16:07  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\SalesManagerService.svc.cs

     文件       1161  2012-06-23 03:04  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\Web.config

     文件        260  2012-06-23 01:40  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\Web.Debug.config

     文件        356  2012-06-23 01:40  C#进销存系统\Backup\Insigma.Eyes.PSS.BLLWCFService\Web.Release.config

     文件       5948  2012-06-23 02:46  C#进销存系统\Backup\Insigma.Eyes.PSS.sln

    ..A..H.     88064  2012-06-25 17:14  C#进销存系统\Backup\Insigma.Eyes.PSS.v11.suo

     文件       4096  2012-08-03 00:30  C#进销存系统\Common\bin\Debug\Common.dll

     文件       7680  2012-08-03 00:30  C#进销存系统\Common\bin\Debug\Common.pdb

     文件       2306  2012-08-02 20:34  C#进销存系统\Common\Common.csproj

     文件        300  2012-08-02 20:44  C#进销存系统\Common\Commonhelper.cs

     文件        260  2012-08-03 00:30  C#进销存系统\Common\obj\Debug\Common.csproj.FileListAbsolute.txt

     文件       4096  2012-08-03 00:30  C#进销存系统\Common\obj\Debug\Common.dll

     文件       7680  2012-08-03 00:30  C#进销存系统\Common\obj\Debug\Common.pdb

     文件       5693  2012-08-03 00:30  C#进销存系统\Common\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1344  2012-08-02 20:31  C#进销存系统\Common\Properties\AssemblyInfo.cs

     文件       4608  2012-08-03 04:31  C#进销存系统\Insigma.Eyes.IDAL\bin\Debug\Insigma.Eyes.PSS.IDAL.dll

     文件       7680  2012-08-03 04:31  C#进销存系统\Insigma.Eyes.IDAL\bin\Debug\Insigma.Eyes.PSS.IDAL.pdb

     文件      12800  2012-08-03 04:31  C#进销存系统\Insigma.Eyes.IDAL\bin\Debug\Insigma.Eyes.PSS.Model.dll

     文件       7680  2012-08-03 04:31  C#进销存系统\Insigma.Eyes.IDAL\bin\Debug\Insigma.Eyes.PSS.Model.pdb

............此处省略345个文件信息

评论

共有 条评论