/// <summary> /// Populates the fields of the form /// </summary> private void PopulateFields() { lookUpEdit1.EditValue = Convert.ToInt32(VisibilitySetting.GetRegistryValue(VisibilitySetting.REGISTRY_PATH, VisibilitySetting.HANDLE_UNITS_KEY)); _hospInfo.LoadAll(); txtHospitalName.Text = _hospInfo.HospitalName; txtPhone.Text = _hospInfo.Telephone; //txtContactPerson.Text = _hospInfo.HospitalContact; //cboRegion.SelectedValue = _hospInfo.Region; //cboWoreda.SelectedValue = _hospInfo.Woreda; //cboZone.SelectedValue = _hospInfo.Zone; string [] userPass = _hospInfo.Description.Split(';'); txtUserName.Text = userPass[0]; txtmonthstosupply.Text = _hospInfo.ScmsWSUserName; txtBirths.Text = _hospInfo.ScmsWSPassword; txtPassword.Text = (userPass.Length == 1) ? "" : userPass[1]; txtRegionZoneWoreda.Text = _hospInfo.DSUpdateFrequency; //columns doesnt match txtmonthstosupply.Text = _hospInfo.RRFStatusUpdateFrequency; ////columns doesnt match txtBirths.Text = _hospInfo.RRFStatusFirstUpdateAfter; //columns doesnt match txtSurvivingInfants.Text = _hospInfo.ScmsWSUserName; //columns doesnt match //cboDSUpdateFrequency.EditValue = _hospInfo.IsColumnNull("DSUpdateFrequency")?"": _hospInfo.DSUpdateFrequency; //cboHCTSUpdateFrequency.EditValue = _hospInfo.IsColumnNull("RRFStatusUpdateFrequency")?"":_hospInfo.RRFStatusUpdateFrequency; //cboHCTSFirstUpdate.EditValue = _hospInfo.IsColumnNull("RRFStatusFirstUpdateAfter") ? "" : _hospInfo.RRFStatusFirstUpdateAfter; _hospitalId = _hospInfo.ID; // chkNormal.EditValue = _hospInfo.NormalFacility; if (!_hospInfo.IsColumnNull("FacilityID")) { txtFacilityID.EditValue = _hospInfo.FacilityID; } }
public MemberVisibleCondition(MemberCondition memberCondition, VisibilitySetting visibilitySetting, string memberToAffect) { MemberCondition = memberCondition; VisibilitySettings = visibilitySetting; MemberToAffect = memberToAffect; }
protected string privacySettingToString(VisibilitySetting s) { switch (s) { case VisibilitySetting.None: return("none"); case VisibilitySetting.Contacts: return("contacts"); case VisibilitySetting.Everyone: return("all"); default: throw new Exception("Invalid visibility setting"); } }
public void SendSetPrivacySetting(VisibilityCategory category, VisibilitySetting setting) { ProtocolTreeNode node = new ProtocolTreeNode("iq", new[] { new KeyValue("to", "s.whatsapp.net"), new KeyValue("id", TicketCounter.MakeId()), new KeyValue("type", "set"), new KeyValue("xmlns", "privacy") }, new ProtocolTreeNode[] { new ProtocolTreeNode("privacy", null, new ProtocolTreeNode[] { new ProtocolTreeNode("category", new [] { new KeyValue("name", this.privacyCategoryToString(category)), new KeyValue("value", this.privacySettingToString(setting)) }) }) }); this.SendNode(node); }
public void SendSetPrivacySetting(VisibilityCategory category, VisibilitySetting setting) { ProtocolTreeNode node = new ProtocolTreeNode("iq", new[] { new KeyValue("to", "s.whatsapp.net"), new KeyValue("id", TicketCounter.MakeId("setprivacy_")), new KeyValue("type", "set"), new KeyValue("xmlns", "privacy") }, new ProtocolTreeNode[] { new ProtocolTreeNode("privacy", null, new ProtocolTreeNode[] { new ProtocolTreeNode("category", new [] { new KeyValue("name", this.privacyCategoryToString(category)), new KeyValue("value", this.privacySettingToString(setting)) }) }) }); this.SendNode(node); }
protected string privacySettingToString(VisibilitySetting s) { switch (s) { case VisibilitySetting.None: return "none"; case VisibilitySetting.Contacts: return "contacts"; case VisibilitySetting.Everyone: return "all"; default: throw new Exception("Invalid visibility setting"); } }
/// <summary> /// Saves the Facility Information /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { User user = new User(); user.LoadByPrimaryKey(MainWindow.LoggedinId); if (_hospitalId == 0) { return; } if (XtraMessageBox.Show("Are You sure, You want to save the changes to Hospital General Info.?", "Confirmation", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } if (user.UserName != "admin") { XtraMessageBox.Show("You have no privilege to change FE setting!", "Error"); return; } switch (Convert.ToInt32(lookUpEdit1.EditValue)) { case 1: VisibilitySetting.SetRegistryValue(VisibilitySetting.HANDLE_UNITS_KEY, 1); break; case 2: VisibilitySetting.SetRegistryValue(VisibilitySetting.HANDLE_UNITS_KEY, 2); break; case 3: VisibilitySetting.SetRegistryValue(VisibilitySetting.HANDLE_UNITS_KEY, 3); break; } _hospInfo.LoadByPrimaryKey(_hospitalId); _hospInfo.HospitalName = txtHospitalName.Text; //_hospInfo.HospitalContact = txtContactPerson.Text; _hospInfo.Telephone = txtPhone.Text; if (txtUserName.Text.IndexOf(';') != -1 || txtPassword.Text.IndexOf(';') != -1) { XtraMessageBox.Show("User name or password cannot contain the ';' character!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } _hospInfo.Description = txtUserName.Text + ";" + txtPassword.Text; //_hospInfo.DSUpdateFrequency = cboDSUpdateFrequency.EditValue.ToString(); //_hospInfo.RRFStatusUpdateFrequency = cboHCTSUpdateFrequency.EditValue.ToString(); //_hospInfo.RRFStatusFirstUpdateAfter = cboHCTSFirstUpdate.EditValue.ToString(); _hospInfo.DSUpdateFrequency = txtRegionZoneWoreda.Text; //columns doesnt match _hospInfo.RRFStatusUpdateFrequency = txtmonthstosupply.Text; ////columns doesnt match _hospInfo.RRFStatusFirstUpdateAfter = txtBirths.Text; //columns doesnt match _hospInfo.ScmsWSUserName = txtSurvivingInfants.Text; //columns doesnt match //_hospInfo.NormalFacility = (bool) chkNormal.EditValue; //_hospInfo.Region = Convert.ToInt32(cboRegion.SelectedValue); //_hospInfo.Woreda = Convert.ToInt32(cboWoreda.SelectedValue); //_hospInfo.Zone = Convert.ToInt32(cboZone.SelectedValue); if (txtFacilityID.Text != "") { _hospInfo.FacilityID = Convert.ToInt32(txtFacilityID.EditValue); //_hospInfo.ScmsWSUserName = txtmonthstosupply.Text; //_hospInfo.ScmsWSPassword = txtBirths.Text; } if (txtLogo.Text != "") { try { string logo = txtLogo.Text; int le = logo.LastIndexOf('\\') + 1; logo = logo.Substring(le, logo.Length - le); string dest = ReadApp.GetValue("logoPath", typeof(string)).ToString(); System.IO.File.Copy(txtLogo.Text, dest + logo); _hospInfo.Logo = logo; } catch { } } _hospInfo.Save(); XtraMessageBox.Show("Facility Setting Successfully Saved.", "Success", MessageBoxButtons.OK); PopulateFields(); this.Parent.Parent.Text = _hospInfo.HospitalName + " - Ethiopian Health Commodity Management Information System(HCMS)"; }
public SettingsViewModel() { PanelColor = new PanelColorSetting() { Name = nameof(PanelOpacity) }; PrimaryColor = new PrimaryColorSetting() { Name = nameof(PrimaryColor) }; SecondaryColor = new ColorSetting() { Name = nameof(SecondaryColor) }; SecondaryColorL = new ColorSetting() { Name = nameof(SecondaryColorL) }; ForegroundColor = new ColorSetting() { Name = nameof(ForegroundColor) }; ForegroundColorL = new ColorSetting() { Name = nameof(ForegroundColorL) }; LyricForegroundColor = new ColorSetting() { Name = nameof(LyricForegroundColor) }; LyricHighlightColor = new ColorSetting() { Name = nameof(LyricHighlightColor) }; LyricShadowColor = new ShadowColorSetting() { Name = "LyricShadowEffect" }; TextShadowColor = new ShadowColorSetting() { Name = "TextShadowEffect" }; PrimaryFont = new FontSetting() { Name = nameof(PrimaryFont) }; LyricFont = new FontSetting() { Name = nameof(LyricFont) }; TextMediumFontSize = new DoubleSetting() { Name = nameof(TextMediumFontSize) }; TextSmallFontSize = new DoubleSetting() { Name = nameof(TextSmallFontSize) }; LyricMediumFontSize = new DoubleSetting() { Name = nameof(LyricMediumFontSize) }; LyricSmallFontSize = new DoubleSetting() { Name = nameof(LyricSmallFontSize) }; PanelOpacity = new OpacitySetting() { Name = nameof(PanelOpacity) }; MusicVolume = new VolumeSetting() { Name = nameof(MusicVolume) }; BackgroundCoverVisibility = new VisibilitySetting() { Name = nameof(BackgroundCoverVisibility) }; MiniBackgroundCoverVisibility = new VisibilitySetting() { Name = nameof(MiniBackgroundCoverVisibility) }; }