Esempio n. 1
0
        public PaymentPostData GeneratePostDataFor(OrderPaymentRequest orderRequest)
        {
            PaymentPostData     paymentPostData  = new PaymentPostData();
            NameValueCollection postDataAndValue = new NameValueCollection();

            paymentPostData.PostDataAndValue = postDataAndValue;

            // When a real PayPal account is used, the form should be sent to https://www.paypal.com/cgi-bin/webscr.
            // For testing use "https://www.sandbox.paypal.com/cgi-bin/webscr"
            paymentPostData.PaymentPostToUrl = ApplicationSettingsFactory.GetApplicationSettings().PayPalPaymentPostToUrl;

            // For shopping cart purchases.
            postDataAndValue.Add("cmd", "_cart");
            // Indicates the use of third party shopping cart.
            postDataAndValue.Add("upload", "1");

            // This is the sellers email address. You must supply your own address here!!!
            postDataAndValue.Add("business", ApplicationSettingsFactory.GetApplicationSettings().PayPalBusinessEmail);

            // This field does not take part in the shopping process.
            // It simply will be passed to the IPN script at the time of transaction confirmation.
            postDataAndValue.Add("custom", orderRequest.Id.ToString());

            // This parameter represents a currency code.
            postDataAndValue.Add("currency_code", "GBP");

            postDataAndValue.Add("first_name", orderRequest.CustomerFirstName);
            postDataAndValue.Add("last_name", orderRequest.CustomerSecondName);

            postDataAndValue.Add("address1", orderRequest.DeliveryAddressAddressLine1);
            postDataAndValue.Add("address2", orderRequest.DeliveryAddressAddressLine2);
            postDataAndValue.Add("city", orderRequest.DeliveryAddressCity);
            postDataAndValue.Add("state", orderRequest.DeliveryAddressState);
            postDataAndValue.Add("country", orderRequest.DeliveryAddressCountry);
            postDataAndValue.Add("zip", orderRequest.DeliveryAddressZipCode);

            // This parameter determines whether the delivery address should be requested.
            // "1" means that the address will be requested; "0" means that it will be not.
            //postDataAndValue.Add("no_shipping", "0");

            // This is the URL where the user will be redirected after the payment is successfully performed.
            // If this parameter is not passed, the buyer remains on the PayPal site.
            postDataAndValue.Add("return", Helpers.UrlHelper.Resolve("/Payment/PaymentComplete"));
            // This is the URL where the user will be redirected when he cancels the payment.
            // If the parameter is not passed, the buyer remains on the PayPal site.
            postDataAndValue.Add("cancel_return", Helpers.UrlHelper.Resolve("/Payment/PaymentCancel"));
            // This is the URL where PayPal will pass information about the transaction (IPN).
            // If the parameter is not passed, the value from the account settings will be used.
            // If this value is not defined in the account settings, IPN will not be used.
            postDataAndValue.Add("notify_url", Helpers.UrlHelper.Resolve("/Payment/PaymentCallBack"));

            int itemIndex = 1;

            foreach (OrderItemPaymentRequest item in orderRequest.Items)
            {
                postDataAndValue.Add("item_name_" + itemIndex.ToString(), item.ProductName);
                postDataAndValue.Add("amount_" + itemIndex.ToString(), item.Price.ToString());
                postDataAndValue.Add("item_number_" + itemIndex.ToString(), item.Id.ToString());
                postDataAndValue.Add("quantity_" + itemIndex.ToString(), item.Quantity.ToString());

                itemIndex++;
            }

            postDataAndValue.Add("shipping", orderRequest.ShippingCharge.ToString());

            return(paymentPostData);
        }
 public Log4NetAdapter()
 {
     XmlConfigurator.Configure();
     _log = LogManager
            .GetLogger(ApplicationSettingsFactory.GetApplicationSettings().LoggerName);
 }
Esempio n. 3
0
        public TimeAttendanceRepository()
        {
            base.ServiceURL = ApplicationSettingsFactory.GetApplicationSettings().BaseURL + serviceName;

            ChildGetLookup.Add(typeof(DayType), "getDT");
            ChildGetLookup.Add(typeof(AttendanceSchedule), "getSC");
            ChildGetLookup.Add(typeof(AttendanceScheduleDay), "getSD");
            ChildGetLookup.Add(typeof(WorkingCalendar), "getCA");
            ChildGetLookup.Add(typeof(CalendarYear), "getCY");
            ChildGetLookup.Add(typeof(CalendarDay), "getCD");
            ChildGetLookup.Add(typeof(BiometricDevice), "getBM");
            ChildGetLookup.Add(typeof(Router), "getRO");
            ChildGetLookup.Add(typeof(Geofence), "getGF");
            ChildGetLookup.Add(typeof(Time), "getTA");
            ChildGetLookup.Add(typeof(DashBoardTimeVariation), "getTV");
            ChildGetLookup.Add(typeof(MonthlyLatenessPeriod), "getMLP");



            ChildGetAllLookup.Add(typeof(DayType), "qryDT");
            ChildGetAllLookup.Add(typeof(AttendanceSchedule), "qrySC");
            ChildGetAllLookup.Add(typeof(AttendanceScheduleDay), "qrySD");
            ChildGetAllLookup.Add(typeof(AttendanceBreak), "qrySB");
            ChildGetAllLookup.Add(typeof(WorkingCalendar), "qryCA");
            ChildGetAllLookup.Add(typeof(CalendarYear), "qryCY");
            ChildGetAllLookup.Add(typeof(CalendarDay), "qryCD");
            ChildGetAllLookup.Add(typeof(BiometricDevice), "qryBM");
            ChildGetAllLookup.Add(typeof(AttendanceDay), "qryAD");
            ChildGetAllLookup.Add(typeof(CheckMonitor), "qryCM");
            ChildGetAllLookup.Add(typeof(ActiveCheck), "qryAC");
            ChildGetAllLookup.Add(typeof(ActiveAbsence), "qryAA");
            ChildGetAllLookup.Add(typeof(ActiveLate), "qryAL");
            ChildGetAllLookup.Add(typeof(ActiveLeave), "qryAV");
            ChildGetAllLookup.Add(typeof(ActiveOut), "qryAO");
            ChildGetAllLookup.Add(typeof(MissedPunch), "qryMP");
            ChildGetAllLookup.Add(typeof(Router), "qryRO");
            ChildGetAllLookup.Add(typeof(Geofence), "qryGF");
            ChildGetAllLookup.Add(typeof(AttendanceShift), "qryAS");
            ChildGetAllLookup.Add(typeof(LeaveCalendarDay), "qryCD2");
            ChildGetAllLookup.Add(typeof(OvertimeSetting), "qryOT");
            ChildGetAllLookup.Add(typeof(FlatSchedule), "qryFS");
            ChildGetAllLookup.Add(typeof(PendingTA), "pendingTA");
            ChildGetAllLookup.Add(typeof(Time), "qryTA");
            ChildGetAllLookup.Add(typeof(DashBoardTimeVariation), "qryTV");
            ChildGetAllLookup.Add(typeof(DashBoardTimeVariation2), "qryMLD");
            ChildGetAllLookup.Add(typeof(PendingPunch), "qryPP");
            ChildGetAllLookup.Add(typeof(TimePerformance), "qryTP");
            ChildGetAllLookup.Add(typeof(FlatPunch), "qryFP");
            ChildGetAllLookup.Add(typeof(UnschedulePunch), "qryUP");
            ChildGetAllLookup.Add(typeof(UnschedulePunchDetails), "qryUPD");
            ChildGetAllLookup.Add(typeof(MonthlyLateness), "qryML");
            ChildGetAllLookup.Add(typeof(MonthlyLatenessPeriod), "getMLP");
            ChildGetAllLookup.Add(typeof(DashBoardTimeVariation3), "qryATV");
            ChildGetAllLookup.Add(typeof(RT308A), "qryCH");


            ChildAddOrUpdateLookup.Add(typeof(DayType), "setDT");
            ChildAddOrUpdateLookup.Add(typeof(AttendanceSchedule), "setSC");
            ChildAddOrUpdateLookup.Add(typeof(AttendanceScheduleDay), "setSD");
            ChildAddOrUpdateLookup.Add(typeof(AttendanceBreak[]), "arrSB");
            ChildAddOrUpdateLookup.Add(typeof(CalendarDay[]), "arrCD");
            ChildAddOrUpdateLookup.Add(typeof(WorkingCalendar), "setCA");
            ChildAddOrUpdateLookup.Add(typeof(CalendarYear), "setCY");
            ChildAddOrUpdateLookup.Add(typeof(CalendarDay), "setCD");
            ChildAddOrUpdateLookup.Add(typeof(BiometricDevice), "setBM");
            ChildAddOrUpdateLookup.Add(typeof(CalendarPattern), "batCD");
            ChildAddOrUpdateLookup.Add(typeof(SchedulePattern), "batSD");
            ChildAddOrUpdateLookup.Add(typeof(Router), "setRO");
            ChildAddOrUpdateLookup.Add(typeof(Geofence), "setGF");
            ChildAddOrUpdateLookup.Add(typeof(AttendanceShift), "setAS");
            ChildAddOrUpdateLookup.Add(typeof(AttendanceShift[]), "arrAS");
            ChildAddOrUpdateLookup.Add(typeof(Check), "setCH");
            ChildAddOrUpdateLookup.Add(typeof(CalendarAlternation), "altCD");
            ChildAddOrUpdateLookup.Add(typeof(OvertimeSetting), "setOT");
            ChildAddOrUpdateLookup.Add(typeof(GenerateAttendanceDay), "genFS");
            ChildAddOrUpdateLookup.Add(typeof(FlatSchedule), "setFS");
            ChildAddOrUpdateLookup.Add(typeof(Time), "setTA");
            ChildAddOrUpdateLookup.Add(typeof(PendingPunch), "processPP");
            ChildAddOrUpdateLookup.Add(typeof(DashBoardTimeVariation), "setTV");
            ChildAddOrUpdateLookup.Add(typeof(RejectTimeVariationc), "setRTV");
            ChildAddOrUpdateLookup.Add(typeof(MailFlatShedule), "mailFS");
            ChildAddOrUpdateLookup.Add(typeof(OverrideTimeVariation), "overrideTV");
            ChildAddOrUpdateLookup.Add(typeof(processUnscheduledPunch), "processUP");
            ChildAddOrUpdateLookup.Add(typeof(SyncActivity), "syncTV");
            ChildAddOrUpdateLookup.Add(typeof(ResetFlatSchedule), "resFS");
            ChildAddOrUpdateLookup.Add(typeof(GenerationHeader), "genML");

            ChildDeleteLookup.Add(typeof(AttendanceBreak), "delSB");
            ChildDeleteLookup.Add(typeof(AttendanceSchedule), "delSC");
            ChildDeleteLookup.Add(typeof(WorkingCalendar), "delCA");
            ChildDeleteLookup.Add(typeof(DayType), "delDT");
            ChildDeleteLookup.Add(typeof(BiometricDevice), "delBM");
            ChildDeleteLookup.Add(typeof(Router), "delRO");
            ChildDeleteLookup.Add(typeof(Geofence), "delGF");
            ChildDeleteLookup.Add(typeof(AttendanceShift), "delAS");
            ChildDeleteLookup.Add(typeof(OvertimeSetting), "delOT");
            ChildDeleteLookup.Add(typeof(FlatSchedule), "delFS");
            ChildDeleteLookup.Add(typeof(FlatScheduleRange), "delRangeFS");
            ChildDeleteLookup.Add(typeof(PendingPunch), "delPP");


            //Flat Schedule
        }
Esempio n. 4
0
        public SelfServiceRepository()
        {
            base.ServiceURL = ApplicationSettingsFactory.GetApplicationSettings().BaseURL + serviceName;

            ChildGetAllLookup.Add(typeof(MyInfo), "qryEM");
            ChildGetAllLookup.Add(typeof(LetterSelfservice), "qryLE");
            ChildGetAllLookup.Add(typeof(AssetAllowanceSelfService), "qryAA");
            ChildGetAllLookup.Add(typeof(EmployeeComplaintSelfService), "qryCO");
            ChildGetAllLookup.Add(typeof(LeaveDaySelfservice), "qryLD");
            ChildGetAllLookup.Add(typeof(leaveRequetsSelfservice), "qryLR");
            ChildGetAllLookup.Add(typeof(FlatScheduleSelfService), "qryFS");
            ChildGetAllLookup.Add(typeof(AttendanceDay), "qryAD");
            ChildGetAllLookup.Add(typeof(TimeVariationSelfService), "qryTV");
            ChildGetAllLookup.Add(typeof(EmployeePayrollSelfService), "qryPE");
            ChildGetAllLookup.Add(typeof(TimeSelfService), "qryTA");
            ChildGetAllLookup.Add(typeof(LeaveType), "qryLT");
            ChildGetAllLookup.Add(typeof(loanSelfService), "qryLO");
            ChildGetAllLookup.Add(typeof(Dependant), "qryDE");
            ChildGetAllLookup.Add(typeof(EmployeeContact), "qryCO");
            ChildGetAllLookup.Add(typeof(EmployeeEmergencyContact), "qryEC");
            ChildGetAllLookup.Add(typeof(DashBoardTimeVariation), "qryTV");
            ChildGetAllLookup.Add(typeof(PayrollEntitlementDeduction), "qryED");
            ChildGetAllLookup.Add(typeof(PayrollSocialSecurity), "qryES");
            ChildGetAllLookup.Add(typeof(AdminDocTransfer), "qryTR");
            ChildGetAllLookup.Add(typeof(AssetLoan), "qryAL");
            ChildGetAllLookup.Add(typeof(GenerationHeader), "qryPE");
            ChildGetAllLookup.Add(typeof(LeaveReplacementApproval), "qryRA");

            ChildGetLookup.Add(typeof(MyInfo), "getEM1");
            ChildGetLookup.Add(typeof(EmployeeComplaintSelfService), "getCO");
            ChildGetLookup.Add(typeof(loanSelfService), "getLO");
            ChildGetLookup.Add(typeof(TimeSelfService), "getTA");
            ChildGetLookup.Add(typeof(UserInfoSelfService), "getUS");
            ChildGetLookup.Add(typeof(LeaveRequest), "getLR");
            ChildGetLookup.Add(typeof(EmployeeQuickView), "getQV");
            //ChildGetLookup.Add(typeof(KeyValuePair<string, string>), "getDE");
            ChildGetLookup.Add(typeof(Dependant), "getDE");
            ChildGetLookup.Add(typeof(EmployeeContact), "getCO");
            ChildGetLookup.Add(typeof(EmployeeEmergencyContact), "getEC");
            ChildGetLookup.Add(typeof(GenerationHeader), "getPE");
            ChildGetLookup.Add(typeof(LeaveReplacementApproval), "getRA");

            ChildAddOrUpdateLookup.Add(typeof(MyInfo), "setEM");
            ChildAddOrUpdateLookup.Add(typeof(UserInfoSelfService), "setUS");
            ChildAddOrUpdateLookup.Add(typeof(LeaveRequest), "setLR");
            ChildAddOrUpdateLookup.Add(typeof(loanSelfService), "setLO");
            ChildAddOrUpdateLookup.Add(typeof(LetterSelfservice), "setLE");
            ChildAddOrUpdateLookup.Add(typeof(LeaveDay[]), "arrLD");
            ChildAddOrUpdateLookup.Add(typeof(EmployeeComplaintSelfService), "setCO");
            ChildAddOrUpdateLookup.Add(typeof(TimeSelfService), "setTA");
            ChildAddOrUpdateLookup.Add(typeof(Dependant), "setDE");
            ChildAddOrUpdateLookup.Add(typeof(EmployeeContact), "setCO");
            ChildAddOrUpdateLookup.Add(typeof(EmployeeEmergencyContact), "setEC");
            ChildAddOrUpdateLookup.Add(typeof(DashBoardTimeVariation), "setTV");
            ChildAddOrUpdateLookup.Add(typeof(AttendanceShift), "setAS");
            ChildAddOrUpdateLookup.Add(typeof(AdminDocTransfer), "setTR");
            ChildAddOrUpdateLookup.Add(typeof(GenerationHeader), "setPE");
            ChildAddOrUpdateLookup.Add(typeof(LeaveReplacementApproval), "setRA");

            ChildDeleteLookup.Add(typeof(MyInfo), "delEM");
            ChildDeleteLookup.Add(typeof(EmployeeComplaintSelfService), "delCO");
            ChildDeleteLookup.Add(typeof(Dependant), "delDE");
            ChildDeleteLookup.Add(typeof(EmployeeContact), "delCO");
            ChildDeleteLookup.Add(typeof(EmployeeEmergencyContact), "delEC");
            ChildDeleteLookup.Add(typeof(leaveRequetsSelfservice), "delLR");
            ChildDeleteLookup.Add(typeof(loanSelfService), "delLO");
            ChildDeleteLookup.Add(typeof(AttendanceShift), "delAS");
            ChildDeleteLookup.Add(typeof(GenerationHeader), "delPE");
            ChildDeleteLookup.Add(typeof(LeaveReplacementApproval), "delRA");
        }
        private void ReadConfigFile()
        {
            string modbusConfigRelativePath = ApplicationSettingsFactory.GetApplicationSettings().ModbusConfigFilePath;
            string modbusConfigFile         = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory,
                                                                     modbusConfigRelativePath);

            if (System.IO.File.Exists(modbusConfigFile))
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(modbusConfigFile);

                XmlNodeList moduleNodes = xmlDoc.SelectNodes("/ModbusConfig/Module");
                if (null != moduleNodes && moduleNodes.Count > 0)
                {
                    ClearConfigDictionary();
                    int moduleId    = 0;
                    int dataPointId = 0;

                    foreach (XmlNode moduleNode in moduleNodes)
                    {
                        // Module
                        moduleId++;
                        XmlElement moduleElement = (XmlElement)moduleNode;
                        string     moduleNumber  = Convert.ToString(moduleId);
                        moduleElement.SetAttribute("Id", string.Format("{0:D4}", moduleId));

                        string moduleName        = moduleElement.GetAttribute("Name");
                        string moduleDescription = moduleElement.GetAttribute("Description");

                        Module module = new Module();

                        //UnitOfWork机制和数据库外键的设计,决定了要预先设置数据库中的主键Id
                        //尽管数据库自己生产主键。
                        module.Id = moduleId;

                        AddModule(module,
                                  moduleNumber,
                                  moduleName,
                                  moduleDescription);

                        //DataPoint
                        XmlNodeList dataPointNodes = moduleNode.ChildNodes;
                        if (dataPointNodes.Count > 0)
                        {
                            foreach (XmlNode dataPointNode in dataPointNodes)
                            {
                                dataPointId++;
                                XmlElement dataPointElement = (XmlElement)dataPointNode;

                                string dataPointNumber = Convert.ToString(dataPointId);
                                dataPointElement.SetAttribute("Id", string.Format("{0:D5}", dataPointId));

                                string dataPointName             = dataPointElement.GetAttribute("Name");
                                string deviceAddress             = dataPointElement.GetAttribute("DeviceAddress");
                                string dataPointStartingRegister = dataPointElement.GetAttribute("StartingRegister");
                                string dataPointDataType         = dataPointElement.GetAttribute("DataType");
                                string dataDataDataPointType     = dataPointElement.GetAttribute("DataPointType");
                                string datapointDescription      = dataPointElement.GetAttribute("Description");

                                DataPoint dataPoint = new DataPoint();

                                //UnitOfWork机制和数据库外键的设计,决定了要预先设置数据库中的主键Id
                                //尽管数据库自己生产主键。
                                dataPoint.Id = dataPointId;

                                AddDataPoint(module,
                                             dataPoint,
                                             dataPointNumber,
                                             deviceAddress,
                                             dataPointStartingRegister,
                                             dataPointName,
                                             dataPointDataType,
                                             dataDataDataPointType,
                                             datapointDescription);
                            }
                        }
                    }

                    xmlDoc.Save(modbusConfigFile);
                }
            }
        }
Esempio n. 6
0
 public DataBaseTest()
 {
     //初始化ApplicationSettingsFactory
     ApplicationSettingsFactory.InitApplicationSettingsFactory(new WebConfigApplicationSettings());
     ToPreventDBDoesNotExist();
 }
        public CompanyStructureRepository()
        {
            base.ServiceURL = ApplicationSettingsFactory.GetApplicationSettings().BaseURL + serviceName;

            base.ChildGetLookup.Add(typeof(Branch), "getBR");
            base.ChildGetLookup.Add(typeof(Department), "getDE");
            base.ChildGetLookup.Add(typeof(Position), "getPO");
            base.ChildGetLookup.Add(typeof(Division), "getDI");
            base.ChildGetLookup.Add(typeof(LegalReference), "getBL");
            base.ChildGetLookup.Add(typeof(Approval), "getAP");
            base.ChildGetLookup.Add(typeof(ApprovelDepartment), "getAD");
            base.ChildGetLookup.Add(typeof(ApprovalReason), "getAR");
            base.ChildGetLookup.Add(typeof(WorkFlow), "getWF");
            base.ChildGetLookup.Add(typeof(WorkSequence), "getWS");
            base.ChildGetLookup.Add(typeof(Rule), "getRU");
            base.ChildGetLookup.Add(typeof(RuleCondition), "getRC");
            base.ChildGetLookup.Add(typeof(RuleMessage), "getRM");

            base.ChildGetAllLookup.Add(typeof(Branch), "qryBR");
            base.ChildGetAllLookup.Add(typeof(Department), "qryDE");
            base.ChildGetAllLookup.Add(typeof(Position), "qryPO");
            base.ChildGetAllLookup.Add(typeof(Division), "qryDI");
            base.ChildGetAllLookup.Add(typeof(LegalReference), "qryBL");
            base.ChildGetAllLookup.Add(typeof(Approval), "qryAP");
            base.ChildGetAllLookup.Add(typeof(ApprovelDepartment), "qryAD");
            base.ChildGetAllLookup.Add(typeof(ApprovalReason), "qryAR");
            base.ChildGetAllLookup.Add(typeof(WorkFlow), "qryWF");
            base.ChildGetAllLookup.Add(typeof(WorkSequence), "qryWS");
            base.ChildGetAllLookup.Add(typeof(Rule), "qryRU");
            base.ChildGetAllLookup.Add(typeof(RuleCondition), "qryRC");
            base.ChildGetAllLookup.Add(typeof(RuleMessage), "qryRM");
            base.ChildGetAllLookup.Add(typeof(RuleTrigger), "qryRT");


            base.ChildAddOrUpdateLookup.Add(typeof(Branch), "setBR");
            base.ChildAddOrUpdateLookup.Add(typeof(Department), "setDE");
            base.ChildAddOrUpdateLookup.Add(typeof(Position), "setPO");
            base.ChildAddOrUpdateLookup.Add(typeof(Division), "setDI");
            base.ChildAddOrUpdateLookup.Add(typeof(LegalReference), "setBL");
            base.ChildAddOrUpdateLookup.Add(typeof(Approval), "setAP");
            base.ChildAddOrUpdateLookup.Add(typeof(ApprovelDepartment), "setAD");
            base.ChildAddOrUpdateLookup.Add(typeof(ApprovalReason), "setAR");
            base.ChildAddOrUpdateLookup.Add(typeof(WorkFlow), "setWF");
            base.ChildAddOrUpdateLookup.Add(typeof(WorkSequence), "setWS");
            base.ChildAddOrUpdateLookup.Add(typeof(Rule), "setRU");
            base.ChildAddOrUpdateLookup.Add(typeof(RuleCondition), "setRC");
            base.ChildAddOrUpdateLookup.Add(typeof(RuleMessage), "setRM");
            base.ChildAddOrUpdateLookup.Add(typeof(RuleTrigger), "setRT");

            ChildDeleteLookup.Add(typeof(Branch), "delBR");
            ChildDeleteLookup.Add(typeof(Department), "delDE");
            ChildDeleteLookup.Add(typeof(Position), "delPO");
            ChildDeleteLookup.Add(typeof(Division), "delDI");
            ChildDeleteLookup.Add(typeof(Approval), "delAP");
            ChildDeleteLookup.Add(typeof(ApprovelDepartment), "delAD");
            ChildDeleteLookup.Add(typeof(LegalReference), "delBL");
            ChildDeleteLookup.Add(typeof(ApprovalReason), "delAR");
            ChildDeleteLookup.Add(typeof(WorkFlow), "delWF");
            ChildDeleteLookup.Add(typeof(WorkSequence), "delWS");

            ChildDeleteLookup.Add(typeof(Rule), "delRU");
            ChildDeleteLookup.Add(typeof(RuleCondition), "delRC");
            ChildDeleteLookup.Add(typeof(RuleMessage), "delRM");
            ChildDeleteLookup.Add(typeof(RuleTrigger), "delRT");



            base.GetAllMethodName      = "";
            base.GetRecordMethodName   = "";
            base.DeleteMethodName      = "";
            base.AddOrUpdateMethodName = "";
        }
Esempio n. 8
0
 public UsersRepository()
 {
     connectionString = ApplicationSettingsFactory.GetApplicationSettings().IndustryEnergy_SHConnectionString;
     dataFactory      = new SqlServerDataFactory(connectionString);
 }
Esempio n. 9
0
 public Log4NetWebAdapter()
 {
     XmlConfigurator.ConfigureAndWatch(new FileInfo(HttpContext.Current.Server.MapPath("~/" + ApplicationSettingsFactory.GetApplicationSettings().LoggerConfigurationPath)));
     _log = LogManager.GetLogger(ApplicationSettingsFactory.GetApplicationSettings().LoggerName);
 }
        public AllSafetyWarningDatasModel GetAllSafetyDatas()
        {
            string connectionString           = ConfigurationManager.ConnectionStrings[ApplicationSettingsFactory.GetApplicationSettings().DBConnectionName].ConnectionString;//获得Web.config中的连接字符串
            AllSafetyWarningDatasModel models = new AllSafetyWarningDatasModel();

            using (SqlConnection conStr = new SqlConnection(connectionString))                      //SQL数据库连接对象,以数据库链接字符串为参数
            {
                SqlCommand comStr = new SqlCommand(AppConstants.SafetyWarningRealTimeProc, conStr); //SQL语句执行对象,第一个参数是要执行的语句,第二个是数据库连接对象
                comStr.CommandType = CommandType.StoredProcedure;                                   //因为要使用的是存储过程,所以设置执行
                SqlParameter preFirstAssessmentReportTime = comStr.Parameters.Add("@preFirstAssessmentReportTime", SqlDbType.DateTime);
                preFirstAssessmentReportTime.Direction = ParameterDirection.Output;

                SqlParameter totalSafetyWarningResult = comStr.Parameters.Add("@totalSafetyWarningResult", SqlDbType.VarChar, 8000);
                totalSafetyWarningResult.Direction = ParameterDirection.Output;

                SqlParameter totalSafetyWarningColor = comStr.Parameters.Add("@totalSafetyWarningColor", SqlDbType.VarChar, 8000);
                totalSafetyWarningColor.Direction = ParameterDirection.Output;

                SqlParameter cableForceSafetyWarningResult = comStr.Parameters.Add("@cableForceSafetyWarningResult", SqlDbType.VarChar, 8000);
                cableForceSafetyWarningResult.Direction = ParameterDirection.Output;

                SqlParameter cableForceSafetyWarningColor = comStr.Parameters.Add("@cableForceSafetyWarningColor", SqlDbType.VarChar, 8000);
                cableForceSafetyWarningColor.Direction = ParameterDirection.Output;

                SqlParameter cableForceRedWarningTimes = comStr.Parameters.Add("@cableForceRedWarningTimes", SqlDbType.Int);
                cableForceRedWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter cableForceYellowWarningTimes = comStr.Parameters.Add("@cableForceYellowWarningTimes", SqlDbType.Int);
                cableForceYellowWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter displacementSafetyWarningResult = comStr.Parameters.Add("@displacementSafetyWarningResult", SqlDbType.VarChar, 8000);
                displacementSafetyWarningResult.Direction = ParameterDirection.Output;

                SqlParameter displacementSafetyWarningColor = comStr.Parameters.Add("@displacementSafetyWarningColor", SqlDbType.VarChar, 8000);
                displacementSafetyWarningColor.Direction = ParameterDirection.Output;

                SqlParameter displacementRedWarningTimes = comStr.Parameters.Add("@displacementRedWarningTimes", SqlDbType.Int);
                displacementRedWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter displacementYellowWarningTimes = comStr.Parameters.Add("@displacementYellowWarningTimes", SqlDbType.Int);
                displacementYellowWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter windLoadSafetyWarningResult = comStr.Parameters.Add("@windLoadSafetyWarningResult", SqlDbType.VarChar, 8000);
                windLoadSafetyWarningResult.Direction = ParameterDirection.Output;

                SqlParameter windLoadSafetyWarningColor = comStr.Parameters.Add("@windLoadSafetyWarningColor", SqlDbType.VarChar, 8000);
                windLoadSafetyWarningColor.Direction = ParameterDirection.Output;

                SqlParameter windLoadRedWarningTimes = comStr.Parameters.Add("@windLoadRedWarningTimes", SqlDbType.Int);
                windLoadRedWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter windLoadYellowWarningTimes = comStr.Parameters.Add("@windLoadYellowWarningTimes", SqlDbType.Int);
                windLoadYellowWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter temperatureSafetyWarningResult = comStr.Parameters.Add("@temperatureSafetyWarningResult", SqlDbType.VarChar, 8000);
                temperatureSafetyWarningResult.Direction = ParameterDirection.Output;

                SqlParameter temperatureSafetyWarningColor = comStr.Parameters.Add("@temperatureSafetyWarningColor", SqlDbType.VarChar, 8000);
                temperatureSafetyWarningColor.Direction = ParameterDirection.Output;

                SqlParameter temperatureRedWarningTimes = comStr.Parameters.Add("@temperatureRedWarningTimes", SqlDbType.Int);
                temperatureRedWarningTimes.Direction = ParameterDirection.Output;

                SqlParameter temperatureYellowWarningTimes = comStr.Parameters.Add("@temperatureYellowWarningTimes", SqlDbType.Int);
                temperatureYellowWarningTimes.Direction = ParameterDirection.Output;

                conStr.Open();                       //打开数据库连接
                comStr.ExecuteNonQuery().ToString(); //执行存储过程


                models.PreFirstAssessmentReportTime      = comStr.Parameters["@preFirstAssessmentReportTime"].Value.ToString();//在执行完存储过程之后,可得到输出参数
                models.TotalSafetyPreWarningState        = comStr.Parameters["@totalSafetyWarningResult"].Value.ToString();
                models.TotalSafetyPreWarningColor        = comStr.Parameters["@totalSafetyWarningColor"].Value.ToString();
                models.CableForceSafetyPreWarningState   = comStr.Parameters["@cableForceSafetyWarningResult"].Value.ToString();
                models.CableForceSafetyPreWarningColor   = comStr.Parameters["@cableForceSafetyWarningColor"].Value.ToString();
                models.CableForceWarningGrade3Times      = Convert.ToInt32(comStr.Parameters["@cableForceRedWarningTimes"].Value);
                models.CableForceWarningGrade2Times      = Convert.ToInt32(comStr.Parameters["@cableForceYellowWarningTimes"].Value);
                models.DisplacementSafetyPreWarningState = comStr.Parameters["@displacementSafetyWarningResult"].Value.ToString();
                models.DisplacementSafetyPreWarningColor = comStr.Parameters["@displacementSafetyWarningColor"].Value.ToString();
                models.DisplacementWarningGrade3Times    = Convert.ToInt32(comStr.Parameters["@displacementRedWarningTimes"].Value);
                models.DisplacementWarningGrade2Times    = Convert.ToInt32(comStr.Parameters["@displacementYellowWarningTimes"].Value);
                models.WindLoadSafetyPreWarningState     = comStr.Parameters["@windLoadSafetyWarningResult"].Value.ToString();
                models.WindLoadSafetyPreWarningColor     = comStr.Parameters["@windLoadSafetyWarningColor"].Value.ToString();
                models.WindLoadWarningGrade3Times        = Convert.ToInt32(comStr.Parameters["@windLoadRedWarningTimes"].Value);
                models.WindLoadWarningGrade2Times        = Convert.ToInt32(comStr.Parameters["@windLoadYellowWarningTimes"].Value);
                models.TemperatureSafetyPreWarningState  = comStr.Parameters["@temperatureSafetyWarningResult"].Value.ToString();
                models.TemperatureSafetyPreWarningColor  = comStr.Parameters["@temperatureSafetyWarningColor"].Value.ToString();
                models.TemperatureWarningGrade3Times     = Convert.ToInt32(comStr.Parameters["@temperatureRedWarningTimes"].Value);
                models.TemperatureWarningGrade2Times     = Convert.ToInt32(comStr.Parameters["@temperatureYellowWarningTimes"].Value);
            }
            return(models);
        }
        public bool SendEmail(string to, string from, string cc, string bcc, string subject, string body, bool enablessl, Stream attachmentPath, string attachmentName)
        {
            System.Net.Mail.SmtpClient cl = new System.Net.Mail.SmtpClient();
            cl.Host = ApplicationSettingsFactory.GetApplicationSettings().SmtpHost;
            cl.UseDefaultCredentials = false;
            cl.Credentials           = new System.Net.NetworkCredential(ApplicationSettingsFactory.GetApplicationSettings().SmtpUsername, ApplicationSettingsFactory.GetApplicationSettings().SmtpPassword);
            cl.EnableSsl             = enablessl;
            cl.DeliveryMethod        = System.Net.Mail.SmtpDeliveryMethod.Network;
            try
            {
                System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(from, to, subject, body);

                // CC and BCC optional
                if (!string.IsNullOrEmpty(cc))
                {
                    string[] ccArray = cc.Split(',');
                    foreach (string sCC in ccArray)
                    {
                        msg.CC.Add(sCC);
                    }
                }

                // You can specify Address directly as string
                if (!string.IsNullOrEmpty(bcc))
                {
                    string[] bccArray = bcc.Split(',');
                    foreach (string sBCC in bccArray)
                    {
                        msg.Bcc.Add(sBCC);
                    }
                }

                if (attachmentPath != null)
                {
                    var att = new System.Net.Mail.Attachment(attachmentPath, attachmentName);
                    msg.Attachments.Add(att);
                }
                msg.IsBodyHtml = true;
                ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return(true); };

                cl.Send(msg);
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(true);
        }
Esempio n. 12
0
        public PayrollRepository()
        {
            base.ServiceURL = ApplicationSettingsFactory.GetApplicationSettings().BaseURL + serviceName;

            ChildGetAllLookup.Add(typeof(FiscalYear), "qryYE");
            ChildGetAllLookup.Add(typeof(GenerationHeader), "qryHE");
            ChildGetAllLookup.Add(typeof(FiscalPeriod), "qryPE");
            ChildGetAllLookup.Add(typeof(EmployeePayroll), "qryEM");


            ChildGetAllLookup.Add(typeof(PayrollEntitlementDeduction), "qryED");
            ChildGetAllLookup.Add(typeof(TimeSchedule), "qryTS");
            ChildGetAllLookup.Add(typeof(TimeCode), "qryTC");
            ChildGetAllLookup.Add(typeof(SocialSecuritySchedule), "qrySS");
            ChildGetAllLookup.Add(typeof(SocialSecurityScheduleSetup), "qrySC");
            ChildGetAllLookup.Add(typeof(FinalSettlement), "qryFS");
            ChildGetAllLookup.Add(typeof(FinalEntitlementsDeductions), "qryFD");
            ChildGetAllLookup.Add(typeof(PayCode), "qryPC");
            ChildGetAllLookup.Add(typeof(PayrollSocialSecurity), "qryES");
            ChildGetAllLookup.Add(typeof(PayrollIndemnity), "qryIS");
            ChildGetAllLookup.Add(typeof(PayrollIndemnityDetails), "qryID");
            ChildGetAllLookup.Add(typeof(PayrollIndemnityRecognition), "qryIR");
            ChildGetAllLookup.Add(typeof(LeavePayment), "qryLP");
            ChildGetAllLookup.Add(typeof(Bank), "qryBA");
            ChildGetAllLookup.Add(typeof(PenaltyType), "qryPT");
            ChildGetAllLookup.Add(typeof(PenaltyDetail), "qryPD");
            ChildGetAllLookup.Add(typeof(PayrollArgument), "qryAR");



            ChildGetAllLookup.Add(typeof(PayrollBenefitSchedule), "qryBS");
            ChildGetAllLookup.Add(typeof(PayrollBenefit), "qryBE");



            ChildAddOrUpdateLookup.Add(typeof(FiscalYear), "setYE");
            ChildAddOrUpdateLookup.Add(typeof(GenerationHeader), "setHE");
            ChildAddOrUpdateLookup.Add(typeof(EmployeePayroll), "setEM");
            ChildAddOrUpdateLookup.Add(typeof(PayrollEntitlementDeduction[]), "arrED");
            ChildAddOrUpdateLookup.Add(typeof(PayrollEntitlementDeduction), "setED");
            ChildAddOrUpdateLookup.Add(typeof(SyncED), "syncED");
            ChildAddOrUpdateLookup.Add(typeof(TimeSchedule), "setTS");
            ChildAddOrUpdateLookup.Add(typeof(TimeCode[]), "arrTC");
            ChildAddOrUpdateLookup.Add(typeof(SocialSecuritySchedule), "setSS");
            ChildAddOrUpdateLookup.Add(typeof(SocialSecurityScheduleSetup), "setSC");
            ChildAddOrUpdateLookup.Add(typeof(FinalSettlement), "setFS");
            ChildAddOrUpdateLookup.Add(typeof(FinalEntitlementsDeductions), "setFD");
            ChildAddOrUpdateLookup.Add(typeof(PayCode), "setPC");
            ChildAddOrUpdateLookup.Add(typeof(PayrollIndemnity), "setIS");
            ChildAddOrUpdateLookup.Add(typeof(PayrollIndemnityDetails), "setID");
            ChildAddOrUpdateLookup.Add(typeof(PayrollIndemnityDetails[]), "arrID");
            ChildAddOrUpdateLookup.Add(typeof(PayrollIndemnityRecognition[]), "arrIR");
            ChildAddOrUpdateLookup.Add(typeof(LeavePayment), "setLP");
            ChildAddOrUpdateLookup.Add(typeof(Bank), "setBA");
            ChildAddOrUpdateLookup.Add(typeof(PenaltyType), "setPT");
            ChildAddOrUpdateLookup.Add(typeof(PenaltyDetail), "setPD");
            ChildAddOrUpdateLookup.Add(typeof(TimeCode), "setTC");
            ChildAddOrUpdateLookup.Add(typeof(FiscalPeriod), "setPE");
            ChildAddOrUpdateLookup.Add(typeof(MailEmployee), "mailEM");
            ChildAddOrUpdateLookup.Add(typeof(PayrollArgument), "setAR");



            ChildAddOrUpdateLookup.Add(typeof(GeneratePayroll), "genEM");

            ChildAddOrUpdateLookup.Add(typeof(CheckExpression), "checkEX");

            ChildAddOrUpdateLookup.Add(typeof(PayrollBenefitSchedule), "setBS");
            ChildAddOrUpdateLookup.Add(typeof(PayrollBenefit), "setBE");



            ChildAddOrUpdateLookup.Add(typeof(DeletePayroll), "delEM");



            ChildDeleteLookup.Add(typeof(FiscalYear), "delYE");
            ChildDeleteLookup.Add(typeof(PayrollEntitlementDeduction), "delED");
            ChildDeleteLookup.Add(typeof(GenerationHeader), "delHE");
            ChildDeleteLookup.Add(typeof(TimeSchedule), "delTS");
            ChildDeleteLookup.Add(typeof(SocialSecuritySchedule), "delSS");
            ChildDeleteLookup.Add(typeof(SocialSecurityScheduleSetup), "delSC");
            ChildDeleteLookup.Add(typeof(FinalSettlement), "delFS");
            ChildDeleteLookup.Add(typeof(FinalEntitlementsDeductions), "delFD");
            ChildDeleteLookup.Add(typeof(PayCode), "delPC");
            ChildDeleteLookup.Add(typeof(PayrollIndemnity), "delIS");
            ChildDeleteLookup.Add(typeof(PayrollIndemnityDetails), "delID");
            ChildDeleteLookup.Add(typeof(PayrollIndemnityRecognition), "delIR");
            ChildDeleteLookup.Add(typeof(LeavePayment), "delLP");
            ChildDeleteLookup.Add(typeof(Bank), "delBA");
            ChildDeleteLookup.Add(typeof(EmployeePayroll), "delEM");
            ChildDeleteLookup.Add(typeof(PenaltyType), "delPT");
            ChildDeleteLookup.Add(typeof(PenaltyDetail), "delPD");
            ChildDeleteLookup.Add(typeof(TimeCode), "delTC");



            ChildDeleteLookup.Add(typeof(PayrollBenefitSchedule), "delBS");
            ChildDeleteLookup.Add(typeof(PayrollBenefit), "delBE");
            ChildDeleteLookup.Add(typeof(PayrollArgument), "delAR");



            ChildGetLookup.Add(typeof(GenerationHeader), "getHE");
            ChildGetLookup.Add(typeof(TimeSchedule), "getTS");
            ChildGetLookup.Add(typeof(SocialSecuritySchedule), "getSS");
            ChildGetLookup.Add(typeof(SocialSecurityScheduleSetup), "getSC");
            ChildGetLookup.Add(typeof(FinalSettlement), "getFS");
            ChildGetLookup.Add(typeof(FinalEntitlementsDeductions), "getFD");
            ChildGetLookup.Add(typeof(PayCode), "getPC");
            ChildGetLookup.Add(typeof(PayrollIndemnity), "getIS");
            ChildGetLookup.Add(typeof(PayrollIndemnityDetails), "getID");
            ChildGetLookup.Add(typeof(PayrollIndemnityRecognition), "getIR");
            ChildGetLookup.Add(typeof(LeavePayment), "getLP");
            ChildGetLookup.Add(typeof(Bank), "getBA");
            ChildGetLookup.Add(typeof(TimeCode), "getTC");
            ChildGetLookup.Add(typeof(PenaltyType), "getPT");
            ChildGetLookup.Add(typeof(PenaltyDetail), "getPD");
            ChildGetLookup.Add(typeof(FiscalPeriod), "getPE");


            //ChildGetLookup.Add(typeof(CheckExpression), "checkEX");


            ChildGetLookup.Add(typeof(PayrollBenefitSchedule), "getBS");
            ChildGetLookup.Add(typeof(PayrollBenefit), "getBE");
            ChildGetLookup.Add(typeof(PayrollArgument), "getAR");
        }
Esempio n. 13
0
        /// <summary>
        /// 初始化程序配置
        /// </summary>
        private static void InitializeApplicationSetting()
        {
            IApplicationSettings applicationSettings = new AppConfigApplicationSettings(); //IocContainerFactory.GetUnityContainer().Resolve<IApplicationSettings>();

            ApplicationSettingsFactory.InitializeApplicationSettingsFactory(applicationSettings);
        }