예제 #1
0
        //向StatInfoTable表中插入一条记录
        public static void InsertIntoStatInfoTable(string name, string post, string company, string region, string source, string invoice, string telephone, string mobilephone, int number, int monthCount, int totalMoney, int averageMoney, int monthMoney, DateTime startDate, DateTime endDate, DateTime giveDate)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ImportExportDataCatalog"];

            currentContainerMapping.CurrentCommandName = "InsertIntoStatInfoTable";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.NewName      = name;
            subscribeInfo.Post         = post;
            subscribeInfo.NewCompany   = company;
            subscribeInfo.Region       = region;
            subscribeInfo.Source       = source;
            subscribeInfo.Invoice      = invoice;
            subscribeInfo.Telephone    = telephone;
            subscribeInfo.MobilePhone  = mobilephone;
            subscribeInfo.Number       = number;
            subscribeInfo.MonthCount   = monthCount;
            subscribeInfo.TotalMoney   = totalMoney;
            subscribeInfo.AverageMoney = averageMoney;
            subscribeInfo.MonthMoney   = monthMoney;
            subscribeInfo.StartDate    = startDate;
            subscribeInfo.EndDate      = endDate;
            subscribeInfo.GiveDate     = giveDate;

            spc.Execute(subscribeInfo);
        }
예제 #2
0
        //清空StatInfoTable表中的所有内容
        public static void ClearStatInfoTable()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ImportExportDataCatalog"];

            currentContainerMapping.CurrentCommandName = "ClearStatInfoTable";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            spc.Execute(subscribeInfo);
        }
예제 #3
0
        //从临时表检索数据
        public static DataSet RetriveDataFromTempInfo()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "RetrieveDataFromTempInfo";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            spc.Execute(subscribeInfo);

            return(subscribeInfo.ResultSet);
        }
예제 #4
0
        public static DataTable RetrieveAllManagers()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ManagerCatalog"];

            currentContainerMapping.CurrentCommandName = "GetManagers";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Manager manager             = new Manager();

            spc.Execute(manager);

            return(manager.ResultSet.Tables[0]);
        }
예제 #5
0
        public static void DeleteEmployee(int id)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["EmployeeCatalog"];

            currentContainerMapping.CurrentCommandName = "DeleteEmployee";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Employee employee           = new Employee();

            employee.Id = id;

            spc.Execute(employee);
        }
예제 #6
0
        //检索所有的地区
        public static DataTable RetrieveRegions()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "GetRegions";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Region regions = new Region();

            spc.Execute(regions);

            return(regions.ResultSet.Tables[0]);
        }
예제 #7
0
        public static DataTable RetrieveAllEmployees()
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["EmployeeCatalog"];

            currentContainerMapping.CurrentCommandName = "GetEmployees";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Employee employee           = new Employee();

            spc.Execute(employee);

            return(employee.ResultSet.Tables[0]);
        }
예제 #8
0
        public static void DeleteManager(string id)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ManagerCatalog"];

            currentContainerMapping.CurrentCommandName = "DeleteManager";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Manager manager             = new Manager();

            manager.Id = id;

            spc.Execute(manager);
        }
예제 #9
0
        //删除一个地区
        public static void DeleteRegion(int id)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "DeleteRegion";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Region region = new Region();

            region.Id = id;

            spc.Execute(region);
        }
예제 #10
0
        public static void UpdateManagerProperty(string id, int property)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ManagerCatalog"];

            currentContainerMapping.CurrentCommandName = "UpdateManagerProperty";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Manager manager             = new Manager();

            manager.Id       = id;
            manager.Property = property;

            spc.Execute(manager);
        }
예제 #11
0
        //删除一条订阅信息
        public static void DeleteSubscribeInfo(string name, string company)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "DeleteInfo";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.OldName    = name;
            subscribeInfo.OldCompany = company;

            spc.Execute(subscribeInfo);
        }
예제 #12
0
        public static void UpdateManagerName(string id, string name)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ManagerCatalog"];

            currentContainerMapping.CurrentCommandName = "UpdateManagerName";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Manager manager             = new Manager();

            manager.Id   = id;
            manager.Name = name;

            spc.Execute(manager);
        }
예제 #13
0
        public static int CreateEmployee(string name)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["EmployeeCatalog"];

            currentContainerMapping.CurrentCommandName = "CreateEmployee";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Employee employee           = new Employee();

            employee.Name = name;

            spc.Execute(employee);

            return(employee.ReturnValue);
        }
예제 #14
0
        //根据日期统计本月的总收入
        public static DataTable RetrieveInfoByDateOnly(DateTime inputDate)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "RetrieveInfoByDateOnly";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.StartDate = inputDate;

            spc.Execute(subscribeInfo);

            return(subscribeInfo.ResultSet.Tables[0]);
        }
예제 #15
0
        //将OutputTemp表中的数据导出到Excel文档中
        public static void OutputDataToExcel(string path, string fileName, string tableName)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ImportExportDataCatalog"];

            currentContainerMapping.CurrentCommandName = "p_exporttb";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.Path      = path;
            subscribeInfo.FileName  = fileName;
            subscribeInfo.TableName = tableName;

            spc.Execute(subscribeInfo);
        }
예제 #16
0
        //添加一个地区
        public static int CreateRegion(string name)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "CreateRegion";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Region region = new Region();

            region.Name = name;

            spc.Execute(region);

            return(region.ReturnValue);
        }
예제 #17
0
        public static int ValidateManager(string id, string password)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["ManagerCatalog"];

            currentContainerMapping.CurrentCommandName = "ValidateManager";

            SqlPersistenceContainer spc = new SqlPersistenceContainer(currentContainerMapping);
            Manager manager             = new Manager();

            manager.Id       = id;
            manager.Password = password;

            spc.Execute(manager);

            return(manager.ReturnValue);
        }
예제 #18
0
        //从主表中检查某条记录是否存在
        public static int CheckSubscribeExist(string name, string company)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "CheckSubscribeExist";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.OldName    = name;
            subscribeInfo.OldCompany = company;

            spc.Execute(subscribeInfo);

            return(subscribeInfo.Id);
        }
예제 #19
0
    public static IEnumerable <IContainerMapping> Find()
    {
        var componentType = typeof(ComponentAttribute);

        foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
        {
            if (type.GetCustomAttributes(componentType, false).Count == 0)
            {
                continue;
            }

            var         mapping = new ContainerMapping(type);
            List <Type> interfaces new List <Type>();
            foreach (var interfac in type.GetInterfaces())
            {
                //only get our own interfaces.
                if (interface.Assembly != Assembly.GetExecutingAssembly())
예제 #20
0
        protected override void InvokeInternal(CommandProcessorContext cpc)
        {
            // safety check, this should never be hit
            Debug.Assert(
                Function != null && FunctionImport != null && ContainerMapping != null,
                "InvokeInternal is called when Function or FunctionImport or ContainerMapping is null.");

            if (Function == null ||
                FunctionImport == null ||
                ContainerMapping == null)
            {
                throw new InvalidOperationException("InvokeInternal is called when Function or FunctionImport or ContainerMapping is null.");
            }

            _fim = new FunctionImportMapping(ContainerMapping, null);
            _fim.FunctionImportName.SetRefName(FunctionImport);
            _fim.FunctionName.SetRefName(Function);

            ContainerMapping.AddFunctionImportMapping(_fim);
            XmlModelHelper.NormalizeAndResolve(_fim);
        }
예제 #21
0
        //更新一条订阅信息
        public static int UpdateSubscribeInfo(string oldName, string newName, string post, string oldCompany, string newCompany, string address, string region, string postCode, string telephone, string mobilephone, DateTime startDate, DateTime endDate, DateTime giveDate, int number, int monthCount, int totalMoney, string inscribe, string source, string payment, string invoice, string client, string operator1, string bonus, string localAddress, string subscription)
        {
            ContainerMapping currentContainerMapping = CMPConfigurationHandler.ContainerMaps["SubscribeInfoCatalog"];

            currentContainerMapping.CurrentCommandName = "UpdateInfo";

            SqlPersistenceContainer spc           = new SqlPersistenceContainer(currentContainerMapping);
            SubscribeInfo           subscribeInfo = new SubscribeInfo();

            subscribeInfo.Post         = post;
            subscribeInfo.Address      = address;
            subscribeInfo.PostCode     = postCode;
            subscribeInfo.Telephone    = telephone;
            subscribeInfo.MobilePhone  = mobilephone;
            subscribeInfo.Inscribe     = inscribe;
            subscribeInfo.Source       = source;
            subscribeInfo.Payment      = payment;
            subscribeInfo.Invoice      = invoice;
            subscribeInfo.Client       = client;
            subscribeInfo.Operator     = operator1;
            subscribeInfo.Bonus        = bonus;
            subscribeInfo.Region       = region;
            subscribeInfo.OldName      = oldName;
            subscribeInfo.NewName      = newName;
            subscribeInfo.Number       = number;
            subscribeInfo.MonthCount   = monthCount;
            subscribeInfo.TotalMoney   = totalMoney;
            subscribeInfo.OldCompany   = oldCompany;
            subscribeInfo.NewCompany   = newCompany;
            subscribeInfo.StartDate    = startDate;
            subscribeInfo.EndDate      = endDate;
            subscribeInfo.GiveDate     = giveDate;
            subscribeInfo.LocalAddress = localAddress;
            subscribeInfo.Subscription = subscription;

            spc.Execute(subscribeInfo);

            return(subscribeInfo.Id);
        }
예제 #22
0
 public static Container CheckAndGetContainerModel(Guid fileId)
 {
     return(ContainerMapping.CheckAndGetCacheModel(fileId));
 }
예제 #23
0
        public static Guid AddShippingFG(IExcelDataReader reader)
        {
            int ColIndex = 0;

            Container container             = new Container();
            String    container_no          = "";
            String    invoice_no            = "";
            String    total_pieces_received = "";
            String    received    = "";
            String    received_by = "";
            String    entered_cs  = "";
            String    entered_pt  = "";
            List <Item_transcation_inventory> items = new List <Item_transcation_inventory>();

            Boolean isSerialNo  = false;
            int     serialIndex = 1;
            string  serialLoc   = "";
            int     zoneCode    = -1;

            do
            {
                while (reader.Read())
                {
                    ColIndex = 0;

                    while (ColIndex < reader.FieldCount)
                    {
                        String title = reader.GetString(ColIndex);
                        if (title != null)
                        {
                            if (isSerialNo)
                            {
                                String serial_no = title;
                                ColIndex++;

                                String location = reader.GetString(ColIndex);

                                if (location == null)
                                {
                                    location = serialLoc;
                                }
                                else if (location != null)
                                {
                                    zoneCode = MapZoneCode(location);
                                    int locLen = location.Length;
                                    while (locLen < 3)
                                    {
                                        location = "0" + location;
                                        locLen++;
                                    }
                                    serialLoc = location;
                                }

                                Item_transcation_inventory item = new Item_transcation_inventory();
                                item.Seq      = serialIndex;
                                item.SN       = serial_no;
                                item.ModelNo  = serial_no.Substring(0, 6);
                                item.Location = location;
                                DateTime today = DateTime.Now;
                                item.Date = today;



                                items.Add(item);

                                serialIndex++;
                            }
                            else if (string.Equals(reader.GetString(ColIndex), Constants.CONTAINER_NO))
                            {
                                ColIndex    += 1;
                                container_no = reader.GetString(ColIndex);
                                ColIndex    += 1;
                                title        = reader.GetString(ColIndex);

                                if (string.Equals(title, Constants.INVOICE_NO))
                                {
                                    ColIndex  += 1;
                                    invoice_no = reader.GetString(ColIndex);
                                }

                                break;
                            }
                            else
                            if (string.Equals(reader.GetString(ColIndex), Constants.TOTAL_PICES_RECEIVED))
                            {
                                ColIndex += 1;
                                total_pieces_received = reader.GetString(ColIndex);
                                ColIndex += 1;
                                title     = reader.GetString(ColIndex);

                                if (string.Equals(title, Constants.RECEIVED))
                                {
                                    ColIndex += 1;
                                    received  = reader.GetString(ColIndex);
                                }

                                break;
                            }
                            else
                            if (string.Equals(reader.GetString(ColIndex), Constants.RECEIVED_BY))
                            {
                                ColIndex   += 1;
                                received_by = reader.GetString(ColIndex);
                                ColIndex   += 1;
                                title       = reader.GetString(ColIndex);

                                if (string.Equals(title, Constants.ENTERED_CS))
                                {
                                    ColIndex  += 1;
                                    entered_cs = reader.GetString(ColIndex);
                                }

                                break;
                            }
                            else
                            if (string.Equals(reader.GetString(ColIndex), Constants.ENTERED_PT))
                            {
                                ColIndex  += 1;
                                entered_pt = reader.GetString(ColIndex);
                                break;
                            }
                            else
                            if (string.Equals(reader.GetString(ColIndex), Constants.SERIAL_NUMBERS))
                            {
                                ColIndex += 1;
                                title     = reader.GetString(ColIndex);

                                if (string.Equals(title, Constants.LOCATTION))
                                {
                                    isSerialNo = true;
                                    break;
                                }
                            }
                        }
                        ColIndex++;
                    }
                }
            } while (reader.NextResult());

            container.Id          = new Guid();
            container.ContainerNo = container_no;
            container.InvoiceNo   = invoice_no;
            container.PiceRecevid = total_pieces_received;
            container.RecevidDate = received;
            container.WorkerInfo  = received_by;
            container.EnteredCS   = entered_cs;
            container.EnteredPT   = entered_pt;
            container.items       = items;

            ContainerMapping.AddOrUpdateCache(container);

            return(container.Id);
        }