Exemplo n.º 1
0
 public BomScan(SwApiWrapper swApi, SwModelWrapper swModel, PropertyScaffold scaffold)
 {
     InitializeComponent();
     this.swMod    = swModel;
     this.swApi    = swApi;
     this.scaffold = scaffold;
 }
Exemplo n.º 2
0
 public ImageForm(SwModelWrapper swMod, OdooProduct oProd)
 {
     InitializeComponent();
     this.swMod = swMod;
     this.oProd = oProd;
     GetOdooImage();
 }
Exemplo n.º 3
0
        void DbWriteConfig(string strPathName, string strConfigName, SwComponentWrapper swComponent = null, SwModelWrapper swModel = null)
        {
            // Return if the config properties have already been written
            cmdCheckConfigs.Parameters["@filename"].Value   = strPathName;
            cmdCheckConfigs.Parameters["@configname"].Value = strConfigName;
            int intExists = Convert.ToInt32(cmdCheckConfigs.ExecuteScalar().ToString());

            if (intExists != 0)
            {
                return;
            }

            // Write status to form label
            MethodInvoker WriteLabelDelegate = new MethodInvoker(WriteLabel);
            string        strModelName       = this.statLabel;

            this.statLabel = strModelName + "(" + strConfigName + ")" + " ... getting custom properties";
            Invoke(WriteLabelDelegate);

            // Get model doc extension
            if (swModel == null)
            {
                swModel = swComponent.GetModelWrapper(strConfigName);
            }

            // Get custom properties
            //SwCustProp props = swModel.GetCustProp(strConfigName, cbxGetImages.Checked);
            DataRow props = swModel.GetCustomProp(strConfigName, withImage: cbxGetImages.Checked, merge: true);

            // Execute query
            foreach (DataColumn col in props.Table.Columns)
            {
                if (!scaffold.ScanFields.Contains(col.ColumnName))
                {
                    continue;
                }
                string param = "@" + col.ColumnName;
                object value = props[col.ColumnName];
                cmdInsertConfigs.Parameters[param].Value = value;
            }
            //foreach (KeyValuePair<string, object> prop in props.FieldValues)
            //    cmdInsertConfigs.Parameters["@" + prop.Key].Value = prop.Value;
            cmdInsertConfigs.ExecuteNonQuery();
        }