/// <summary>
        /// 
        /// </summary>
        /// <param name="objInvestor"></param>
        /// <returns></returns>
        internal int AddNewInvestorProfile(Business.Investor objInvestor)
        {
            int Result = -1;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.InvestorProfileTableAdapter adap = new DSTableAdapters.InvestorProfileTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;
                Result = int.Parse(adap.AddNewInvestorProfile(objInvestor.InvestorID, objInvestor.Address, objInvestor.Phone, objInvestor.City,
                                            objInvestor.Country, objInvestor.Email, objInvestor.ZipCode, objInvestor.RegisterDay,
                                            objInvestor.InvestorComment, objInvestor.State, objInvestor.NickName, objInvestor.IDPassport).ToString());
            }
            catch (Exception ex)
            {
                return -1;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;
            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrep = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrep.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrep.PanelSetId);
                if (panelSetOrderCytology.Final == true)
                {
                    if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsDiagnosisThreeOrBetter(panelSetOrderCytology.ResultCode) == true)
                    {
                        YellowstonePathology.Business.Domain.PatientHistory patientHistory = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetPatientHistory(accessionOrder.PatientId);
                        Nullable<DateTime> dateOfLastHPV = patientHistory.GetDateOfPreviousHpv(accessionOrder.AccessionDate.Value);

                        if (dateOfLastHPV.HasValue == true)
                        {
                            if (dateOfLastHPV < DateTime.Today.AddDays(-330))
                            {
                                result = true;
                            }
                        }
                        else
                        {
                            result = true;
                        }
                    }
                }
            }
            return result;
        }
        public override void AcceptResults(YellowstonePathology.Business.Rules.RuleExecutionStatus ruleExecutionStatus, YellowstonePathology.Business.Test.AccessionOrder accessionOrder, Business.User.SystemUser acceptingUser)
        {
            YellowstonePathology.Business.Rules.ExecutionStatus executionStatus = new YellowstonePathology.Business.Rules.ExecutionStatus();
            YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(this.ReportNo);
            if (panelSetOrder.Final == true)
            {
                executionStatus.AddMessage(this.ReportNo + " is already finaled.", true);
                ruleExecutionStatus.PopulateFromLinqExecutionStatus(executionStatus);
                return;
            }

            if (this.Accepted == true)
            {
                executionStatus.AddMessage(this.ReportNo + " Acid Wash result has already been accepted.", true);
                ruleExecutionStatus.PopulateFromLinqExecutionStatus(executionStatus);
                return;
            }

            this.Accepted = true;
            this.AcceptedById = acceptingUser.UserId;
            this.AcceptedDate = DateTime.Today;
            this.AcceptedTime = DateTime.Now;

            this.Acknowledged = true;
            this.AcknowledgedById = acceptingUser.UserId;
            this.AcknowledgedDate = DateTime.Today;
            this.AcknowledgedTime = DateTime.Now;
        }
        public CMMCResultView(string reportNo, Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AccessionOrder = accessionOrder;
            this.m_PanelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(reportNo);

            this.m_OrderingPhysician = YellowstonePathology.Business.Gateway.PhysicianClientGateway.GetPhysicianByPhysicianId(this.m_AccessionOrder.PhysicianId);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objInvestorLog"></param>
        /// <returns></returns>
        internal int AddNewInvestorLog(Business.InvestorLog objInvestorLog)
        {
            int Result = -1;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.InvestorLogTableAdapter adap = new DSTableAdapters.InvestorLogTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;
                Result = int.Parse(adap.AddNewInvestorLog(objInvestorLog.InvestorInstance.InvestorID, objInvestorLog.Time, objInvestorLog.IP, objInvestorLog.Message,
                                    objInvestorLog.Status).ToString());
            }
            catch (Exception ex)
            {
                return -1;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objInvestorGroup"></param>
        /// <returns></returns>
        internal int AddNewInvestorGroup(Business.InvestorGroup objInvestorGroup)
        {
            int Result = -1;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.InvestorGroupTableAdapter adap = new DSTableAdapters.InvestorGroupTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;

                Result = int.Parse(adap.AddNewInvestorGroup(objInvestorGroup.Name, objInvestorGroup.Owner, objInvestorGroup.DefautDeposite).ToString());
            }
            catch (Exception ex)
            {
                return -1;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
Beispiel #7
0
 public List<Enterprise> Get(Business business)
 {
     using (var db = GetDataContext())
     {
         return db.Enterprises.Where(e => e.Business == business).ToList();
     }
 }
 private void InitData(Business.Meeting meeting)
 {
     foreach (ac.uk.brunel.contextaware.Note noteItem in meeting.Slides)
     {
         txtMeetingNotes.Text += noteItem.message + SEPARATOR;
     }
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="OpenTrade"></param>
        internal void UpdateCommand(Business.OpenTrade OpenTrade)
        {
            this.TaskWork = this.ProcessSetTassMT4;
            this.Comment = "UpdateCommand " + this.InvestorID;
            this.TaskName = "UpdateCommand " + this.InvestorID;
            //this.IsActive = false;

            if (this.IsActive == true)
            {
                if (this.isInTask)
                {
                    this.UpdateCommands.Add(OpenTrade);
                }
                else
                {
                    this.IsActive = false;
                    this.UpdateCommands.Add(OpenTrade);
                    Business.CalculatorFacade.SetTask(this);
                }
            }
            else
            {
                this.UpdateCommands.Add(OpenTrade);
                Business.CalculatorFacade.SetTask(this);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objInvestor"></param>
        /// <returns></returns>
        internal bool UpdateInvestorProfile(Business.Investor objInvestor)
        {
            bool Result = false;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.InvestorProfileTableAdapter adap = new DSTableAdapters.InvestorProfileTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;
                int ResultUpdate = adap.UpdateInvestorProfile(objInvestor.InvestorID, objInvestor.Address, objInvestor.Phone, objInvestor.City, objInvestor.Country, objInvestor.Email,
                    objInvestor.ZipCode, objInvestor.InvestorComment, objInvestor.State, objInvestor.NickName, objInvestor.IDPassport, objInvestor.InvestorProfileID);

                if (ResultUpdate > 0)
                    Result = true;
            }
            catch (Exception ex)
            {
                return false;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
 public ClientBillingFacility(Facility performaingFacility, Facility defaultBillingFacility, Business.Client.Model.ClientGroupClientCollection clientGroupClientCollection, string facilityComponent)
 {
     this.m_PerformingFacility = performaingFacility;
     this.m_DefaultBillingFacility = defaultBillingFacility;
     this.m_ClientGroupClientCollection = clientGroupClientCollection;
     this.m_FacilityComponent = facilityComponent;
 }
        public SelezioneDocumentiAllegatiUI(Business.Interface.DocumentoFilter filterDocumenti)
        {
            InitializeComponent();
            inizializza();

            _filterDocumenti = filterDocumenti;
        }
 public PlateletAssociatedAntibodiesWordDocument(Business.Test.AccessionOrder accessionOrder, Business.Test.PanelSetOrder panelSetOrder, YellowstonePathology.Business.Document.ReportSaveModeEnum reportSaveMode)
     : base(accessionOrder, panelSetOrder, reportSaveMode)
 {
     this.m_PanelList = new YellowstonePathology.Business.Flow.FlowMarkerPanelList();
     this.m_PanelList.SetFillCommandByPanelId(8);
     this.m_PanelList.Fill();
 }
        public static void AddGallery(Business.Gallery gallery)
        {
            if (gallery == null)
                throw new ArgumentNullException("gallery");

            gallery.Save();
        }
Beispiel #15
0
        public void Add(Business.Entity.Modulo Modulo)
        {
            using (AcademiaEntities context = new AcademiaEntities())
            {
                if(!validateDesc (Modulo.Descripcion))
                {
                    throw new Exception();
                }
                modulo oMod ;
                try
                {
                    oMod = new modulo();
                    oMod.desc_modulo = Modulo.Descripcion;

                    context.modulos.Add(oMod);
                    context.SaveChanges();

                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    oMod = null;
                }
            }
        }
        /// <summary>
        /// Permanently delete the profile records associated with the specified <paramref name="gallery" />.
        /// </summary>
        /// <param name="gallery">The gallery.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="gallery" /> is null.</exception>
        public static void DeleteProfileForGallery(Business.Gallery gallery)
        {
            if (gallery == null)
                throw new ArgumentNullException("gallery");

            Factory.GetDataProvider().Profile_DeleteProfilesForGallery(gallery.GalleryId);
        }
 public static IResultView GetResultView(string reportNo, Business.Test.AccessionOrder accessionOrder, int clientId, bool testing)
 {
     IResultView resultView = null;
     switch (clientId)
     {
         case 558:
         case 820:
         case 723:
         case 33:
         case 1417:
         case 650:
         case 1421:
         case 649:
         case 230:
         case 123:
         case 126:
         case 242:
         case 253:
         case 1313:
         case 1096:
         case 287:
         case 968:
         case 250:
         case 57:
         case 313:
         case 1025:
         case 1321:
         case 25:
         case 90:
         case 505:
         case 154:
         case 184:
         case 969:
         case 1422:
         case 1456:
         case 1279:
         case 67:
         case 673:
         case 149:
         case 1119:
             resultView = new Business.HL7View.EPIC.EpicResultView(reportNo, accessionOrder, testing);
             break;
         case 203: //Richard Taylor
         case 1177: //Spring Creek
         case 196: //Central Montana
         case 209: //Laura Bennett
         case 954: // Barb Miller
         case 1471: //Marchion
         //case 219:
             resultView = new HL7View.CMMC.CMMCResultView(reportNo, accessionOrder);
             break;
         case 1337:
             resultView = new HL7View.CDC.MTDohResultView(reportNo, accessionOrder);
             break;
         case 1203:
             resultView = new HL7View.ECW.ECWResultView(reportNo, accessionOrder, testing);
             break;
     }
     return resultView;
 }
        public void createURLNotification(string url, 
Business.AppointmentVO appVO)
        {
            string subject = "";
            if(appVO._Id != null)
                subject = appVO._Subject;
            notificationURL = url;
            _notification = new Notification();
            _notification.Caption = "News: ";
            _notification.Critical = false;
            //
            StringBuilder HTMLString = new StringBuilder();
            HTMLString.Append("<html><body>");
            HTMLString.Append("<font color=\"#0000FF\">Information); availiable for:</font><br>");
            HTMLString.Append("<font color=\"#0000FF\"><b>Appointment: " + subject + "</b></font><br/>");
            HTMLString.Append("<form method=\"GET\" action=notify>");
            HTMLString.Append("<br/><input type=button name='show' value='Show info'>");
            HTMLString.Append("<input type=button name='cancel' value='Cancel'/>");
            HTMLString.Append("</body></html>");
            _notification.Text = HTMLString.ToString();
            //
            _notification.BalloonChanged += new
            BalloonChangedEventHandler(_notification_BalloonChanged);
            _notification.ResponseSubmitted += new
            ResponseSubmittedEventHandler(_notification_ResponseSubmitted);
            _notification.InitialDuration = 20;
            _notification.Visible = true;
        }
 // This constructor will take a product ID and display that product's information
 // This form will show edit buttons
 public frmProducts(String EditingItemID, Business business)
 {
     this.business = business;
     this.EditingItemID = EditingItemID;
     InitializeComponent();
     this.Text = "Editing: PorductID " + EditingItemID;
 }
 public override YellowstonePathology.Business.Rules.MethodResult Distribute(string reportNo, Business.Test.AccessionOrder accessionOrder)
 {
     Business.HL7View.ECW.ECWResultView ecwResultView = new HL7View.ECW.ECWResultView(reportNo, accessionOrder, false);
     YellowstonePathology.Business.Rules.MethodResult result = new Rules.MethodResult();
     ecwResultView.CanSend(result);
     return result;
 }
Beispiel #21
0
        private void AddProjectToCroolProject(Business.Entities.CroolProject croolProject, Project p)
        {
            string projectName = string.IsNullOrEmpty(p.FullName) ? p.Name : p.FullName;

            if (!string.IsNullOrEmpty(projectName))
            {
                int lastSlash = projectName.LastIndexOf('\\');
                lastSlash = lastSlash == -1 ? 0 : lastSlash;
                string pathToProject = projectName;

                if (lastSlash != 0)
                {
                    pathToProject = projectName.Substring(0, lastSlash);
                }

                var project = new Business.Entities.Project
                {
                    Name = p.UniqueName
                };

                croolProject.Projects.Add(project);

                this.LoadProjectFiles(croolProject, p.ProjectItems, project, pathToProject);
            }
        }
        public KRASStandardReflexKRASOnlyResult(string reportNo, Business.Test.AccessionOrder accessionOrder)
            : base(reportNo, accessionOrder)
        {
            YellowstonePathology.Business.Test.KRASStandard.KRASStandardTest krasStandardTest = new KRASStandard.KRASStandardTest();
            YellowstonePathology.Business.Test.KRASStandard.KRASStandardTestOrder krasStandardTestOrder = (YellowstonePathology.Business.Test.KRASStandard.KRASStandardTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(krasStandardTest.PanelSetId, this.KRASStandardReflexTestOrder.OrderedOnId, true);
            this.m_KRASStandardResult = krasStandardTestOrder.Result;

            if (krasStandardTestOrder.Final == true)
            {
                this.m_KRASStandardResult = krasStandardTestOrder.Result;

                YellowstonePathology.Business.Test.KRASStandard.KRASStandardNotDetectedResult notDetectedResult = new KRASStandard.KRASStandardNotDetectedResult();
                YellowstonePathology.Business.Test.KRASStandard.KRASStandardDetectedResult detectedResult = new KRASStandard.KRASStandardDetectedResult();

                if (krasStandardTestOrder.ResultCode == detectedResult.ResultCode)
                {
                    this.m_KRASStandardMutationDetected = this.m_KRASStandardTestOrder.MutationDetected;
                    this.m_BRAFV600EKResult = KRASStandardReflexResult.NotClinicallyIndicatedResult;
                    this.m_KRASStandardResult = this.m_KRASStandardResult + " - " + this.m_KRASStandardMutationDetected;
                }
                else
                {
                    this.m_BRAFV600EKResult = KRASStandardReflexResult.NotOrderedResult;
                }
            }
            else
            {
                this.m_KRASStandardResult = KRASStandardReflexResult.PendingResult;
                this.m_BRAFV600EKResult = KRASStandardReflexResult.PendingResult;
            }
        }
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;
            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrep = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();
            if (accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrep.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelSetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrep.PanelSetId);
                if (panelSetOrderCytology.Final == true)
                {
                    if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeNormal(panelSetOrderCytology.ResultCode) == true ||
                        YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeReactive(panelSetOrderCytology.ResultCode) == true)
                    {
                        if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeTZoneAbsent(panelSetOrderCytology.ResultCode) == true)
                        {
                            if (accessionOrder.PBirthdate < DateTime.Today.AddYears(-30))
                            {
                                result = true;
                            }
                        }
                    }
                }
            }

            return result;
        }
 public override YellowstonePathology.Business.Rules.MethodResult Distribute(string reportNo, Business.Test.AccessionOrder accessionOrder)
 {
     YellowstonePathology.Business.Rules.MethodResult result = new Rules.MethodResult();
     result.Message = "Nothing to distribute on WebService";
     result.Success = true;
     return result;
 }
Beispiel #25
0
 public void SetBusiness(Business bus)
 {
     myBusiness = bus;
     adName.text = bus.name;
     adDesc.text = bus.desc;
     adLogo.mainTexture = bus.logo;
 }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objVirtualDealer"></param>
        /// <returns></returns>
        internal string AddNewVirtualDealer(Business.VirtualDealer objVirtualDealer)
        {
            string result = "-1";
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            System.Data.SqlClient.SqlTransaction trans = null;
            DSTableAdapters.VirtualDealerTableAdapter virtualDealerAdap = new DSTableAdapters.VirtualDealerTableAdapter();
            DSTableAdapters.VirtualDealerConfigTableAdapter dealerConfigAdap = new DSTableAdapters.VirtualDealerConfigTableAdapter();
            DSTableAdapters.IVirtualDealerTableAdapter iVirtualDealerAdap = new DSTableAdapters.IVirtualDealerTableAdapter();
            try
            {
                conn.Open();
                trans = conn.BeginTransaction();

                virtualDealerAdap.Connection = conn;
                virtualDealerAdap.Transaction = trans;
                int id = int.Parse(virtualDealerAdap.AddNewVirtualDealer(objVirtualDealer.Name, "").ToString());
                result = id.ToString();
                if (id == -1)
                {
                    throw new Exception("Data error");
                }

                dealerConfigAdap.Connection = conn;
                dealerConfigAdap.Transaction = trans;
                DateTime DateValue = DateTime.Parse("1753-01-01 00:00:00.000");
                dealerConfigAdap.Insert(null, "Profit max pip", id, "VD01", -1, "NaN", objVirtualDealer.ProfitMaxPip.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "Loss max pip", id, "VD02", -1, "NaN", objVirtualDealer.LossMaxPip.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "Min volume", id, "VD03", -1, "NaN", objVirtualDealer.StartVolume.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "Max volume", id, "VD04", -1, "NaN", objVirtualDealer.EndVolume.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "Delay", id, "VD05", -1, "NaN", objVirtualDealer.Delay.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "Additional pip", id, "VD06", -1, "NaN", objVirtualDealer.AdditionalPip.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "Mode", id, "VD07", -1, "NaN", objVirtualDealer.Mode.ToString(), DateValue);
                dealerConfigAdap.Insert(null, "IsEnable", id, "VD08", objVirtualDealer.IsEnable ? 1 : 0, "NaN", "NaN", DateValue);
                dealerConfigAdap.Insert(null, "IsLimitAuto", id, "VD09", objVirtualDealer.IsLimitAuto ? 1 : 0, "NaN", "NaN", DateValue);
                dealerConfigAdap.Insert(null, "IsStopAuto", id, "VD10", objVirtualDealer.IsStopAuto ? 1 : 0, "NaN", "NaN", DateValue);
                dealerConfigAdap.Insert(null, "IsStopSlippage", id, "VD11", objVirtualDealer.IsStopSlippage ? 1 : 0, "NaN", "NaN", DateValue);
                dealerConfigAdap.Insert(null, "GroupCondition", id, "VD12", -1, objVirtualDealer.GroupCondition, "NaN", DateValue);
                dealerConfigAdap.Insert(null, "SymbolCodition", id, "VD13", -1, objVirtualDealer.SymbolCondition, "NaN", DateValue);
                iVirtualDealerAdap.Connection = conn;
                iVirtualDealerAdap.Transaction = trans;
                for (int i = 0; i < objVirtualDealer.IVirtualDealer.Count; i++)
                {
                    iVirtualDealerAdap.Insert(objVirtualDealer.IVirtualDealer[i].InvestorGroupID, objVirtualDealer.IVirtualDealer[i].SymbolID, id);
                }
                trans.Commit();
            }
            catch (Exception ex)
            {
                trans.Rollback();
                return "Data error";
            }
            finally
            {
                virtualDealerAdap.Connection.Close();
                dealerConfigAdap.Connection.Close();
                iVirtualDealerAdap.Connection.Close();
                conn.Close();
            }
            return result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objSymbol"></param>
        /// <param name="SymbolID"></param>
        /// <returns></returns>
        public string SelectSymbolByIDReferenceInSymbolList(Business.Symbol objSymbol, int SymbolID)
        {
            string result = string.Empty;
            if (objSymbol != null)
            {
                int count = objSymbol.RefSymbol.Count;
                for (int i = 0; i < count; i++)
                {
                    if (objSymbol.RefSymbol[i].SymbolID == SymbolID)
                    {
                        result = objSymbol.RefSymbol[i].SymbolID.ToString() + "," + objSymbol.RefSymbol[i].SecurityID.ToString() + "," + objSymbol.SymbolID.ToString() + "," +
                                    objSymbol.RefSymbol[i].MarketAreaRef.IMarketAreaID.ToString() + "," + objSymbol.RefSymbol[i].Name;

                        break;
                    }

                    if (objSymbol.RefSymbol[i].RefSymbol != null)
                    {
                        result += this.SelectSymbolByIDReferenceInSymbolList(objSymbol.RefSymbol[i], SymbolID);
                    }
                }
            }

            return result;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objInvestorProfile"></param>
        /// <returns></returns>
        internal int AddNewInvestor(Business.Investor objInvestor)
        {
            int Result = -1;
            System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(DBConnection.DBConnection.Connection);
            DSTableAdapters.InvestorTableAdapter adap = new DSTableAdapters.InvestorTableAdapter();
            DSTableAdapters.InvestorProfileTableAdapter adapInvestorProfile = new DSTableAdapters.InvestorProfileTableAdapter();

            try
            {
                conn.Open();
                adap.Connection = conn;
                adapInvestorProfile.Connection = conn;

                //string hashPwd = TradingServer.Model.ValidateCheck.GetEncodedString(objInvestor.PrimaryPwd);
                //string hashPwd = TradingServer.Model.ValidateCheck.Encrypt(objInvestor.PrimaryPwd);
                //string hashReadPwd = TradingServer.Model.ValidateCheck.GetEncodedString(objInvestor.ReadOnlyPwd);
                //string hashReadPwd = TradingServer.Model.ValidateCheck.Encrypt(objInvestor.ReadOnlyPwd);
                //string hashPhonePwd = TradingServer.Model.ValidateCheck.GetEncodedString(objInvestor.PhonePwd);
                //string hashPhonePwd = TradingServer.Model.ValidateCheck.Encrypt(objInvestor.PhonePwd);

                if ((objInvestor.InvestorStatusID == -1) && (objInvestor.InvestorGroupInstance.InvestorGroupID == -1) && (string.IsNullOrEmpty(objInvestor.AgentID)))
                {
                    Result = int.Parse(adap.AddNewInvestor(null, null, objInvestor.Balance, objInvestor.Credit, objInvestor.Code, objInvestor.PrimaryPwd, objInvestor.ReadOnlyPwd, objInvestor.PhonePwd,
                        true, objInvestor.TaxRate, objInvestor.Leverage, objInvestor.AllowChangePwd, objInvestor.ReadOnly, objInvestor.SendReport, "0", 0, "", objInvestor.RefInvestorID,
                        objInvestor.AgentRefID, "", "").ToString());
                }
                else
                {
                    int? resultFind = 0;
                    resultFind = adap.FindAgentWithAgentID(objInvestor.AgentID);
                    if (resultFind > 0)
                    {
                        Result = int.Parse(adap.AddNewInvestor(objInvestor.InvestorStatusID, objInvestor.InvestorGroupInstance.InvestorGroupID, objInvestor.Balance,
                            objInvestor.Credit, objInvestor.Code, objInvestor.PrimaryPwd, objInvestor.ReadOnlyPwd, objInvestor.PhonePwd, objInvestor.IsDisable, objInvestor.TaxRate, objInvestor.Leverage,
                            objInvestor.AllowChangePwd, objInvestor.ReadOnly, objInvestor.SendReport, objInvestor.AgentID, 0, "", objInvestor.RefInvestorID, objInvestor.AgentRefID, "", "").ToString());
                    }
                    else
                    {
                        Result = int.Parse(adap.AddNewInvestor(objInvestor.InvestorStatusID, objInvestor.InvestorGroupInstance.InvestorGroupID, objInvestor.Balance,
                            objInvestor.Credit, objInvestor.Code, objInvestor.PrimaryPwd, objInvestor.ReadOnlyPwd, objInvestor.PhonePwd, objInvestor.IsDisable, objInvestor.TaxRate, objInvestor.Leverage,
                            objInvestor.AllowChangePwd, objInvestor.ReadOnly, objInvestor.SendReport, "0", 0, "", objInvestor.RefInvestorID, objInvestor.AgentRefID, "", "").ToString());
                    }
                }

                //int.Parse(adapInvestorProfile.AddNewInvestorProfile(Result, objInvestor.Address, objInvestor.Phone, objInvestor.City, objInvestor.Country, objInvestor.Email,
                //                        objInvestor.ZipCode, objInvestor.RegisterDay, objInvestor.Comment, objInvestor.State, objInvestor.NickName).ToString());

            }
            catch (Exception ex)
            {
                return Result;
            }
            finally
            {
                adap.Connection.Close();
                conn.Close();
            }

            return Result;
        }
        public override bool IsRequired(Business.Test.AccessionOrder accessionOrder)
        {
            bool result = false;

            YellowstonePathology.Business.Test.HPV.HPVTest panelSetHPV = new YellowstonePathology.Business.Test.HPV.HPVTest();
               YellowstonePathology.Business.Test.HPV1618.HPV1618Test panelSetHPV1618 = new YellowstonePathology.Business.Test.HPV1618.HPV1618Test();
            YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest panelSetThinPrepPap = new YellowstonePathology.Business.Test.ThinPrepPap.ThinPrepPapTest();

            if(accessionOrder.PanelSetOrderCollection.Exists(panelSetThinPrepPap.PanelSetId) == true)
            {
                YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology panelsetOrderCytology = (YellowstonePathology.Business.Test.ThinPrepPap.PanelSetOrderCytology)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetThinPrepPap.PanelSetId);
                if (panelsetOrderCytology.Final == true)
                {
                    string papResultCode = panelsetOrderCytology.ResultCode;
                    if (YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeNormal(papResultCode) == true || YellowstonePathology.Business.Cytology.Model.CytologyResultCode.IsResultCodeReactive(papResultCode) == true)
                    {
                        if (accessionOrder.PanelSetOrderCollection.Exists(panelSetHPV.PanelSetId) == true)
                        {
                            YellowstonePathology.Business.Test.HPV.HPVTestOrder hpvTestOrder = (YellowstonePathology.Business.Test.HPV.HPVTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(panelSetHPV.PanelSetId);
                            if (hpvTestOrder.ResultCode == YellowstonePathology.Business.Test.HPV.HPVResult.OveralResultCodePositive)
                            {
                                result = true;
                            }
                        }
                    }
                }
            }

            return result;
        }
 protected void Application_Start(Object sender, EventArgs e)
 {
     NorthWindAccess n = new NorthWindAccess("Provider=Microsoft.Jet.OLEDB.4.0;  Data Source=" + Server.MapPath(".") + "\\Northwind.mdb");
     Application["DBAccessor"] = n;
     Business b = new Business(n);
     Application["Business"] = b;
 }
Beispiel #31
0
        private void LoadReport()
        {
            DataTable dataTable = null;

            if (this.PanelDaily.Visible)
            {
                dataTable = Business.MenuByEmp(this.TxtDayFrom.Text, this.TxtDayTo.Text, null, null, null, null);
            }
            else if (this.PanelMonthly.Visible)
            {
                dataTable = Business.MenuByEmp(null, null, this.LstMonthFrom.SelectedItem.Value, this.LstMonthTo.SelectedItem.Value, this.TxtYear.Text, null);
            }
            else if (this.PanelYearly.Visible)
            {
                dataTable = Business.MenuByEmp(null, null, null, null, this.TxtYearFrom.Text, this.TxtYearTo.Text);
            }
            dataTable = Business.ConvertColumnString(dataTable);
            if (dataTable.Rows.Count > 0)
            {
                DataRow dataRow = dataTable.NewRow();
                for (int i = 2; i < dataTable.Columns.Count; i++)
                {
                    object obj = dataTable.Compute(string.Concat("Sum([", dataTable.Columns[i].ColumnName.ToString(), "])"), "");
                    if (obj is DBNull)
                    {
                        dataRow[i] = 0;
                    }
                    else
                    {
                        dataRow[i] = decimal.Parse(obj.ToString());
                    }
                }
                dataTable.Rows.Add(dataRow);
            }
            this.ReportGrid.DataSource = dataTable;
            this.ReportGrid.DataBind();
        }
        // GET: Businesses/UpdateBusiness
        public ActionResult UpdateBusiness()
        {
            ReflectionController rc = new ReflectionController();
            List <Type>          listControllerType = rc.GetController("T41.Areas.Admin.Controllers");
            List <string>        listControllerOld  = db.Business.Select(c => c.BusinessId).ToList();
            List <string>        listPermissionOld  = db.Permission.Select(c => c.PermissionName).ToList();

            foreach (var c in listControllerType)
            {
                if (!listControllerOld.Contains(c.Name))
                {
                    Business b = new Business()
                    {
                        BusinessId   = c.Name,
                        BusinessName = "Chưa có mô tả"
                    };
                    db.Business.Add(b);
                    List <string> listPermission = rc.GetActions(c);
                    foreach (var p in listPermission)
                    {
                        if (!listPermissionOld.Contains(c.Name + "-" + p))
                        {
                            Permission permission = new Permission()
                            {
                                PermissionName = c.Name + "-" + p,
                                Description    = "Chưa có mô tả",
                                BusinessId     = c.Name
                            };
                            db.Permission.Add(permission);
                        }
                    }
                }
            }
            db.SaveChanges();
            TempData["err"] = "<div class='alert alert-info' role='alert'> <span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
            return(RedirectToAction("Index"));
        }
Beispiel #33
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Song.Entities.Accounts st = this.Master.Account;
     if (st == null)
     {
         return;
     }
     org   = Business.Do <IOrganization>().OrganCurrent();
     dtLog = Business.Do <IStudent>().StudentStudyCourseLog(org.Org_ID, this.Master.Account.Ac_ID);
     if (!this.IsPostBack)
     {
         BindData(null, null);
     }
     //此页面的ajax提交,全部采用了POST方式
     if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
     {
         string action = WeiSha.Common.Request.Form["action"].String.ToLower();
         string couid  = WeiSha.Common.Request.Form["couid"].String.ToLower();
         string json   = string.Empty;
         switch (action)
         {
         case "getstc":
             Song.Entities.Student_Course stc = GetStc(couid);
             if (stc == null)
             {
                 json = "{\"success\":\"0\"}";
             }
             else
             {
                 json = "{\"success\":\"1\",data:" + stc.ToJson() + "}";
             }
             break;
         }
         Response.Write(json);
         Response.End();
     }
 }
 public void ProcessRequest(HttpContext context)
 {
     this.Context = context;
     Context.Response.ContentType = "text/plain";
     //如果未登录
     if (!Extend.LoginState.Accounts.IsLogin)
     {
         Context.Response.Write(getBackJson(1, null, null));
         return;
     }
     //当前学员
     Song.Entities.Accounts st = Extend.LoginState.Accounts.CurrentUser;
     //当前课程
     Song.Entities.Course course = Business.Do <ICourse>().CourseSingle(couid);
     if (course == null)
     {
         Context.Response.Write(getBackJson(4, null, null));
         return;
     }
     //生成学员与课程的关联
     Song.Entities.Student_Course sc = new Entities.Student_Course();
     //是否试用
     if (isTry)
     {
         Try(course, st);
     }
     //如果免费购买
     if (!isTry && isFree)
     {
         FreeBuy(course, st);
     }
     //如果不是免费课程,花钱买课程
     if (!isTry && !isFree)
     {
         Buy(course, st);
     }
 }
        /// <summary>
        /// 获取当前登录QQ的详细信息
        /// </summary>
        /// <param name="access_token"></param>
        /// <param name="openid"></param>
        /// <returns>xml对象</returns>
        private Song.Entities.Accounts getUserInfo(string access_token, string openid)
        {
            string userUrl = "https://graph.qq.com/user/get_user_info?access_token={0}&oauth_consumer_key={1}&openid={2}";
            string appid   = Business.Do <ISystemPara>()["QQAPPID"].String;

            userUrl = string.Format(userUrl, access_token, appid, openid);
            //解析QQ账户信息
            Song.Entities.Accounts acc = new Entities.Accounts();
            try
            {
                string  infoJson = WeiSha.Common.Request.WebResult(userUrl);
                JObject jo       = (JObject)JsonConvert.DeserializeObject(infoJson);
                string  ret      = jo["ret"] != null ? jo["ret"].ToString() : string.Empty; //返回码
                string  msg      = jo["msg"] != null ? jo["msg"].ToString() : string.Empty; //返回的提示信息
                if (ret == "0")
                {
                    acc.Ac_AccName = acc.Ac_QqOpenID = openid;
                    acc.Ac_Name    = jo["nickname"] != null ? jo["nickname"].ToString() : string.Empty; //姓名
                    string gender = jo["gender"] != null ? jo["gender"].ToString() : string.Empty;
                    acc.Ac_Sex = gender == "男" ? 1 : 2;
                    acc.Ac_Age = jo["year"] != null?Convert.ToInt32(jo["year"].ToString()) : 0;                   //年龄

                    acc.Ac_Photo = jo["figureurl_qq_2"] != null ? jo["figureurl_qq_2"].ToString() : string.Empty; //头像
                    acc.Org_ID   = WeiSha.Common.Request.QueryString["orgid"].Int32 ?? 0;                         //所属机构
                }
                else
                {
                    this.Document.Variables.SetValue("errcode", ret);
                    this.Document.Variables.SetValue("errmsg", msg);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(acc);
        }
Beispiel #36
0
        /// <summary>
        /// 编辑当前数据项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEditEnter_Click(object sender, EventArgs e)
        {
            System.Web.UI.WebControls.Button btn = (System.Web.UI.WebControls.Button)sender;
            int index = ((GridViewRow)(btn.Parent.Parent)).RowIndex;
            int id    = int.Parse(this.gvPrice.DataKeys[index].Value.ToString());

            //
            Song.Entities.CoursePrice col = Business.Do <ICourse>().PriceSingle(id);
            if (col != null)
            {
                //区间
                TextBox tb = (TextBox)gvPrice.Rows[index].FindControl("tbSpan");
                int     span;
                int.TryParse(tb.Text, out span);
                col.CP_Span = span;
                //单位
                DropDownList ddlUnit = (DropDownList)gvPrice.Rows[index].FindControl("ddlUnit");
                col.CP_Unit = ddlUnit.SelectedItem.Text;
                //价格
                TextBox tbprice = (TextBox)gvPrice.Rows[index].FindControl("tbPrice");
                int     price;
                int.TryParse(tbprice.Text, out price);
                col.CP_Price = price;
                //卡券
                int     coupon   = 0;
                TextBox tbcoupon = (TextBox)gvPrice.Rows[index].FindControl("tbCoupon");
                int.TryParse(tbcoupon.Text, out coupon);
                col.CP_Coupon = coupon;
                //是否可用
                CheckBox cb = (CheckBox)gvPrice.Rows[index].FindControl("cbIsUse");
                col.CP_IsUse = cb.Checked;
                //
                Business.Do <ICourse>().PriceSave(col);
            }
            gvPrice.EditIndex = -1;
            BindPriceData();
        }
Beispiel #37
0
        /// <summary>
        /// 按课程抽题组卷
        /// </summary>
        /// <param name="tp"></param>
        /// <returns></returns>
        private Dictionary <TestPaperItem, Questions[]> _putout_0(TestPaper tp)
        {
            //获取试题项,例如单选题、多选题
            Song.Entities.TestPaperItem[] tpi  = this.GetItemForAll(tp);
            List <TestPaperItem>          list = new List <TestPaperItem>();

            foreach (Song.Entities.TestPaperItem t in tpi)
            {
                if (t.TPI_Count > 0)
                {
                    list.Add(t);
                }
            }
            tpi = _getItemCoutomOrder(list.ToArray());
            //开始出卷
            Dictionary <TestPaperItem, Questions[]> dic = new Dictionary <TestPaperItem, Questions[]>();

            foreach (Song.Entities.TestPaperItem t in tpi)
            {
                int   type  = (int)t.TPI_Type;
                int   count = (int)t.TPI_Count;    //当前题型的试题数
                float num   = (float)t.TPI_Number; //当前题型占的分数
                if (count < 1)
                {
                    continue;
                }
                //当前类型的试题
                Song.Entities.Questions[] ques = Business.Do <IQuestions>().QuesRandom(tp.Org_ID, (int)tp.Sbj_ID, tp.Cou_ID, -1, type, tp.Tp_Diff, tp.Tp_Diff2, true, count);
                if (ques.Length < 1)
                {
                    continue;
                }
                ques = clacScore(ques, num);
                dic.Add(t, ques);
            }
            return(dic);
        }
Beispiel #38
0
 /// <summary>
 /// 填充章节信息
 /// </summary>
 /// <param name="olid"></param>
 private void outlineFill(int olid)
 {
     olineInitBind(couid);
     Song.Entities.Outline mm;
     if (olid > 0)
     {
         mm = Business.Do <IOutline>().OutlineSingle(olid);
         //是否显示
         cbIsUse.Checked = mm.Ol_IsUse;
         //上级章节
         ListItem li = ddlOutline.Items.FindByValue(mm.Ol_PID.ToString());
         if (li != null)
         {
             ddlOutline.SelectedIndex = -1;
             li.Selected = true;
         }
         //唯一标识
         ViewState["UID"] = mm.Ol_UID;
         //附件与视频
         VideoBind();
         EventBindData(null, null);
         AccessoryBind();
     }
     else
     {
         //如果是新增
         mm = new Song.Entities.Outline();
         ViewState["UID"] = WeiSha.Common.Request.UniqueID();
     }
     //标题
     Ol_Name.Text = mm.Ol_Name;
     //简介
     Ol_Intro.Text    = mm.Ol_Intro;
     lbOutlineID.Text = olid.ToString();
     //上传控件
     Uploader1.UID = this.getUID();
 }
Beispiel #39
0
        public ActionResult Transfer(Business business, Checking checking)
        {
            if (ModelState.IsValid)
            {
                int depositamount = checking.AccountBalance;
                checking.AccountBalance       += (int)TempData["CBalance"];
                _context.Entry(checking).State = EntityState.Modified;
                _context.CheckingTrans.Add(new CheckingTrans
                {
                    Time       = DateTime.Now,
                    Amount     = depositamount,
                    CheckingId = checking.CheckingId,
                    Type       = "TransferAdd"
                });
                _context.SaveChanges();

                int withdrawamount = business.AccountBalance;
                business.AccountBalance        = (int)TempData["BBalance"];
                business.AccountBalance       -= withdrawamount;
                _context.Entry(business).State = EntityState.Modified;
                _context.BusinessTrans.Add(new BusinessTrans
                {
                    Time       = DateTime.Now,
                    Amount     = withdrawamount,
                    BusinessId = business.BusinessId,
                    Type       = "TransferSub"
                });
                _context.SaveChanges();

                if (business.AccountBalance - withdrawamount < 0)
                {
                    return(View("Message"));
                }
            }

            return(View());
        }
        private void actualizarControles()
        {
            //tabla negocios
            dgvBusiness.DataSource = null;
            dgvBusiness.DataSource = BusinessDAO.getLista();
            //dgvProducts
            dgvProducts.DataSource = null;
            dgvProducts.DataSource = ProductDAO.getLista();
            //cmbRemoveBusiness
            cmbRemoveBusiness.DataSource    = null;
            cmbRemoveBusiness.ValueMember   = "IdBusiness";
            cmbRemoveBusiness.DisplayMember = "Name";
            cmbRemoveBusiness.DataSource    = BusinessDAO.getLista();
            //cmbAddProductBusiness
            cmbAddProductBusiness.DataSource    = null;
            cmbAddProductBusiness.ValueMember   = "IdBusiness";
            cmbAddProductBusiness.DisplayMember = "Name";
            cmbAddProductBusiness.DataSource    = BusinessDAO.getLista();

            //cmbRmvProdc
            Business b = (Business)cmbAddProductBusiness.SelectedItem;

            cmbRmvProdc.DataSource    = null;
            cmbRmvProdc.ValueMember   = "IdProduct";
            cmbRmvProdc.DisplayMember = "Name";
            cmbRmvProdc.DataSource    = ProductDAO.getLista(b);
            //cmbAlterAppuser
            cmbAlterAppuser.DataSource    = null;
            cmbAlterAppuser.ValueMember   = "IdUser";
            cmbAlterAppuser.DisplayMember = "Username";
            cmbAlterAppuser.DataSource    = AppuserDAO.getLista();
            //dgvAdminOrders
            dgvAdminOrders.DataSource = null;
            dgvAdminOrders.DataSource = AppuserDAO.getLista();

            poblarGrafico();
        }
Beispiel #41
0
        protected override void InitPageTemplate(HttpContext context)
        {
            //是否允许注册
            WeiSha.Common.CustomConfig config = CustomConfig.Load(this.Organ.Org_Config);
            this.Document.SetValue("IsRegTeacher", config["IsRegTeacher"].Value.Boolean ?? true);
            this.Document.SetValue("IsRegSms", config["IsRegSms"].Value.Boolean ?? true);    //是否要短信验证
            //操作步骤
            this.Document.SetValue("step", step);
            //注册协议
            if (step == 1)
            {
                string agreement = Business.Do <ISystemPara>().GetValue("Agreement_teacher");
                if (!string.IsNullOrWhiteSpace(agreement))
                {
                    agreement = Regex.Replace(agreement, "{platform}", this.Organ.Org_PlatformName, RegexOptions.IgnoreCase);
                    agreement = Regex.Replace(agreement, "{org}", this.Organ.Org_AbbrName, RegexOptions.IgnoreCase);
                    agreement = Regex.Replace(agreement, "{domain}", WeiSha.Common.Server.MainName, RegexOptions.IgnoreCase);
                }
                this.Document.SetValue("Agreement", agreement);
            }
            //此页面的ajax提交,全部采用了POST方式
            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {
                string action = WeiSha.Common.Request.Form["action"].String;
                switch (action)
                {
                case "getSms":
                    mobivcode_verify();      //验证手机登录时,获取短信时的验证码
                    break;

                case "mobiregister":
                    mobiregister_verify();       //用手机号注册
                    break;
                }
                Response.End();
            }
        }
Beispiel #42
0
        public async Task <ActionResult> WorkerInvitationConfig(string businessId, string ownerId, string email, string roleId)
        {
            Guid business_id = Guid.Parse(businessId);

            Business business = await applicationDbContext.Businesses.Include("BusinessUsers").FirstOrDefaultAsync(x => x.Id == business_id);

            User user = await applicationDbContext.Users.FirstOrDefaultAsync(x => x.Id == ownerId);

            User worker = await applicationDbContext.Users.FirstOrDefaultAsync(x => x.Email == email);

            IdentityRole role = await applicationDbContext.Roles.FirstOrDefaultAsync(x => x.Id == roleId);

            bool exist = false;

            if (User.Identity.IsAuthenticated)
            {
                string currentId = User.Identity.GetUserId();

                exist = business.BusinessUsers.FirstOrDefault(x => x.User_Id == currentId) != null;
            }

            BusinessInvitationModel result = new BusinessInvitationModel()
            {
                Email    = email,
                Owner    = user,
                Business = new BusinessModel()
                {
                    DT_RowId = business.Id.ToString(),
                    Name     = business.Name
                },
                AlreadySubscribed = exist,
                AlreadySystem     = worker != null,
                Role = role
            };

            return(View(result));
        }
Beispiel #43
0
        public TestPaper[] PaperPager(int orgid, int sbjid, int couid, int diff, bool?isUse, string sear, int size, int index, out int countSum)
        {
            WhereClip wc = new WhereClip();

            if (orgid > 0)
            {
                wc &= TestPaper._.Org_ID == orgid;
            }
            if (sbjid > 0)
            {
                WhereClip  wcSbjid = new WhereClip();
                List <int> list    = Business.Do <ISubject>().TreeID(sbjid);
                foreach (int l in list)
                {
                    wcSbjid.Or(TestPaper._.Sbj_ID == l);
                }
                wc.And(wcSbjid);
            }
            if (couid > 0)
            {
                wc.And(TestPaper._.Cou_ID == couid);
            }
            if (diff > 0)
            {
                wc.And(TestPaper._.Tp_Diff == diff);
            }
            if (isUse != null)
            {
                wc.And(TestPaper._.Tp_IsUse == (bool)isUse);
            }
            if (sear != null && sear.Trim() != "")
            {
                wc.And(TestPaper._.Tp_Name.Like("%" + sear + "%"));
            }
            countSum = Gateway.Default.Count <TestPaper>(wc);
            return(Gateway.Default.From <TestPaper>().Where(wc).OrderBy(TestPaper._.Tp_CrtTime.Desc).ToArray <TestPaper>(size, (index - 1) * size));
        }
 /// <summary>
 /// 重置密码
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnPw_Click(object sender, EventArgs e)
 {
     try
     {
         if (!Extend.LoginState.Admin.IsAdmin)
         {
             throw new Exception("非管理员无权此操作权限!");
         }
         if (id == 0)
         {
             throw new Exception("当前信息不存在!");
         }
         Song.Entities.Teacher obj = Business.Do <ITeacher>().TeacherSingle(id);
         if (obj == null)
         {
             throw new Exception("当前信息不存在!");
         }
         Song.Entities.Accounts acc = Business.Do <IAccounts>().AccountsSingle(obj.Ac_ID);
         //员工登录密码,为空
         if (tbPw1.Text.Trim() != "")
         {
             obj.Th_Pw = tbPw1.Text.Trim();
             if (acc != null)
             {
                 acc.Ac_Pw = new WeiSha.Common.Param.Method.ConvertToAnyValue(obj.Th_Pw).MD5;
             }
         }
         obj.Th_Pw = new WeiSha.Common.Param.Method.ConvertToAnyValue(obj.Th_Pw).MD5;
         Business.Do <IAccounts>().AccountsSave(acc);
         Business.Do <ITeacher>().TeacherSave(obj);
         Master.AlertCloseAndRefresh("操作成功!");
     }
     catch (Exception ex)
     {
         Master.Alert(ex.Message);
     }
 }
Beispiel #45
0
 /// <summary>
 /// 免费购买
 /// </summary>
 /// <param name="course"></param>
 /// <param name="st"></param>
 private void FreeBuy(Song.Entities.Course course, Song.Entities.Accounts st)
 {
     //如果不是免费课程
     if (!course.Cou_IsFree)
     {
         //当课程不是免费的,直接退出
         Context.Response.Write(getBackJson(7, null, null));
         return;
     }
     else
     {
         //生成学员与课程的关联
         Song.Entities.Student_Course sc = Business.Do <ICourse>().StudyCourse(st.Ac_ID, couid);
         if (sc == null)
         {
             sc = new Entities.Student_Course();
         }
         sc.Cou_ID        = couid;
         sc.Ac_ID         = st.Ac_ID;
         sc.Stc_StartTime = DateTime.Now;
         sc.Stc_EndTime   = DateTime.Now.AddYears(101);
         sc.Stc_IsFree    = true;
         sc.Stc_IsTry     = false;
         try
         {
             Business.Do <ICourse>().Buy(sc);
             Extend.LoginState.Accounts.Course(course);
             Context.Response.Write(getBackJson(0, sc, null));
             return;
         }
         catch (Exception ex)
         {
             Context.Response.Write(getBackJson(6, null, ex));
             return;
         }
     }
 }
Beispiel #46
0
        private void numBusinessPerCategoryButton_Click(object sender, RoutedEventArgs e)
        {
            Dictionary <string, int> myData = new Dictionary <string, int>();

            for (int i = 0; i < searchResultsDataGrid.Items.Count; i++)
            {
                Business b = (Business)searchResultsDataGrid.Items[i];

                using (var connection = new NpgsqlConnection(buildConnString()))
                {
                    connection.Open();
                    using (var cmd = new NpgsqlCommand())
                    {
                        cmd.Connection  = connection;
                        cmd.CommandText = "SELECT category FROM Categories WHERE business_id='" + b.id + "' ";
                        using (var reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                if (myData.ContainsKey(reader.GetString(0)))
                                {
                                    myData[reader.GetString(0)] += 1;
                                }
                                else
                                {
                                    myData[reader.GetString(0)] = 1;
                                }
                            }
                        }
                    }
                }
            }
            CategoriesChart w2 = new CategoriesChart();

            w2.categoryChart.DataContext = myData;
            w2.Show();
        }
Beispiel #47
0
 protected void btnBase_Click(object sender, EventArgs e)
 {
     //平台名称,二维域名,ICP备案
     org.Org_PlatformName = Org_PlatformName.Text.Trim();
     org.Org_TwoDomain    = Org_TwoDomain.Text.Trim();
     org.Org_ICP          = Org_ICP.Text.Trim();
     //手机端是否仅限微信使用
     org.Org_IsOnlyWeixin = Org_IsOnlyWeixin.Checked;
     //图片
     if (fuLoad.PostedFile.FileName != "")
     {
         try
         {
             fuLoad.UpPath       = _uppath;
             fuLoad.IsMakeSmall  = false;
             fuLoad.IsConvertJpg = false;
             fuLoad.SaveAndDeleteOld(org.Org_Logo);
             //fuLoad.File.Server.ChangeSize(150, 200, false);
             org.Org_Logo = fuLoad.File.Server.FileName;
             //
             imgShow.Src = fuLoad.File.Server.VirtualPath;
         }
         catch (Exception ex)
         {
             this.Alert(ex.Message);
         }
     }
     try
     {
         Business.Do <IOrganization>().OrganSave(org);
         this.Alert("操作成功!");
     }
     catch (Exception ex)
     {
         this.Alert(ex.Message);
     }
 }
Beispiel #48
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void initData(string state)
        {
            int pi = 0;

            foreach (string s in state.Split(','))
            {
                string[] arr = s.Split(':');
                if (arr[0] == "serial")
                {
                    serial = arr[1];
                }
                if (arr[0] == "pi")
                {
                    int.TryParse(arr[1], out pi);
                }
            }
            this.payInterface = Business.Do <IPayInterface>().PaySingle(pi);
            this.moneyAccount = Business.Do <IAccounts>().MoneySingle(serial);
            total_fee         = (int)(moneyAccount.Ma_Money * 100);
            orgid             = moneyAccount.Org_ID;
            appid             = payInterface.Pai_ParterID; //绑定支付的APPID(必须配置)
            secret            = payInterface.Pai_Key;      //公众帐号secert(仅JSAPI支付的时候需要配置)
            WeiSha.Common.CustomConfig config = CustomConfig.Load(payInterface.Pai_Config);
            mchid  = config["MCHID"].Value.String;         //商户id
            paykey = config["Paykey"].Value.String;        //支付密钥
            //回调地址
            notify_url = this.payInterface.Pai_Returl;
            if (string.IsNullOrWhiteSpace(notify_url))
            {
                notify_url = "http://" + WeiSha.Common.Server.Domain + "/";
            }
            if (!notify_url.EndsWith("/"))
            {
                notify_url += "/";
            }
            notify_url += "Pay/Weixin/ResultNotifyPage.aspx";
        }
        /// <summary>
        /// 进入编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnEdit_Click(object sender, ImageClickEventArgs e)
        {
            plEditArea.Visible = true;
            plListArea.Visible = false;
            //
            WeiSha.WebControl.RowEdit img = (WeiSha.WebControl.RowEdit)sender;
            int index = ((GridViewRow)(img.Parent.Parent)).RowIndex;
            int id    = int.Parse(this.GridView1.DataKeys[index].Value.ToString());

            //上级
            ddlTree.Items.Clear();
            Song.Entities.GuideColumns[] cous = Business.Do <IGuide>().GetColumnsAll(couid, null);
            ddlTree.DataSource          = cous;
            this.ddlTree.DataTextField  = "Gc_title";
            this.ddlTree.DataValueField = "Gc_ID";
            this.ddlTree.Root           = 0;
            this.ddlTree.DataBind();
            ddlTree.Items.Insert(0, new ListItem("   -- 顶级 --", "0"));
            //
            Song.Entities.Guide guide = Business.Do <IGuide>().GuideSingle(id);
            lbID.Text       = guide.Gu_Id.ToString();
            tbTitle.Text    = guide.Gu_Title;
            cbIsHot.Checked = guide.Gu_IsHot;
            //是否显示
            cbIsShow.Checked = guide.Gu_IsShow;
            //是否置顶
            cbIsTop.Checked = guide.Gu_IsTop;
            //是否推荐
            cbIsRec.Checked = guide.Gu_IsRec;
            tbDetails.Text  = guide.Gu_Details;
            ListItem li = ddlTree.Items.FindByValue(guide.Gc_ID.ToString());

            if (li != null)
            {
                li.Selected = true;
            }
        }
Beispiel #50
0
        public TestPaper[] PagerCount(string search, int orgid, int sbjid, int couid, int diff, bool?isUse, int count)
        {
            WhereClip wc = new WhereClip();

            if (orgid > 0)
            {
                wc.And(TestPaper._.Org_ID == orgid);
            }
            if (sbjid > 0)
            {
                WhereClip  wcSbjid = new WhereClip();
                List <int> list    = Business.Do <ISubject>().TreeID(sbjid);
                foreach (int l in list)
                {
                    wcSbjid.Or(TestPaper._.Sbj_ID == l);
                }
                wc.And(wcSbjid);
            }
            if (couid > 0)
            {
                wc.And(TestPaper._.Cou_ID == couid);
            }
            if (diff > 0)
            {
                wc.And(TestPaper._.Tp_Diff == diff);
            }
            if (isUse != null)
            {
                wc.And(TestPaper._.Tp_IsUse == (bool)isUse);
            }
            if (search != null && search.Trim() != "")
            {
                wc.And(TestPaper._.Tp_Name.Like("%" + search + "%"));
            }
            count = count > 0 ? count : int.MaxValue;
            return(Gateway.Default.From <TestPaper>().Where(wc).OrderBy(TestPaper._.Tp_CrtTime.Desc).ToArray <TestPaper>(count));
        }
        /// <summary>
        /// 返回当前大题下的试题
        /// </summary>
        /// <param name="id">试题分类</param>
        /// <returns></returns>
        private List <Song.Entities.Questions> getQues(object[] id)
        {
            int type = 0;

            if (id.Length > 0 && id[0] is int)
            {
                type = Convert.ToInt32(id[0]);
            }
            List <Song.Entities.Questions> list = new List <Entities.Questions>();
            XmlNode     root      = resXml.LastChild;
            XmlNodeList quesNodes = root.ChildNodes;

            for (int i = 0; i < quesNodes.Count; i++)
            {
                int tp = Convert.ToInt32(quesNodes[i].Attributes["type"].Value);
                if (tp == type)
                {
                    //小题的节点
                    XmlNodeList qnode = quesNodes[i].ChildNodes;
                    for (int j = 0; j < qnode.Count; j++)
                    {
                        int qid = Convert.ToInt32(qnode[j].Attributes["id"].Value);
                        Song.Entities.Questions ques = Business.Do <IQuestions>().QuesSingle(qid);
                        if (ques == null)
                        {
                            continue;
                        }
                        ques             = Extend.Questions.TranText(ques);
                        ques.Qus_Title   = Extend.Html.ClearHTML(ques.Qus_Title, "pre", "p");
                        ques.Qus_Explain = Extend.Html.ClearHTML(ques.Qus_Explain, "pre", "p");
                        ques.Qus_Title   = ques.Qus_Title.Replace("&quot;", "\"");
                        list.Add(ques);
                    }
                }
            }
            return(list);
        }
        private void addReview_Clicked(object sender, RoutedEventArgs e)
        {
            if (businessGrid.Items.Count > 0)
            {
                var      rowindex   = businessGrid.SelectedIndex;
                var      row        = (DataGridRow)businessGrid.ItemContainerGenerator.ContainerFromIndex(rowindex);
                Business row1       = (Business)businessGrid.SelectedItems[0];
                var      businessId = row1.bid;


                using (var conn = new NpgsqlConnection(buildConnString()))
                {
                    conn.Open();
                    using (var cmd = new NpgsqlCommand())
                    {
                        cmd.Connection = conn;

                        cmd.CommandText = "INSERT INTO review(review_id, uid, bid, review_stars, date, text, useful_vote, funny_vote, cool_vote) VALUES('" + RandomString(22) + "', 'om5ZiponkpRqUNa3pVPiRg', '" + businessId + "'," + ratingdropdown.SelectedItem.ToString() + ", '2019-03-19', '" + reviewtext.Text + "', 1, 1, 1)";
                        Console.WriteLine(cmd.CommandText);
                        using (var reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                reviewlist.Items.Add(new Review()
                                {
                                    name = reader.GetString(0),
                                    date = reader.GetString(1),
                                    text = reader.GetString(2)
                                });
                            }
                        }

                        conn.Close();
                    }
                }
            }
        }
Beispiel #53
0
        protected override void InitPageTemplate(HttpContext context)
        {
            if (Request.ServerVariables["REQUEST_METHOD"] == "GET")
            {
                if (Extend.LoginState.Accounts.IsLogin)
                {
                    int accid = Extend.LoginState.Accounts.CurrentUserId;
                    Song.Entities.TeacherComment cmt = Business.Do <ITeacher>().CommentSingle(thid, accid, day);
                    if (cmt != null)
                    {
                        //服务器端时间
                        //string time = new WeiSha.Common.Param.Method.ConvertToAnyValue(DateTime.Now.ToString()).JavascriptTime;
                        //string last = new WeiSha.Common.Param.Method.ConvertToAnyValue(cmt.Thc_CrtTime.AddDays(day).ToString()).JavascriptTime;
                        this.Document.Variables.SetValue("Time", WeiSha.Common.Server.getTime());
                        this.Document.Variables.SetValue("Last", WeiSha.Common.Server.getTime(cmt.Thc_CrtTime.AddDays(day)));
                        //最近一次评价
                        this.Document.SetValue("comment", cmt);
                    }
                }
            }
            //此页面的ajax提交,全部采用了POST方式
            if (Request.ServerVariables["REQUEST_METHOD"] == "POST")
            {
                string action = WeiSha.Common.Request.Form["action"].String;
                switch (action)
                {
                case "vcode":
                    vcode_verify();     //验证验证码
                    break;

                case "submit":
                    submit();
                    break;
                }
                Response.End();
            }
        }
Beispiel #54
0
        public async Task <bool> NegocioRegistrar(SqlConnection cn, Business objNegocioBE)
        {
            try
            {
                bool       resultado = false;
                SqlCommand cmd       = new SqlCommand
                {
                    CommandText = "SP_NEGOCIO_REGISTRAR",
                    CommandType = CommandType.StoredProcedure,
                    Connection  = cn
                };

                SqlParameter param1 = cmd.Parameters.AddWithValue("@PK_Business", objNegocioBE.PK_Business);
                param1.Direction = ParameterDirection.Input;
                SqlParameter param2 = cmd.Parameters.AddWithValue("@PK_SubOffice", objNegocioBE.Pk_SubOffice);
                param2.Direction = ParameterDirection.Input;
                SqlParameter param3 = cmd.Parameters.AddWithValue("@Name", objNegocioBE.nameBusiness);
                param3.Direction = ParameterDirection.Input;
                SqlParameter param4 = cmd.Parameters.AddWithValue("@estado", objNegocioBE.Estado);
                param4.Direction = ParameterDirection.Input;

                int rpta = await cmd.ExecuteNonQueryAsync();

                if (rpta > 0)
                {
                    resultado = true;
                }

                return(resultado);
            }
#pragma warning disable CS0168 // The variable 'ex' is declared but never used
            catch (Exception ex)
#pragma warning restore CS0168 // The variable 'ex' is declared but never used
            {
                return(false);
            }
        }
Beispiel #55
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Song.Entities.EmpAccount emp = null;
            if (id < 1)
            {
                emp = Extend.LoginState.Admin.CurrentUser;
            }
            else
            {
                emp = Business.Do <IEmployee>().GetSingle(id);
            }
            string str = "";

            if (emp != null)
            {
                //资源的路径
                string resPath = Upload.Get["Employee"].Virtual;
                emp.Acc_Photo = resPath + emp.Acc_Photo;
                emp.Acc_Pw    = "";
                str           = emp.ToJson(null, "Acc_Pw,Acc_Qus,Acc_Ans,Dep_CnName,Acc_IDCardNumber");
            }
            Response.Write(str);
            Response.End();
        }
 /// <summary>
 /// 栏目下拉绑定
 /// </summary>
 private void ddlColumnBind()
 {
     try
     {
         //栏目分类
         //所属机构的所有课程
         Song.Entities.Organization org = Business.Do <IOrganization>().OrganCurrent();
         Song.Entities.Columns[]    nc  = Business.Do <IColumns>().ColumnCount(org.Org_ID, "product", true, -1);
         this.ddlColumn.DataSource     = nc;
         this.ddlColumn.DataTextField  = "Col_Name";
         this.ddlColumn.DataValueField = "Col_Id";
         this.ddlColumn.DataBind();
         //厂家
         this.ddlFactory.DataSource     = Business.Do <IProduct>().FactoryAll(true);
         this.ddlFactory.DataTextField  = "Pfact_Name";
         this.ddlFactory.DataValueField = "Pfact_Id";
         this.ddlFactory.DataBind();
         this.ddlFactory.Items.Insert(0, new ListItem("", "-1"));
         //产地
         this.ddlOrigin.DataSource     = Business.Do <IProduct>().OriginAll(true);
         this.ddlOrigin.DataTextField  = "Pori_Name";
         this.ddlOrigin.DataValueField = "Pori_Id";
         this.ddlOrigin.DataBind();
         this.ddlOrigin.Items.Insert(0, new ListItem("", "-1"));
         //材质
         this.ddlMaterial.DataSource     = Business.Do <IProduct>().MaterialAll(true);
         this.ddlMaterial.DataTextField  = "Pmat_Name";
         this.ddlMaterial.DataValueField = "Pmat_Id";
         this.ddlMaterial.DataBind();
         this.ddlMaterial.Items.Insert(0, new ListItem("", "-1"));
     }
     catch (Exception ex)
     {
         Message.ExceptionShow(ex);
     }
 }
        public async Task <Response> Update(int id, [FromForm] Business model)
        {
            Response _objResponse = new Response();

            try
            {
                if (id != model.BusinessId)
                {
                    _objResponse.Status = "No record found";
                    _objResponse.Data   = null;
                }
                else
                {
                    model.UpdatedDate = DateTime.Now;
                    model.BusinessUrl = urlreplace(model.BusinessName);
                    if (model.ImageFile != null)
                    {
                        model.ImageName = await SaveImage(model.ImageFile);
                    }
                    _context.Entry(model).Property(x => x.CreatedDate).IsModified = false;
                    _context.Entry(model).State = EntityState.Modified;
                    await _context.SaveChangesAsync();

                    _objResponse.Status = "Success";
                    _objResponse.Data   = null;
                }
            }
            catch (Exception ex)
            {
                _objResponse.Data   = null;
                _objResponse.Status = ex.ToString();
                Console.WriteLine("\nMessage ---\n{0}", ex.ToString());
                Console.WriteLine("\nStackTrace ---\n{0}", ex.StackTrace);
            }
            return(_objResponse);
        }
Beispiel #58
0
    public int db_update(Business bs)
    {
        SqlConnection con = new SqlConnection(str);
        SqlCommand    cmd = new SqlCommand();

        cmd.CommandText = "sp_updatestrgform";
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Connection  = con;

        cmd.Parameters.AddWithValue("@id", bs.Rollno);
        cmd.Parameters.AddWithValue("@fn", bs.fname);
        cmd.Parameters.AddWithValue("@mn", bs.mname);
        cmd.Parameters.AddWithValue("@ln", bs.lname);
        cmd.Parameters.AddWithValue("@gn", bs.gender);
        cmd.Parameters.AddWithValue("@cl", bs.clas);
        cmd.Parameters.AddWithValue("@hb", bs.hobby);
        cmd.Parameters.AddWithValue("@ct", bs.city);

        con.Open();
        int p = cmd.ExecuteNonQuery();

        con.Close();
        return(p);
    }
        /// <summary>
        /// 绑定列表
        /// </summary>
        protected void BindData(object sender, EventArgs e)
        {
            //总记录数
            int count = 0;
            //时间区间
            DateTime start = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);

            DateTime.TryParse(tbStartTime.Text, out start);
            DateTime end = start.AddMonths(1).AddDays(-1);

            DateTime.TryParse(tbEndTime.Text, out end);
            //操作方向
            int type = Convert.ToInt16(this.ddlType.SelectedValue);
            //学员账号
            int stid = st == null ? -1 : st.Ac_ID;

            Song.Entities.CouponAccount[] eas = null;
            eas = Business.Do <IAccounts>().CouponPager(-1, stid, type, (DateTime?)start, (DateTime?)end, Pager1.Size, Pager1.Index, out count);
            GridView1.DataSource   = eas;
            GridView1.DataKeyNames = new string[] { "Ca_ID" };
            GridView1.DataBind();

            Pager1.RecordAmount = count;
        }
Beispiel #60
0
        /// <summary>
        /// register store order detail
        /// </summary>
        private StoreOrderDetail RegisterStoreDetail(StoreOrder storeOrder, Data.PriceList priceList)
        {
            try
            {
                var commodity = Business.GetGoodiesBusiness().GetByName(txtCommodity.Text);
                if (commodity == null)
                {
                    throw new Exception(Localize.ex_commodity_not_found);
                }
                var storeOrderDetailBusiness = Business.GetStoreOrderDetailBusiness();

                var storeOrderDetail = Business.GetStoreOrderDetailBusiness().GetByCommodity(storeOrder, commodity.ID, cmbUnitCount.SelectedValue.ToGUID());
                if (storeOrderDetail == null)
                {
                    storeOrderDetail = new StoreOrderDetail();
                }

                var company = Business.GetComBusiness().GetByName(txtCompany.Text.Trim());

                storeOrderDetail.IdStoreOrder   = storeOrder.Id;
                storeOrderDetail.IdCommodity    = commodity.ID;
                storeOrderDetail.ODCountingUnit = cmbUnitCount.SelectedValue.ToGUID();
                storeOrderDetail.ODCount        = storeOrderDetail.ORemained = txtCount.Text.ToInt();
                storeOrderDetail.ODMoney        = priceList.PLPrice * txtCount.Text.ToInt();
                //storeOrderDetail.ODDiscount = txtDicountPrice.Text.ToDecimal();
                storeOrderDetail.ODDescription = txtComment.Text;

                Business.GetStoreOrderDetailBusiness().Save(storeOrderDetail);

                return(storeOrderDetail);
            }
            catch
            {
                throw;
            }
        }