Ejemplo n.º 1
0
 ///<summary>Opens the appropriate form to edit the program property.</summary>
 private void PropertyTypeDirector(ProgramProperty prop)
 {
     if (ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.ImageCategory)         //imageCategory
     {
         List <Def> listDefs = Defs.GetDefsForCategory(DefCat.ImageCats, true);
         int        idxDef   = listDefs.FindIndex(x => x.DefNum == PIn.Long(prop.PropertyValue));
         InputBox   inputBox = new InputBox("Choose an Image Category", listDefs.Select(x => x.ItemName).ToList(), idxDef);
         inputBox.ShowDialog();
         if (inputBox.DialogResult != DialogResult.OK || inputBox.SelectedIndex == -1)
         {
             return;
         }
         prop.PropertyValue = POut.Long(listDefs[inputBox.SelectedIndex].DefNum);
         ProgramProperties.Update(prop);
     }
     else
     {
         bool propIsPassword        = ProgramCur.ProgName == ProgramName.XVWeb.ToString() && prop.PropertyDesc == XVWeb.ProgramProps.Password;
         FormProgramProperty FormPP = new FormProgramProperty(propIsPassword);
         FormPP.ProgramPropertyCur = prop;
         FormPP.ShowDialog();
         if (FormPP.DialogResult != DialogResult.OK)
         {
             return;
         }
     }
     ProgramProperties.RefreshCache();
     FillGrid();
 }
Ejemplo n.º 2
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (prog == null)
     {
         MsgBox.Show(this, "X-Charge entry is missing from the database.");               //should never happen
         return;
     }
     if (!File.Exists(textPath.Text))
     {
         MsgBox.Show(this, "Path is not valid.");
         return;
     }
     if (comboPaymentType.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Please select a payment type first.");
         return;
     }
     prog.Enabled = checkEnabled.Checked;
     prog.Path    = textPath.Text;
     Programs.Update(prog);
     prop.PropertyValue = DefB.Short[(int)DefCat.PaymentTypes][comboPaymentType.SelectedIndex].DefNum.ToString();
     ProgramProperties.Update(prop);
     DataValid.SetInvalid(InvalidTypes.Programs);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 3
0
 private void UpdateProgramProperty(ProgramProperty ppFromDb, string newpropertyValue)
 {
     if (ppFromDb.PropertyValue == newpropertyValue)
     {
         return;
     }
     ppFromDb.PropertyValue = newpropertyValue;
     ProgramProperties.Update(ppFromDb);
     _hasProgramPropertyChanged = true;
 }
Ejemplo n.º 4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     ProgramPropertyCur.PropertyValue = textValue.Text;
     if (_isPassword)
     {
         string encryptedText;
         CDT.Class1.Encrypt(ProgramPropertyCur.PropertyValue, out encryptedText);
         ProgramPropertyCur.PropertyValue = encryptedText;
     }
     ProgramProperties.Update(ProgramPropertyCur);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 5
0
 private void butOK_Click(object sender, EventArgs e)
 {
     try {
         string accessTokenFinal = WebSerializer.DeserializePrimitiveOrThrow <string>(
             WebServiceMainHQProxy.GetWebServiceMainHQInstance().GetDropboxAccessToken(WebSerializer.SerializePrimitive <string>(textAccessToken.Text)));
         ProgramPropertyAccessToken.PropertyValue = accessTokenFinal;
         ProgramProperties.Update(ProgramPropertyAccessToken);
         DataValid.SetInvalid(InvalidType.Programs);
     }
     catch (Exception ex) {
         MessageBox.Show(Lan.g(this, "Error:") + "  " + ex.Message);
         return;
     }
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 6
0
        ///<summary>Opens a form where the user can select an option from a combo box for a program poperty.</summary>
        ///<param name="listValuesForDb">The value that should be stored in the db for the corresponding display item that is selected. This list should
        ///have the same number of items as listForDisplay.</param>
        ///<param name="listForDisplay">The value that will be displayed to the user in the combo box. This list should have the same number of items
        ///as listValuesForDb.</param>
        private void ShowComboBoxForProgramProperty(ProgramProperty programProperty, List <string> listValuesForDb, List <string> listForDisplay
                                                    , string prompt)
        {
            ProgramProperty programPropertyOld = programProperty.Copy();
            InputBox        inputBox           = new InputBox(prompt, listForDisplay, listValuesForDb.FindIndex(x => x == programProperty.PropertyValue));

            inputBox.ShowDialog();
            if (inputBox.DialogResult != DialogResult.OK || inputBox.SelectedIndex == -1 ||
                listValuesForDb[inputBox.SelectedIndex] == programPropertyOld.PropertyValue)
            {
                return;
            }
            programProperty.PropertyValue = listValuesForDb[inputBox.SelectedIndex];
            ProgramProperties.Update(programProperty, programPropertyOld);
            ProgramProperties.RefreshCache();
            FillGrid();
        }
        private void butOK_Click(object sender, EventArgs e)
        {
            if (comboClinics.SelectedIndex == -1)
            {
                MsgBox.Show(this, "Please select a clinic.");
                return;
            }
            _clinicErxCur.ClinicNum = comboClinics.GetSelected <Clinic>().ClinicNum;
            Program         progErx    = Programs.GetCur(ProgramName.eRx);
            ProgramProperty ppClinicID = _listClinicIDs.FirstOrDefault(x => x.ClinicNum == _clinicErxCur.ClinicNum);

            if (ppClinicID == null)
            {
                ppClinicID               = new ProgramProperty();
                ppClinicID.ProgramNum    = progErx.ProgramNum;
                ppClinicID.ClinicNum     = _clinicErxCur.ClinicNum;
                ppClinicID.PropertyDesc  = Erx.PropertyDescs.ClinicID;
                ppClinicID.PropertyValue = _clinicErxCur.ClinicId;
                ProgramProperties.Insert(ppClinicID);
            }
            else
            {
                ppClinicID.PropertyValue = _clinicErxCur.ClinicId;
                ProgramProperties.Update(ppClinicID);
            }
            ProgramProperty ppClinicKey = _listClinicKeys.FirstOrDefault(x => x.ClinicNum == _clinicErxCur.ClinicNum);

            if (ppClinicKey == null)
            {
                ppClinicKey               = new ProgramProperty();
                ppClinicKey.ProgramNum    = progErx.ProgramNum;
                ppClinicKey.ClinicNum     = _clinicErxCur.ClinicNum;
                ppClinicKey.PropertyDesc  = Erx.PropertyDescs.ClinicKey;
                ppClinicKey.PropertyValue = _clinicErxCur.ClinicKey;
                ProgramProperties.Insert(ppClinicKey);
            }
            else
            {
                ppClinicKey.PropertyValue = _clinicErxCur.ClinicKey;
                ProgramProperties.Update(ppClinicKey);
            }
            DataValid.SetInvalid(InvalidType.Programs);
            DialogResult = DialogResult.OK;
        }
Ejemplo n.º 8
0
        private void checkHideButtons_CheckedChanged(object sender, EventArgs e)
        {
            if (_isLoading)
            {
                return;
            }
            ProgramProperty property = ProgramProperties.GetForProgram(ProgramCur.ProgramNum).FirstOrDefault(x => x.PropertyDesc == "Disable Advertising");

            if (property == null)
            {
                return;                //should never happen.
            }
            if (checkHideButtons.Checked)
            {
                property.PropertyValue = "1";
            }
            else
            {
                property.PropertyValue = "0";
            }
            ProgramProperties.Update(property);
        }
Ejemplo n.º 9
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (prog == null)
     {
         MsgBox.Show(this, "PayConnect entry is missing from the database.");               //should never happen
         return;
     }
     if (comboPaymentType.SelectedIndex == -1)
     {
         MsgBox.Show(this, "Please select a payment type first.");
         return;
     }
     prog.Enabled = checkEnabled.Checked;
     Programs.Update(prog);
     propUsername.PropertyValue = textUsername.Text;
     ProgramProperties.Update(propUsername);
     propPassword.PropertyValue = textPassword.Text;
     ProgramProperties.Update(propPassword);
     propPayType.PropertyValue = DefC.Short[(int)DefCat.PaymentTypes][comboPaymentType.SelectedIndex].DefNum.ToString();
     ProgramProperties.Update(propPayType);
     DataValid.SetInvalid(InvalidType.Programs);
     DialogResult = DialogResult.OK;
 }
Ejemplo n.º 10
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     ProgramPropertyCur.PropertyValue = textValue.Text;
     ProgramProperties.Update(ProgramPropertyCur);
     DialogResult = DialogResult.OK;
 }