Exemplo n.º 1
0
        ///<summary>Gets a list of FieldDefLinks for a specified location.</summary>
        public static List <FieldDefLink> GetForLocation(FieldLocations fieldLocation)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <FieldDefLink> >(MethodBase.GetCurrentMethod(), fieldLocation));
            }
            string command = "SELECT * FROM fielddeflink WHERE FieldLocation=" + POut.Int((int)fieldLocation);

            return(Crud.FieldDefLinkCrud.SelectMany(command));
        }
Exemplo n.º 2
0
 public FormFieldDefLink(FieldLocations fieldLocation = FieldLocations.Account)
 {
     InitializeComponent();
     Lan.F(this);
     _fieldLocation = fieldLocation;
 }
Exemplo n.º 3
0
        ///<summary>Adds the passed in pat fields to the grid. Adds any fields that have been renamed at the end of the grid if the preference is
        ///enabled. The tag on the row will be the PatFieldDef or the PatField if the PatFieldDef has been renamed.</summary>
        public static void AddPatFieldsToGrid(ODGrid grid, List <PatField> listPatFields, FieldLocations fieldLocation,
                                              List <FieldDefLink> listFieldDefLinks = null)
        {
            List <PatFieldDef> listPatFieldDefs = PatFieldDefs.GetDeepCopy(true);

            listFieldDefLinks = listFieldDefLinks ?? FieldDefLinks.GetForLocation(fieldLocation)
                                .FindAll(x => x.FieldDefType == FieldDefTypes.Patient);
            //Add a row for each existing PatFieldDef
            foreach (PatFieldDef patFieldDef in listPatFieldDefs)
            {
                if (listFieldDefLinks.Exists(x => x.FieldDefNum == patFieldDef.PatFieldDefNum))
                {
                    continue;
                }
                ODGridRow row   = new ODGridRow();
                PatField  field = listPatFields.FirstOrDefault(x => x.FieldName == patFieldDef.FieldName);
                if (patFieldDef.FieldType.ToString() == "InCaseOfEmergency")
                {
                    //Deprecated. Should never happen.
                    continue;
                }
                row.Cells.Add(patFieldDef.FieldName);
                if (field == null)
                {
                    row.Cells.Add("");
                }
                else
                {
                    if (patFieldDef.FieldType == PatFieldType.Checkbox)
                    {
                        row.Cells.Add("X");
                    }
                    else if (patFieldDef.FieldType == PatFieldType.Currency)
                    {
                        row.Cells.Add(PIn.Double(field.FieldValue).ToString("c"));
                    }
                    else
                    {
                        row.Cells.Add(field.FieldValue);
                    }
                }
                row.Tag = patFieldDef;
                grid.Rows.Add(row);
            }
            if (!PrefC.GetBool(PrefName.DisplayRenamedPatFields))
            {
                return;
            }
            //Now loop through the PatFields that do not have a matching PatFieldDef.
            foreach (PatField patField in listPatFields.Where(x => !listPatFieldDefs.Any(y => y.FieldName == x.FieldName)))
            {
                ODGridRow row = new ODGridRow();
                row.Cells.Add(patField.FieldName);
                row.Cells.Add(patField.FieldValue);
                row.Tag       = patField;
                row.ColorText = Color.DarkSlateGray;
                grid.Rows.Add(row);
            }
        }