private string checkDate(String dat)
 {
     if (dat.Length == 1)
         dat = "0" + dat;
     return dat;
 }
        /**
         * Put all data from given day into given table
         */
        public static void collectDataforDay(DateTime dateTime, SQLiteConnection m_dbConnection)
        {
            string zeroMonth = dateTime.Month < 10 ? "0" : "";
              string zeroDay = dateTime.Day < 10 ? "0" : "";
              string date = zeroMonth + dateTime.Month + "/" + zeroDay + dateTime.Day + "/" + dateTime.Year;

              PdfReader reader;
              try
              {
            reader = new PdfReader("http://www.equibase.com/premium/eqbPDFChartPlus.cfm?RACE=A&BorP=P&TID=SAR&CTRY=USA&DT=" + date + "&DAY=D&STYLE=EQB");
              }
              catch (Exception e)
              {
            Console.WriteLine("CAPTCHA TIME");
            Console.ReadKey();
            Console.ReadKey();

            reader = new PdfReader("http://www.equibase.com/premium/eqbPDFChartPlus.cfm?RACE=A&BorP=P&TID=SAR&CTRY=USA&DT=" + date + "&DAY=D&STYLE=EQB");
              }
              StringBuilder builder = new StringBuilder();

              for (int x = 1; x <= reader.NumberOfPages; x++)
              {
            PdfDictionary page = reader.GetPageN(x);
            IRenderListener listener = new SBTextRenderer(builder);
            PdfContentStreamProcessor processor = new PdfContentStreamProcessor(listener);
            PdfDictionary pageDic = reader.GetPageN(x);
            PdfDictionary resourcesDic = pageDic.GetAsDict(PdfName.RESOURCES);
            processor.ProcessContent(ContentByteUtils.GetContentBytesForPage(reader, x), resourcesDic);
              }

              if (pages.Count != 0)
              {

            DataHandler handler = new DataHandler(dateTime, pages, m_dbConnection);
            Thread thread = new Thread(new ThreadStart(handler.extractPdfData));

            thread.Start();
            thread.Join();
            reader.Dispose();
            pages.Clear();
              }
              else
              {
            // If there were no races on this particular day, simply skip it! :D
            Console.WriteLine("Invalid Date: " + date);
              }
        }
Esempio n. 3
1
	void Start()
	{
        if (GameObject.FindWithTag("Player"))
        {
            if (Screen.showCursor) Screen.showCursor = false; 	// Hide cursor in freeroam.
            if (!Screen.lockCursor) Screen.lockCursor = true; 	// Lock cursor in freeroam.
        }

        // Data proto
        myData = new DataHandler();
        myData.ValidateProfiles(); // Check that profile folder exists, if not create one. Also validate profiles so that they are not corrupt.	
		
		// Proto
		lastResSelection = selGridInt;
		qualSlider = (int)QualitySettings.currentLevel;
		
		// Works, however for prototyping i need to do stuff
		selStrings = new string[Screen.resolutions.Length];
		int i = 0;
		foreach(Resolution res in Screen.resolutions)
		{
			selStrings[i] = res.width + "x" + res.height + "@"+res.refreshRate;
			i++;
		}
	}
        public Full_TT()
        {
            InitializeComponent();
            TimeTable tt = new TimeTable();
            TimeTableAdapter t;
            DataHandler dat = new DataHandler();
            try
            {
                for (int i = 1; i < 6; i++)
                {
                    foreach (Slot s in tt.getForDay((DayOfWeek)i))
                    {
                        //Load the subject
                        t = new TimeTableAdapter();
                        Subject sub = dat.getSubject(s.clsnbr);
                        t.TT_Title = sub.title;
                        t.TT_Slot = s.slt.ToUpper();
                        t.TT_Time = s.frm_time.ToString("t") + " - " + s.to_time.ToString("t");
                        t.TT_Venue = "";
                        t.TT_Att = sub.percentage;
                        double per = Math.Round(((double)sub.attended / (double)sub.conducted) * 100, 1);

                        t.Att_Color = new SolidColorBrush(getClr(per));
                        switch (i)
                        {
                            //Monday
                            case 1:
                                tt_monday.Items.Add(t);
                                break;
                            case 2:
                                tt_tuesday.Items.Add(t);
                                break;
                            case 3:
                                tt_wednesday.Items.Add(t);
                                break;
                            case 4:
                                tt_thursday.Items.Add(t);
                                break;
                            case 5:
                                tt_friday.Items.Add(t);
                                break;
                        }
                    }
                }
            }
            catch (Exception) { }
        }
        public static List<TopicalApplicationModel> GetTopicalApplicationModel()
        {
            List<TopicalApplicationModel> topicalApplicationCollection = new List<TopicalApplicationModel>();

            try
            {
                IConnection connection = new Connection();
                string sqlConnection = connection.GetDataSourceValue("BH.Application.RouteConfirmation.config", "DataSource", "InitialCatalog", "UserID", "Password", "BH.Application.RouteConfirmation");

                IDataHandler dataHandler = new DataHandler();
                List<StoredProcedureParameter> storedProcedureParameters = new List<StoredProcedureParameter>();
                storedProcedureParameters.Add(new StoredProcedureParameter("@DataItemCode", SqlDbType.VarChar, "GEN_BodySite_SUG"));
                storedProcedureParameters.Add(new StoredProcedureParameter("@FormName", SqlDbType.VarChar, "PRX_Topicals"));
                DataTable dataTable = dataHandler.GetStoredProcedureResults(sqlConnection, "BH_MLM_ObsValueListing_Sp", storedProcedureParameters);
                foreach (DataRow dataRow in dataTable.Rows)
                    topicalApplicationCollection.Add(new TopicalApplicationModel(dataRow["Value"].ToString(), dataRow["Value"].ToString()));
                dataTable.Dispose();
            }
            catch
            {
                throw;
            }

            return topicalApplicationCollection;
        }
Esempio n. 6
0
 public Trivia_Lobby(string username)
 {
     InitializeComponent();
     dh = new DataHandler();
     //we pass the username from form1 to this form
     user = username;
 }
Esempio n. 7
0
        public static RxWriterModel GetRxWriterModel(int prescriptionID)
        {
            RxWriterModel rxWriterModel = new RxWriterModel();

            try
            {
                IDataHandler dataHandler = new DataHandler();
                List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>();
                parameters.Add(new StoredProcedureParameter("@PrescriptionID", SqlDbType.Int, prescriptionID));

                DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryRxWriterItems_Sp", parameters);
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    rxWriterModel.GenericName = dataRow["GenericName"].ToString();
                    rxWriterModel.RxNormCode = dataRow["RxNormCode"].ToString();
                    rxWriterModel.NDCCode = dataRow["NDCCode"].ToString();
                }
                dataTable.Dispose();
            }
            catch
            {
                throw;
            }

            return rxWriterModel;
        }
Esempio n. 8
0
File: PWM.cs Progetto: tpurtell/PWM
 public PWM()
 {
     InitializeComponent();
     dh = new igfxDHLib.DataHandler();
     RefreshV();
 }
Esempio n. 9
0
        public ActionResult <TableResult> Post([FromBody] Purview purview)
        {
            DataHandler dataHandler = new DataHandler();

            return(dataHandler.GetList <TableResult>(purview));
        }
Esempio n. 10
0
 /// <summary>
 /// Sets the specified hander function to handle data for the handler's symbol
 /// </summary>
 /// <param name="symbol">The symbol whose data is to be handled</param>
 /// <param name="handler">The handler to use when this symbol's data is encountered</param>
 /// <returns>An identifier that can be used to remove this handler</returns>
 public void SetDataHandler(Symbol symbol, Action<BaseData> handler)
 {
     var dataHandler = new DataHandler(symbol);
     dataHandler.DataEmitted += (sender, args) => handler(args);
     SetDataHandler(dataHandler);
 }
 /// <summary>
 /// Argument Constructor
 /// </summary>
 /// <param name="dataHandler">Provides requested data</param>
 /// <param name="asyncClassLogger">TraceSource Async Class Logger</param>
 public MarketRequestListener(DataHandler dataHandler, AsyncClassLogger asyncClassLogger)
 {
     // Save Instances
     _dataHandler      = dataHandler;
     _asyncClassLogger = asyncClassLogger;
 }
Esempio n. 12
0
 public Form1()
 {
     InitializeComponent();
     dh = new DataHandler();
 }
Esempio n. 13
0
        public CASResult Write()
        {
            byte[][]  entries = new byte[EncodingMap.Length][];
            CASFile[] files   = new CASFile[EncodingMap.Length];

            // header
            using (var ms = new MemoryStream())
                using (var bw = new BinaryWriter(ms))
                {
                    bw.Write(Header.Header);
                    bw.Write(Header.Version);
                    bw.Write(Header.ChecksumSize);
                    bw.Write(Header.HasChecksum);
                    bw.WriteUInt32BE((uint)Entries.Count);
                    bw.WriteUInt16BE((ushort)Tags.Count);

                    if (Header.Version >= 2)
                    {
                        bw.Write(Header.NumFlags);
                    }

                    if (Header.Version >= 3)
                    {
                        // TODO
                        //bw.Write(Header.BasePriority);
                        //bw.Write(Header.Unknown_0D);
                    }

                    entries[0] = ms.ToArray();
                    files[0]   = new CASFile(entries[0], EncodingMap[0].Type, EncodingMap[0].CompressionLevel);
                }

            // files
            using (var ms = new MemoryStream())
                using (var bw = new BinaryWriter(ms))
                {
                    foreach (var entry in Entries)
                    {
                        bw.Write(entry.EKey.Value);
                        bw.WriteUInt40BE(entry.FileSize);
                        bw.Write(entry.Priority);

                        if (Header.HasChecksum != 0)
                        {
                            bw.WriteUInt32BE(entry.Checksum);
                        }

                        if (Header.Version >= 2)
                        {
                            bw.Write((byte[])(object)entry.Flags);
                        }
                    }

                    entries[1] = ms.ToArray();
                    files[1]   = new CASFile(entries[1], EncodingMap[1].Type, EncodingMap[1].CompressionLevel);
                }

            // tags
            using (var ms = new MemoryStream())
                using (var bw = new BinaryWriter(ms))
                {
                    foreach (var tag in Tags)
                    {
                        bw.Write(Encoding.UTF8.GetBytes(tag.Name));
                        bw.Write((byte)0);
                        bw.WriteUInt16BE(tag.Type);
                        bw.Write(tag.BitMask.ToByteArray());
                        tag.BitMask.Clear();
                    }

                    entries[2] = ms.ToArray();
                    files[2]   = new CASFile(entries[2], EncodingMap[2].Type, EncodingMap[2].CompressionLevel);
                }

            // write
            CASResult res = DataHandler.Write(WriteMode.CDN, files);

            using (var md5 = MD5.Create())
                res.CEKey = new MD5Hash(md5.ComputeHash(entries.SelectMany(x => x).ToArray()));

            File.Delete(Path.Combine(CASContainer.Settings.OutputPath, CASContainer.BuildConfig["download"][0]));

            CASContainer.Logger.LogInformation($"Download: EKey: {res.EKey} CEKey: {res.CEKey}");
            CASContainer.BuildConfig.Set("download-size", res.DecompressedSize.ToString());
            CASContainer.BuildConfig.Set("download-size", (res.CompressedSize - 30).ToString(), 1);
            CASContainer.BuildConfig.Set("download", res.CEKey.ToString());
            CASContainer.BuildConfig.Set("download", res.EKey.ToString(), 1);

            Array.Resize(ref entries, 0);
            Array.Resize(ref files, 0);
            entries = null;
            files   = null;
            return(res);
        }
Esempio n. 14
0
        public static Int64 GetOrderGUID(int prescriptionID, Int64 orderReconcileGUID)
        {
            Int64 orderGUID = 0;

            try
            {
                IDataHandler dataHandler = new DataHandler();
                List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>();
                parameters.Add(new StoredProcedureParameter("@PrescriptionID", SqlDbType.Int, prescriptionID));
                parameters.Add(new StoredProcedureParameter("@OrderReconcileGUID", SqlDbType.BigInt, orderReconcileGUID));

                DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryOrderGUID_Sp", parameters);
                foreach (DataRow dataRow in dataTable.Rows)
                    orderGUID = Convert.ToInt64(dataRow["OrderGUID"]);
                dataTable.Dispose();
            }
            catch
            {
                throw;
            }

            return orderGUID;
        }
Esempio n. 15
0
 /// <summary>
 /// Stores the modifications in the database.
 /// </summary>
 protected override void Store(SecurityContext context)
 {
     DataHandler.DeleteUser(context, UserId);
 }
 public MainWindow()
 {
     InitializeComponent();
     handler = new DataHandler();
 }
Esempio n. 17
0
        public static void FromStream <TItemType>(Stream stream, DataHandler <TItemType> dataHandler,
                                                  ExceptionHandler exceptionHandler)
        {
            if (dataHandler == null)
            {
                throw new ArgumentNullException(nameof(dataHandler));
            }
            if (exceptionHandler == null)
            {
                throw new ArgumentNullException(nameof(exceptionHandler));
            }

            //BufferedStream bufferedStream = new BufferedStream(stream);
            var reader = new BinaryReader(stream);


            var items = reader.ReadInt32();

            for (var i = 0; i < items; i++)
            {
                var useProtocolBuffers = reader.ReadBoolean();
                var useCompression     = reader.ReadBoolean();
                var dataSize           = reader.ReadInt32();
                var data = reader.ReadBytes(dataSize);

                using (var memStream = new MemoryStream(data))
                {
                    try
                    {
                        var mode = SerializationMode.Json;
                        if (useProtocolBuffers)
                        {
                            mode = SerializationMode.ProtocolBuffers;
                        }

                        var    deserializationFailure = false;
                        object result;
                        try
                        {
                            result = SerializationHelper.ObjectFromStream <TItemType>(memStream, mode, useCompression);
                            dataHandler((TItemType)result, i + 1, items);
                        }
                        catch (Exception)
                        {
                            deserializationFailure = true;
                        }

                        if (deserializationFailure)
                        {
                            memStream.Seek(0, SeekOrigin.Begin);
                            result = SerializationHelper.ObjectFromStream <ExceptionResponse>(memStream, mode,
                                                                                              useCompression);

                            if (result != null)
                            {
                                exceptionHandler((ExceptionResponse)result);
                            }
                            else
                            {
                                var message = $"Received an unknown item type while expecting {typeof(TItemType)}";
                                throw new StreamingException(message);
                            }
                        }
                    }
                    catch (IOException ex)
                    {
                        var exResponse = new ExceptionResponse(ex);
                        exceptionHandler(exResponse);
                    }
                    catch (SerializationException ex)
                    {
                        var exResponse = new ExceptionResponse(ex);
                        exceptionHandler(exResponse);
                    }
                }
            }
        }
Esempio n. 18
0
        public virtual DataTable GetAll()
        {
            string sql = "SELECT * FROM " + TableName;

            return(DataHandler.GetDataTable(sql));
        }
Esempio n. 19
0
 /// <summary>
 /// Sets the specified hander function to handle data for the handler's symbol
 /// </summary>
 /// <param name="handler">The handler to use when this symbol's data is encountered</param>
 /// <returns>An identifier that can be used to remove this handler</returns>
 public void SetDataHandler(DataHandler handler)
 {
     _dataHandlers[handler.Symbol] = handler;
 }
Esempio n. 20
0
    //  [DirectMethod]
    // public void FillData()
    protected void wdWindow_BeforeShow(object sender, DirectEventArgs e)
    {
        try
        {
            string    strMau = "Mẫu: 001/" + DateTime.Now.Year + "/";
            DataTable table  = DataHandler.GetInstance().ExecuteDataTable("SystemConfig_GetConfigByMaDonVi", "@MaDonVi", Session["MaDonVi"].ToString());
            foreach (DataRow item in table.Rows)
            {
                switch (item["VAR_NAME"].ToString())
                {
                case SystemConfigParameter.EMAIL:
                    txtSystemMail.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.PASSWORD_EMAIL:
                    txtPassword.Text        = item["VAR_VALUE"].ToString();
                    txtConfirmPassword.Text = txtPassword.Text;
                    break;

                case SystemConfigParameter.MENU_TYPE:
                    cbMenuType.SetValue(item["VAR_VALUE"].ToString());
                    break;

                case SystemConfigParameter.COMPANY_NAME:
                    //if (string.IsNullOrEmpty(item["VAR_VALUE"].ToString()))
                    //{
                    //    txtCompanyName.Text = new DM_DONVIController().GetById(Session["MaDonVi"].ToString()).TEN_DONVI;
                    //}
                    //else
                    //{
                    txtCompanyName.Text = item["VAR_VALUE"].ToString();
                    //  }
                    break;

                case SystemConfigParameter.COMPANY_ADDRESS:
                    txt_DiaChi.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.COMPANY_MASOTHUE:
                    txt_MaSoThue.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.COMPANY_DIENTHOAI:
                    txt_DienThoai.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.COMPANY_FAX:
                    txt_Fax.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.COMPANY_EMAIL:
                    txt_Email.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.CITY:
                    txtCity.Text = item["VAR_VALUE"].ToString();
                    break;

                //case SystemConfigParameter.LUONG_CB:
                //    txtLuongCB.SetValue(item["VAR_VALUE"].ToString());
                //    break;
                case SystemConfigParameter.PREFIX:
                    txtTienTo.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.NUMBER_OF_CHARACTER:
                    txtSoLuong.Text = item["VAR_VALUE"].ToString();
                    break;

                //case SystemConfigParameter.CONG_CHUAN:
                //    txtSoNgayCongChuan.Text = item["VAR_VALUE"].ToString();
                //    break;
                // tab sinh mã, số quyết định
                case SystemConfigParameter.SUFFIX_SOHOPDONG:
                    txtSoHopDong.Text = item["VAR_VALUE"].ToString();
                    txtSoHopDong.Note = strMau + item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.SUFFIX_SOQDLUONG:
                    txtSoQuyetDinhLuong.Text = item["VAR_VALUE"].ToString();
                    txtSoQuyetDinhLuong.Note = strMau + item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.SUFFIX_SOQDKHENTHUONG:
                    txtSoQDKhenThuong.Text = item["VAR_VALUE"].ToString();
                    txtSoQDKhenThuong.Note = strMau + item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.SUFFIX_SOQDKYLUAT:
                    txtSoQDKyLuat.Text = item["VAR_VALUE"].ToString();
                    txtSoQDKyLuat.Note = strMau + item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.SUFFIX_SOQDCONGTAC:
                    txtSoQDCongTac.Text = item["VAR_VALUE"].ToString();
                    txtSoQDCongTac.Note = strMau + item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.SUFFIX_SOQDDIEUCHUYEN:
                    txtSoQĐieuChuyen.Text = item["VAR_VALUE"].ToString();
                    txtSoQĐieuChuyen.Note = strMau + item["VAR_VALUE"].ToString();
                    break;

                // tab sinh người ký báo cáo
                case SystemConfigParameter.SuDungTenDangNhap:
                    // chknguoidangnhap.SetValue(Boolean.Parse(item["VAR_VALUE"].ToString()));
                    chknguoidangnhap.Checked = Boolean.Parse(item["VAR_VALUE"].ToString());
                    break;

                case SystemConfigParameter.chuky1:
                    txtnguoiky1.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.chuky2:
                    txtnguoiky2.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.chuky3:
                    txtnguoiky3.Text = item["VAR_VALUE"].ToString();
                    break;

                case SystemConfigParameter.chuky4:
                    txtnguoiky4.Text = item["VAR_VALUE"].ToString();
                    break;
                }
            }
            if (string.IsNullOrEmpty(txtCompanyName.Text.Trim()))
            {
                DM_DONVI dv = new DM_DONVIController().GetById(Session["MaDonVi"].ToString());
                txtCompanyName.Text = dv.TEN_DONVI;
            }
        }
        catch (Exception ex)
        {
            X.MessageBox.Alert("Thông báo", ex.Message).Show();
        }
    }
Esempio n. 21
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     DataHandler.UpdateDB("Client");
 }
Esempio n. 22
0
 public static extern CURLcode SetOpt(SafeEasyHandle handle, CURLoption option, DataHandler value);
Esempio n. 23
0
 public CustomRedirect(string oldUrl, string newUrl)
 {
     _oldUrl = oldUrl;
     _newUrl = newUrl;
     SiteId  = DataHandler.GetSiteIdFromUrl(oldUrl);
 }
Esempio n. 24
0
 public DAOConnector()
 {
     dataHandler = new DataHandler();
 }
Esempio n. 25
0
        public async Task <IActionResult> Auth([FromBody] LoginViewModel viewModel)
        {
            var query = new UserByEmail {
                Email = viewModel.Email
            };
            await DataHandler.Execute(query);

            if (query.Result != null && query.Result.IsActive &&
                (query.ResultTenant == null || query.ResultTenant.IsActive))
            {
                if (query.Result.EncryptedPwd.Equals(EncryptHelper.Encrypt(viewModel.Pwd)))
                {
                    if (query.ResultConfig.IsTwoFactor)
                    {
                        query.ResultConfig.TwoFactorAuth     = Convert.ToString(EncryptHelper.Randomizer(100000, 999999));
                        query.ResultConfig.IsTwoFactorActive = true;

                        var persist = new Persist <UserConfig>()
                        {
                            Model = query.ResultConfig
                        };
                        await DataHandler.Execute(persist);

                        if (persist.Confirm.Success)
                        {
                            await DataHandler.Commit();
                        }

                        var notify = new SimpleNotify
                        {
                            CloudHandler = CloudHandler,
                            DataHandler  = DataHandler,
                            CurrentUser  = query.Result,
                            LogicHandler = LogicHandler,
                            Model        = persist.Model,
                            TemplateName = "twofactor"
                        };
                        await LogicHandler.Execute(notify);

                        return(Ok(new AuthViewModel()
                        {
                            Id = query.Result.Id, IsTwoFactor = true
                        }));
                    }
                    else
                    {
                        var logic = new SigninAuth
                        {
                            Login    = query.Result,
                            Config   = query.ResultConfig,
                            Tenant   = query.ResultTenant,
                            Settings = CloudHandler.Settings
                        };
                        await LogicHandler.Execute(logic);

                        return(Ok(logic.Result));
                    }
                }
            }

            return(Ok(new FailViewModel {
                Message = "Login failed"
            }));
        }
 public EmployeeController(DataHandler dataHandler)
 {
     _dataHandler = dataHandler;
 }
Esempio n. 27
0
 public DOUbigeo()
 {
     _dbProviderFactory = new DataFactory();
     _dataHandler       = new DataHandler();
 }
Esempio n. 28
0
 public EntityDefine AddEntityType <T>(DataHandler dataHandler)
 {
     return(AddEntityType(typeof(T), dataHandler));
 }
Esempio n. 29
0
    public void BindData(ReportFilter filter)
    {
        DataTable table = new DataTable();

        xrl_ngayBC.Text    = "Tháng " + filter.StartMonth + " năm " + filter.Year;
        table              = DataHandler.GetInstance().ExecuteDataTable("sp_DanhSachNhanVienDieuChuyenTrongThang", "@MaBoPhan", "@Gender", "@TinhTrang", "@MinSeniority", "@MaxSeniority", "@Month", "@Year", "@WhereClause", filter.SelectedDepartment, filter.Gender, filter.WorkingStatus, filter.MinSeniority, filter.MaxSeniority, filter.StartMonth, filter.Year, filter.WhereClause);
        xrl_TenCongTy.Text = ReportController.GetInstance().GetCompanyName(filter.SessionDepartment);
        //xrl_ThanhPho.Text = ReportController.GetInstance().GetCityName(filter.SessionDepartment);

        xrtngayketxuat.Text = ReportController.GetInstance().GetFooterReport(filter.SessionDepartment, filter.ReportedDate);
        xr_chinhanh.Text    = ReportController.GetInstance().GetCompanyAddress(filter.SessionDepartment);
        xrl_TenCongTy.Text  = ReportController.GetInstance().GetCompanyName(filter.SessionDepartment);
        DataSource          = table;
        xrtmanhanvien.DataBindings.Add("Text", DataSource, "MA_CB");
        xrthoten.DataBindings.Add("Text", DataSource, "HO_TEN");
        xrtngaysinh.DataBindings.Add("Text", DataSource, "NGAY_SINH", "{0:dd/MM/yyyy}");
        xrtgioitinh.DataBindings.Add("Text", DataSource, "TEN_GIOITINH");
        xrt_tenbophanmoi.DataBindings.Add("Text", DataSource, "TenBoPhanMoi");
        xrt_bophancu.DataBindings.Add("Text", DataSource, "TenBoPhanCu");
        xrt_soquyetdinh.DataBindings.Add("Text", DataSource, "SoQuyetDinh");
        xrt_ngayhieuluc.DataBindings.Add("Text", DataSource, "NgayCoHieuLuc", "{0:dd/MM/yyyy}");
        xrt_ngayhethieuluc.DataBindings.Add("Text", DataSource, "NgayHetHieuLuc", "{0:dd/MM/yyyy}");
        this.GroupHeader1.GroupFields.AddRange(new DevExpress.XtraReports.UI.GroupField[] {
            new DevExpress.XtraReports.UI.GroupField("MA_DONVI", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending)
        });
        xrl_tenphong.DataBindings.Add("Text", DataSource, "TEN_PHONG");
        ReportController rpCtr = new ReportController();

        if (!string.IsNullOrEmpty(filter.Title1))
        {
            xrl_footer1.Text = filter.Title1;
        }
        else
        {
            xrl_footer1.Text = rpCtr.GetTitleOfSignature(xrl_footer1.Text, filter.Title1);
        }
        if (!string.IsNullOrEmpty(filter.Title2))
        {
            xrl_footer2.Text = filter.Title2;
        }
        else
        {
            xrl_footer2.Text = rpCtr.GetTitleOfSignature(xrl_footer2.Text, filter.Title2);
        }
        if (!string.IsNullOrEmpty(filter.Title3))
        {
            xrl_footer3.Text = filter.Title3;
        }
        else
        {
            xrl_footer3.Text = rpCtr.GetTitleOfSignature(xrl_footer3.Text, filter.Title3);
        }
        if (!string.IsNullOrEmpty(filter.Name1))
        {
            xrl_ten1.Text = filter.Name1;
        }
        else
        {
            xrl_ten1.Text = rpCtr.GetCreatedReporterName(filter.SessionDepartment, filter.Reporter);
        }
        if (!string.IsNullOrEmpty(filter.Name2))
        {
            xrl_ten2.Text = filter.Name2;
        }
        else
        {
            xrl_ten2.Text = rpCtr.GetHeadOfHRroom(filter.SessionDepartment, filter.Name2);
        }
        if (!string.IsNullOrEmpty(filter.Name3))
        {
            xrl_ten3.Text = filter.Name3;
        }
        else
        {
            xrl_ten3.Text = rpCtr.GetDirectorName(filter.SessionDepartment, filter.Name3);
        }
        //tieu de
        if (!string.IsNullOrEmpty(filter.ReportTitle))
        {
            xrl_TitleBC.Text = filter.ReportTitle;
        }
    }
Esempio n. 30
0
 public ColumnHeaderCellText(DataHandler data_handler)
     : base(null, true)
 {
     UseMarkup = true;
     this.data_handler = data_handler;
 }
Esempio n. 31
0
 public SystemAdmin()
 {
     data = DataHandler.Instance;
 }
Esempio n. 32
0
 public Register()
 {
     InitializeComponent();
     dh = new DataHandler();
     proxy = new LoginClient();
 }
Esempio n. 33
0
 public DataService(DataHandler handler)
 {
     this.itsDataHandler = handler;
 }
Esempio n. 34
0
        public void EF6_LoadActivities_AtStart_DataHandlerLevel()
        {
            var sctx         = CurrentContext.Security;
            var user1Id      = TestUser.User1.Id;
            var rootEntityId = Id("E01");

            // create 30 activities
            sctx.CreateSecurityEntity(rootEntityId, default(int), user1Id);
            for (int entityId = rootEntityId + 1; entityId < rootEntityId + 31; entityId++)
            {
                sctx.CreateSecurityEntity(entityId, rootEntityId, user1Id);
            }

            var lastId = Db().ExecuteTestScript <int>("select top 1 Id from [EFMessages] order by Id desc").First();


            // test0: initial
            var expectedCs0 = new CompletionState {
                LastActivityId = lastId
            };
            var cs0 = DataHandler.LoadCompletionState(sctx.DataProvider, out var dbId0);

            Assert.AreEqual(lastId, dbId0);
            Assert.AreEqual(expectedCs0.ToString(), cs0.ToString());


            // test1: create unprocessed activities: set "wait" on 4 continuous activity (except last) + 2 gaps before
            Db().ExecuteTestScript(@"declare @last int
                select top 1 @last = Id from [EFMessages] order by Id desc
                UPDATE EFMessages set ExecutionState = 'Executing'
                    where Id in (@last-1, @last-2, @last-3, @last-4, @last-6, @last-9)
                ");

            var expectedCs1 = new CompletionState
            {
                LastActivityId = lastId,
                Gaps           = new[] { lastId - 9, lastId - 6, lastId - 4, lastId - 3, lastId - 2, lastId - 1 }
            };
            var cs1 = DataHandler.LoadCompletionState(sctx.DataProvider, out var dbId1);

            Assert.AreEqual(dbId1, lastId);
            Assert.AreEqual(expectedCs1.ToString(), cs1.ToString());


            // test2: create unprocessed activities: set "wait" on last 5 continuous activity (except last) + 2 gaps before
            Db().ExecuteTestScript(@"declare @last int
                select top 1 @last = Id from [EFMessages] order by Id desc
                UPDATE EFMessages set ExecutionState = 'Executing'
                    where Id in (@last)
                ");

            var expectedCs2 = new CompletionState
            {
                LastActivityId = lastId - 5,
                Gaps           = new[] { lastId - 9, lastId - 6 }
            };
            var cs2 = DataHandler.LoadCompletionState(sctx.DataProvider, out var dbId2);

            Assert.AreEqual(dbId2, lastId);
            Assert.AreEqual(expectedCs2.ToString(), cs2.ToString());
        }
Esempio n. 35
0
        public void EF6_LoadActivities_AtStart_ActivityQueueLevel()
        {
            var sctx         = CurrentContext.Security;
            var user1Id      = TestUser.User1.Id;
            var rootEntityId = Id("E01");

            // create 30 activities
            sctx.CreateSecurityEntity(rootEntityId, default(int), user1Id);
            for (int entityId = rootEntityId + 1; entityId < rootEntityId + 31; entityId++)
            {
                sctx.CreateSecurityEntity(entityId, rootEntityId, user1Id);
            }

            var lastId = Db().ExecuteTestScript <int>("select top 1 Id from [EFMessages] order by Id desc").First();


            // test0: initial state
            var expectedCs = new CompletionState {
                LastActivityId = lastId
            };
            var uncompleted = DataHandler.LoadCompletionState(SecurityContext.General.DataProvider, out var lastActivityIdFromDb);

            SecurityActivityQueue.Startup(uncompleted, lastActivityIdFromDb);
            var cs0 = SecurityActivityQueue.GetCurrentState().Termination;

            Assert.AreEqual(expectedCs.ToString(), cs0.ToString());


            // test1: create some unprocessed activities: 4 continuous activity (except last) + 2 gaps before
            //        last-2 and last-6 "Wait", the others "Executing" by another appdomain.
            Db().ExecuteTestScript(@"declare @last int
                select top 1 @last = Id from [EFMessages] order by Id desc
                UPDATE EFMessages set ExecutionState = 'Executing', LockedBy = 'AnotherComputer'
                    where Id in (@last-1, @last-3, @last-4, @last-9)
                UPDATE EFMessages set ExecutionState = 'Wait', LockedBy = null, LockedAt = null
                    where Id in (@last-2, @last-6)
                ");

            var expectedIsFromDb1 = String.Join(", ", new[] { lastId - 9, lastId - 4, lastId - 3, lastId - 1, lastId });

            uncompleted = DataHandler.LoadCompletionState(SecurityContext.General.DataProvider, out lastActivityIdFromDb);
            SecurityActivityQueue.Startup(uncompleted, lastActivityIdFromDb);
            var cs1        = SecurityActivityQueue.GetCurrentState().Termination;
            var idsFromDb1 = String.Join(", ", Db().GetUnprocessedActivityIds());

            Assert.AreEqual(expectedCs.ToString(), cs1.ToString());
            Assert.AreEqual(expectedIsFromDb1, idsFromDb1);

            // test2: create unprocessed activities: last 5 continuous activity + 2 gaps before
            //        last-2 and last-6 "Wait", the others "Executing" by another appdomain.
            Db().ExecuteTestScript(@"declare @last int
                select top 1 @last = Id from [EFMessages] order by Id desc
                UPDATE EFMessages set ExecutionState = 'Executing', LockedBy = 'AnotherComputer'
                    where Id in (@last, @last-1, @last-3, @last-4, @last-9)
                UPDATE EFMessages set ExecutionState = 'Wait', LockedBy = null, LockedAt = null
                    where Id in (@last-2, @last-6)
                ");

            var expectedIsFromDb2 = String.Join(", ", new[] { lastId - 9, lastId - 4, lastId - 3, lastId - 1, lastId, lastId });

            uncompleted = DataHandler.LoadCompletionState(SecurityContext.General.DataProvider, out lastActivityIdFromDb);
            SecurityActivityQueue.Startup(uncompleted, lastActivityIdFromDb);
            var cs2        = SecurityActivityQueue.GetCurrentState().Termination;
            var idsFromDb2 = String.Join(", ", Db().GetUnprocessedActivityIds());

            Assert.AreEqual(expectedCs.ToString(), cs2.ToString());
            Assert.AreEqual(expectedIsFromDb2, idsFromDb2);
        }
 public Login()
 {
     InitializeComponent();
     this.dataHandler = new DataHandler();
     nEmpregado.Focus();
 }
Esempio n. 37
0
        public void EF6_LoadActivities_SmartGapResolution()
        {
            var sb = new StringBuilder();

            CommunicationMonitor.Stop();
            var sctx         = CurrentContext.Security;
            var user1Id      = TestUser.User1.Id;
            var rootEntityId = Id("E01");

            // create some activities with gap
            sctx.CreateSecurityEntity(rootEntityId, default(int), user1Id);
            for (int entityId = rootEntityId + 1; entityId < rootEntityId + 11; entityId++)
            {
                sctx.CreateSecurityEntity(entityId, rootEntityId, user1Id);
                Db().ExecuteTestScript(@"
                    -- 2 gap
                    INSERT INTO EFMessages ([SavedBy], [SavedAt], [ExecutionState]) VALUES ('asdf1', GETDATE(),'Wait')
                    INSERT INTO EFMessages ([SavedBy], [SavedAt], [ExecutionState]) VALUES ('qwer1', GETDATE(),'Wait')
                    DELETE EFMessages WHERE Id in (select top 2 Id from [EFMessages] order by Id desc)");
            }

            // these are be unprocessed
            Db().ExecuteTestScript("UPDATE EFMessages set ExecutionState = 'Wait', LockedBy = null, LockedAt = null");

            sb.Clear();
            var uncompleted = DataHandler.LoadCompletionState(SecurityContext.General.DataProvider, out var lastActivityIdFromDb);

            SecurityActivityQueue.Startup(uncompleted, lastActivityIdFromDb);

            var cs1 = SecurityActivityQueue.GetCurrentCompletionState();

            // expectation: there is no any gap.
            Assert.AreEqual(0, cs1.Gaps.Length);

            // create a gap
            Db().ExecuteTestScript(@"
                    -- 2 gap
                    INSERT INTO EFMessages ([SavedBy], [SavedAt], [ExecutionState]) VALUES ('asdf1', GETDATE(),'Wait')
                    INSERT INTO EFMessages ([SavedBy], [SavedAt], [ExecutionState]) VALUES ('qwer1', GETDATE(),'Wait')
                    DELETE EFMessages WHERE Id in (select top 2 Id from [EFMessages] order by Id desc)
                    -- copy last
                    INSERT INTO EFMessages([SavedBy],[SavedAt],[ExecutionState],[LockedBy],[LockedAt],[Body])
                         SELECT TOP 1 [SavedBy],GETDATE(),[ExecutionState],[LockedBy],[LockedAt],[Body] FROM EFMessages ORDER BY Id DESC
                    -- 2 gap
                    INSERT INTO EFMessages ([SavedBy], [SavedAt], [ExecutionState]) VALUES ('asdf2', GETDATE(),'Wait')
                    INSERT INTO EFMessages ([SavedBy], [SavedAt], [ExecutionState]) VALUES ('qwer2', GETDATE(),'Wait')
                    DELETE EFMessages WHERE Id in (select top 2 Id from [EFMessages] order by Id desc)");

            // last activity
            sctx.CreateSecurityEntity(101, rootEntityId, user1Id);

            var cs2 = SecurityActivityQueue.GetCurrentCompletionState();

            Assert.AreEqual(4, cs2.Gaps.Length);
            Assert.AreEqual(cs1.LastActivityId + 6, cs2.LastActivityId);

            SecurityActivityQueue.HealthCheck();

            var cs3 = SecurityActivityQueue.GetCurrentCompletionState();

            Assert.AreEqual(0, cs3.Gaps.Length);
            Assert.AreEqual(cs2.LastActivityId, cs3.LastActivityId);

            CommunicationMonitor.Start();
        }
Esempio n. 38
0
        public override async Task Execute()
        {
            var regionKey = "GLA";
            var tenant    = new Tenant()
            {
                Name       = Input.TenantName, TenantName = Input.TenantName, EntryKey = StringHelper.GenerateCode(16),
                AuthorName = Input.Name, RegionKey = regionKey
            };
            var isNew = true;

            if (string.IsNullOrEmpty(Input.TenantId))
            {
                var persistClient = new Persist <Tenant>()
                {
                    Model = tenant
                };
                await DataHandler.Execute(persistClient);

                tenant = persistClient.Model;
            }
            else
            {
                var loaderClient = new Loader <Tenant>()
                {
                    Id = Input.TenantId
                };
                await DataHandler.Execute(loaderClient);

                tenant = loaderClient.Result;
                isNew  = false;
            }

            if (tenant != null && !string.IsNullOrEmpty(tenant.Id))
            {
                var user = new User()
                {
                    TenantId     = tenant.Id, TenantName = Input.TenantName, Name = Input.Name, Email = Input.Email,
                    EncryptedPwd = EncryptHelper.Encrypt(Input.Pwd), AuthorName = Input.Name,
                    Right        = new UserRight()
                    {
                        CanAuth = isNew, CanAdmin = isNew, CanSuperuser = false
                    },
                    RegionKey = regionKey
                };

                var persistUser = new UserSave {
                    Model = user
                };
                await DataHandler.Execute(persistUser);

                if (persistUser.Confirm.Success)
                {
                    if (isNew)
                    {
                        tenant.AuthorId = persistUser.Model.Id;
                        tenant.TenantId = tenant.Id;

                        var persistClient = new Persist <Tenant>()
                        {
                            Model = tenant
                        };
                        await DataHandler.Execute(persistClient);

                        tenant = persistClient.Model;

                        var meetingType = new MeetingType()
                        {
                            TenantId = tenant.Id, TenantName = tenant.Name, Name = "Standard", IsRecur = false,
                            Pretext  = "Standard Meeting Type", RegionKey = regionKey, Prename = "Meeting",
                            AuthorId = persistUser.Model.Id, AuthorName = persistUser.Model.Name
                        };
                        var persistType = new Persist <MeetingType>()
                        {
                            Model = meetingType
                        };
                        await DataHandler.Execute(persistType);
                    }

                    persistUser.Model.AuthorId = persistUser.Model.Id;
                    await DataHandler.Execute(persistUser);

                    await DataHandler.Commit();

                    var signin = new SigninAuth()
                    {
                        Tenant      = tenant, Login = persistUser.Model, LogicHandler = LogicHandler,
                        DataHandler = DataHandler, Config = persistUser.ResultConfig, Settings = CloudHandler.Settings
                    };
                    await LogicHandler.Execute(signin);

                    ResultAuth = signin.Result;

                    Result = ActionConfirm.CreateSuccess(persistUser.Model);

                    var notify = new SimpleNotify
                    {
                        CloudHandler = CloudHandler, DataHandler = DataHandler, CurrentUser = persistUser.Model,
                        LogicHandler = LogicHandler, Model = persistUser.Model,
                        TemplateName = isNew ? "welcomeclient" : "welcomeuser"
                    };
                    await LogicHandler.Execute(notify);
                }
                else
                {
                    Result = ActionConfirm.CreateFailure(persistUser.Confirm.Message);
                }
            }
            else
            {
                Result = ActionConfirm.CreateFailure("Error connecting organisation");
            }
        }
Esempio n. 39
0
        public static bool ExtractSystemFiles(string savepath)
        {
            if (Directory.Exists(savepath))
            {
                Directory.Delete(savepath, true);
            }
            Directory.CreateDirectory(savepath);

            Logger.LogInformation("Extracting System Files");

            OpenLocalIndices();

            // .build.info
            if (File.Exists(Path.Combine(BasePath, ".build.info")))
            {
                File.Copy(Path.Combine(BasePath, ".build.info"), Path.Combine(savepath, ".build.info"), true);
            }

            // Build Config
            string buildKey          = BuildInfo["Build Key"];
            string buildCfgLocalPath = Path.Combine(BasePath, "Data", "config", buildKey.Substring(0, 2), buildKey.Substring(2, 2), buildKey);

            if (File.Exists(buildCfgLocalPath))
            {
                File.Copy(buildCfgLocalPath, Path.Combine(savepath, buildKey), true);
            }
            else
            {
                Logger.LogCritical("Build Config missing.");
                return(false);
            }

            // CDN Config
            string cdnKey          = BuildInfo["CDN Key"];
            string cdnCfgLocalPath = Path.Combine(BasePath, "Data", "config", cdnKey.Substring(0, 2), cdnKey.Substring(2, 2), cdnKey);

            if (File.Exists(cdnCfgLocalPath))
            {
                File.Copy(cdnCfgLocalPath, Path.Combine(savepath, cdnKey), true);
            }
            else
            {
                Logger.LogCritical("CDN Config missing.");
                return(false);
            }


            string path;

            // Encoding File
            LocalIndexEntry idxInfo = LocalIndexHandler?.GetIndexInfo(BuildConfig.GetKey("encoding"));

            if (idxInfo != null)
            {
                path = Path.Combine(BasePath, "Data", "data", string.Format("data.{0:D3}", idxInfo.Archive));
                DataHandler.Extract(path, Path.Combine(savepath, BuildConfig.GetKey("encoding").ToString()), idxInfo);
                OpenEncoding();
            }
            else
            {
                Logger.LogCritical("Encoding file missing.");
                return(false);
            }

            // Root File
            var rootkey = BuildConfig.GetKey("root");

            if (EncodingHandler.CEKeys.TryGetValue(rootkey, out EncodingCEKeyPageTable enc))
            {
                idxInfo = LocalIndexHandler?.GetIndexInfo(enc.EKeys[0]);
                if (idxInfo != null)
                {
                    path = Path.Combine(BasePath, "Data", "data", string.Format("data.{0:D3}", idxInfo.Archive));
                    DataHandler.Extract(path, Path.Combine(savepath, enc.EKeys[0].ToString()), idxInfo);
                }
                else
                {
                    Logger.LogCritical("Root file missing.");
                    return(false);
                }
            }

            // Install File
            var installkey = BuildConfig.GetKey("install");

            if (EncodingHandler.CEKeys.TryGetValue(installkey, out enc))
            {
                idxInfo = LocalIndexHandler?.GetIndexInfo(enc.EKeys[0]);
                if (idxInfo != null)
                {
                    path = Path.Combine(BasePath, "Data", "data", string.Format("data.{0:D3}", idxInfo.Archive));
                    DataHandler.Extract(path, Path.Combine(savepath, enc.EKeys[0].ToString()), idxInfo);
                }
                else
                {
                    Logger.LogCritical("Install file missing.");
                    return(false);
                }
            }

            // Download File
            var downloadkey = BuildConfig.GetKey("download");

            if (EncodingHandler.CEKeys.TryGetValue(downloadkey, out enc))
            {
                idxInfo = LocalIndexHandler?.GetIndexInfo(enc.EKeys[0]);
                if (idxInfo != null)
                {
                    path = Path.Combine(BasePath, "Data", "data", string.Format("data.{0:D3}", idxInfo.Archive));
                    DataHandler.Extract(path, Path.Combine(savepath, enc.EKeys[0].ToString()), idxInfo);
                }
                else
                {
                    Logger.LogCritical("Download file missing.");
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 40
0
 public async Task Save()
 {
     await DataHandler.Save(this);
 }
 /// <summary>
 /// Stores the modifications in the database.
 /// </summary>
 protected override void Store(SecurityContext context)
 {
     DataHandler.CreateSecurityEntity(context, this.EntityId, this.ParentEntityId, this.OwnerId);
 }
Esempio n. 42
0
 public RandomWalk(DataHandler handler)
 {
     this.handler = handler;
 }
 /// <summary>
 /// Stores the modifications in the database.
 /// </summary>
 protected override void Store(SecurityContext context)
 {
     DataHandler.RemoveMembers(context, GroupId, UserMembers, GroupMembers, ParentGroups);
 }
Esempio n. 44
0
 public EntityDefine AddEntityType(Type type, DataHandler dataHandler)
 {
     return(AddEntityType(type, dataHandler, null));
 }
Esempio n. 45
0
 public void SetData(DataHandler handler)
 {
     this.itsDataHandler = handler;
 }
Esempio n. 46
0
 public ColumnHeaderCellText(DataHandler data_handler) : base(null, true)
 {
     UseMarkup         = true;
     this.data_handler = data_handler;
 }
Esempio n. 47
-1
        public static PatientHeaderModel GetPatientHeaderModel(Int64 clientVisitGUID, Int64 clientGUID, Int64 chartGUID)
        {
            PatientHeaderModel patientHeaderModel = new PatientHeaderModel();

            try
            {
                IDataHandler dataHandler = new DataHandler();
                List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>();
                parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.BigInt, clientVisitGUID));
                parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.BigInt, clientGUID));
                parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.BigInt, chartGUID));

                DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_PatientHeaderInformation_Sp", parameters);
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    patientHeaderModel.PatientName = dataRow["ClientDisplayName"].ToString();
                    patientHeaderModel.CurrentLocation = dataRow["CurrentLocation"].ToString();
                    patientHeaderModel.HeightWeight = dataRow["Height"].ToString();
                    patientHeaderModel.AdmissionDateTime = dataRow["AdmitDtm"].ToString();
                    patientHeaderModel.ProviderName = dataRow["ProviderDisplayName"].ToString();
                    patientHeaderModel.MedicalRecordNumber = dataRow["MRN"].ToString();
                    patientHeaderModel.PatientAge = dataRow["Age"].ToString();
                    patientHeaderModel.Gender = dataRow["GenderCode"].ToString();
                }
                dataTable.Dispose();
            }
            catch
            {
                throw;
            }

            return patientHeaderModel;
        }
Esempio n. 48
-1
    protected void submit_Click(object sender, EventArgs e)
    {
        DataHandler dh = new DataHandler();
        dh.InsertEventContact(contactname.Text, email.Text, telephone.Text, timetocall.SelectedItem.ToString(), eventname.Text,
            eventdate.Text, region.SelectedItem.ToString(), details.Text, publicize.Checked.ToString());

        ResetForm();
    }
Esempio n. 49
-1
    void Awake()
    {
        // Load last profile if played before.

        //Initialize
        myData = new DataHandler();
        DontDestroyOnLoad(gameObject); // This gameobject.
    }
Esempio n. 50
-1
        public static BindingList<PatientMedicationModel> GetPatientMedicationCollection(string type, Int64 clientVisitGUID, Int64 clientGUID, Int64 chartGUID)
        {
            BindingList<PatientMedicationModel> patientMedicationCollection = new BindingList<PatientMedicationModel>();

            try
            {
                IDataHandler dataHandler = new DataHandler();
                List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>();
                parameters.Add(new StoredProcedureParameter("@PopulateType", SqlDbType.BigInt, type));
                parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.BigInt, clientVisitGUID));
                parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.BigInt, clientGUID));
                parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.BigInt, chartGUID));

                DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryPopulate_Sp", parameters);
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    PatientMedicationModel model = new PatientMedicationModel() { 
                        IsNewRecord = Convert.ToBoolean(dataRow["IsNewRecord"]), 
                        HomeMedicationSummaryID = (dataRow["HomeMedSummaryID"] != DBNull.Value ? Convert.ToInt32(dataRow["HomeMedSummaryID"]) : 0), 
                        OrderReconcileGUID = Convert.ToInt64(dataRow["OrderReconcileGUID"]),
                        OrderReconcileDetailGUID = Convert.ToInt64(dataRow["OrderReconcileDtlGUID"]), 
                        PrescriptionStatus = dataRow["PrescriptionStatus"].ToString(), 
                        PrescriptionID = Convert.ToInt32(dataRow["PrescriptionID"]), 
                        DrugName = dataRow["DrugName"].ToString(),
                        Instructions = dataRow["Instructions"].ToString(),
                        AlsoKnownAs = dataRow["AlsoKnownAs"].ToString(),
                        Medication = dataRow["Medication"].ToString(), 
                        ReasonForTaking = dataRow["ReasonForTaking"].ToString(),
                        DosesTakenToday = dataRow["DosesTakenToday"].ToString(),
                        NextDose = dataRow["NextDose"].ToString(),
                        Comments = dataRow["Comments"].ToString()
                    };
                    patientMedicationCollection.Add(model);
                }
                dataTable.Dispose();
            }
            catch
            {
                throw;
            }

            return patientMedicationCollection;
        }
Esempio n. 51
-1
        public static void SetPatientMedicationCollection(BindingList<PatientMedicationModel> patientMedicationCollection, Int64 clientVisitGUID, Int64 clientGUID, Int64 chartGUID, Int64 userGUID)
        {
            try
            {
                IDataHandler dataHandler = new DataHandler();
                List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>();

                foreach (PatientMedicationModel patientMedicationModel in patientMedicationCollection)
                {
                    parameters = new List<StoredProcedureParameter>();
                    parameters.Add(new StoredProcedureParameter("@SaveDtm", SqlDbType.DateTime, DateTime.Now));
                    parameters.Add(new StoredProcedureParameter("@HomeMedSummaryID", SqlDbType.Int, patientMedicationModel.HomeMedicationSummaryID));
                    parameters.Add(new StoredProcedureParameter("@UserGUID", SqlDbType.Decimal, userGUID));
                    parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.Decimal, clientVisitGUID));
                    parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.Decimal, clientGUID));
                    parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.Decimal, chartGUID));
                    parameters.Add(new StoredProcedureParameter("@OrderReconcileGUID", SqlDbType.Decimal, patientMedicationModel.OrderReconcileGUID));
                    parameters.Add(new StoredProcedureParameter("@OrderReconcileDtlGUID", SqlDbType.Decimal, patientMedicationModel.OrderReconcileDetailGUID));
                    parameters.Add(new StoredProcedureParameter("@PrescriptionStatus", SqlDbType.VarChar, patientMedicationModel.PrescriptionStatus));
                    parameters.Add(new StoredProcedureParameter("@PrescriptionID", SqlDbType.Int, patientMedicationModel.PrescriptionID));
                    parameters.Add(new StoredProcedureParameter("@DrugName", SqlDbType.VarChar, patientMedicationModel.DrugName));
                    parameters.Add(new StoredProcedureParameter("@Instructions", SqlDbType.VarChar, patientMedicationModel.Instructions));
                    parameters.Add(new StoredProcedureParameter("@AlsoKnownAs", SqlDbType.VarChar, patientMedicationModel.AlsoKnownAs));
                    parameters.Add(new StoredProcedureParameter("@Medication", SqlDbType.VarChar, patientMedicationModel.Medication));
                    parameters.Add(new StoredProcedureParameter("@ReasonForTaking", SqlDbType.VarChar, patientMedicationModel.ReasonForTaking));
                    parameters.Add(new StoredProcedureParameter("@DosesTakenToday", SqlDbType.VarChar, patientMedicationModel.DosesTakenToday));
                    parameters.Add(new StoredProcedureParameter("@NextDose", SqlDbType.VarChar, patientMedicationModel.NextDose));
                    parameters.Add(new StoredProcedureParameter("@Comments", SqlDbType.VarChar, patientMedicationModel.Comments));
                    DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummarySave_Sp", parameters);
                    dataTable.Dispose();
                }

                parameters = new List<StoredProcedureParameter>();
                parameters.Add(new StoredProcedureParameter("@SaveDtm", SqlDbType.DateTime, DateTime.Now));
                parameters.Add(new StoredProcedureParameter("@UserGUID", SqlDbType.Decimal, userGUID));
                parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.Decimal, clientVisitGUID));
                parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.Decimal, clientGUID));
                parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.Decimal, chartGUID));
                DataTable dummyTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryInactivate_Sp", parameters);
                dummyTable.Dispose();
            }
            catch
            {
                throw;
            }
        }
Esempio n. 52
-3
        private void ValidateHomeMedication()
        {
            try
            {
                IDataHandler dataHandler = new DataHandler();

                List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>();
                parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.BigInt, this._ClientVisitGUID));
                parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.BigInt, this._ClientGUID));

                string omrStatus = string.Empty;
                DataTable dataTable = dataHandler.GetStoredProcedureResults(this._ConnectionString, "BH_OPlus_HomeMedicationStatus_Sp", parameters);
                foreach (DataRow dataRow in dataTable.Rows)
                    omrStatus = dataRow["OMRStatus"].ToString();

                if (omrStatus != "Complete")
                    this.Show();
                else
                {
                    OrderReconciliationManager orderReconciliationManager = new OrderReconciliationManager() { ClientVisitPrimaryKey = Convert.ToInt64(this._ClientVisitGUID) };
                    orderReconciliationManager.ShowDialog();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                HandleExceptions(ex);
            }
        }
Esempio n. 53
-5
    void Start()
    {
        dH = this.gameObject.GetComponent<DataHandler>();

        clip = new List<AudioClip>();

        //Add sounds to list
        if (Application.loadedLevelName.Equals("Repetition3"))
        {
            activeSounds = 1;

            if (this.gameObject.name.Contains("Metal"))
            {

            }
            else if (this.gameObject.name.Contains("Wood"))
            {
                clip.Add(Resources.Load("Sounds/random/rand1") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand2") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand3") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand4") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand5") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand6") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand7") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand8") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand9") as AudioClip);
                clip.Add(Resources.Load("Sounds/random/rand10") as AudioClip);
            }
        }
        else if (Application.loadedLevelName.Equals("Speed1"))
        {
            activeSounds = 3;

            if (this.gameObject.name.Contains("Metal"))
            {

            }
            else if (this.gameObject.name.Contains("Wood"))
            {
                clip.Add(Resources.Load("Sounds/speed/lowSpeed") as AudioClip);
                clip.Add(Resources.Load("Sounds/speed/mediumSpeed") as AudioClip);
                clip.Add(Resources.Load("Sounds/speed/highSpeed") as AudioClip);
            }
        }
        else
        {
            activeSounds = 3;

            if (this.gameObject.name.Contains("Metal"))
            {

            }
            else if (this.gameObject.name.Contains("Wood"))
            {
                clip.Add(Resources.Load("Sounds/size/smallCube") as AudioClip);
                clip.Add(Resources.Load("Sounds/size/mediumCube") as AudioClip);
                clip.Add(Resources.Load("Sounds/size/largeCube") as AudioClip);
            }
        }
    }