Exemple #1
0
        private void InitializeDataProvider(IGeneralDataProvider BasePage, string TableName, string DataBaseName, string IndexName, string SqlFrom)
        {
            this.TableName    = TableName;
            this.DataBaseName = DataBaseName;
            this.BasePage     = BasePage;
            this.IndexName    = IndexName;

            if (SqlFrom != null && SqlFrom != "")
            {
                IsView       = true;
                this.SqlFrom = "(" + SqlFrom + ") as " + TableName;
            }
            else
            {
                IsView       = false;
                this.SqlFrom = Dao.PoeColAspas(TableName);
            }
            // vamos encher lista de par??metros
            PrepareSelectCountCommands();
            this.SelectCommand = Select;
            if (BasePage != null)
            {
                Item = BasePage.GetDataProviderItem(this);
            }
        }
Exemple #2
0
 public void LocateRecordByRow(DataRow Row, bool CreateItem)
 {
     if (CreateItem)
     {
         Item = BasePage.GetDataProviderItem(this);
     }
     foreach (string Key in Item.Fields.Keys)
     {
         FieldBase Field     = Item.Fields[Key];
         string    FieldName = Field.Name;
         string    format    = (Item.Fields[Key].FieldType == FieldType.Date ? Select.DateFormat : "");
         Item.Fields[Key].SetValue(Row[FieldName], format);
     }
     LocateRecord(Item);
 }