public Form_Tool_SelectItem(Atom_ItemShopA xAtom_ItemShopA, usrc_Editor xusrc_Editor) { InitializeComponent(); m_Atom_ItemShopA = xAtom_ItemShopA; m_usrc_Editor = xusrc_Editor; t_Atom_ItemShopA = new SQLTable(DBSync.DBSync.DB_for_Tangenta.m_DBTables.GetTable(typeof(Atom_ItemShopA))); }
internal void Fill(ref Atom_ItemShopA m_Atom_ItemShopA) { if (this.txt_Item_Description.Text.Length>0) { m_Atom_ItemShopA.Description.set(this.txt_Item_Description.Text); } else { m_Atom_ItemShopA.Description.set(null); } }
internal bool Fill(ref Atom_ItemShopA m_Atom_ItemShopA) { if (this.txt_ItemName.Text.Length > 0) { m_Atom_ItemShopA.Name.set(this.txt_ItemName.Text); return true; } else { MessageBox.Show(this, lngRPM.s_Item_name_must_be_defined.s); return false; } }
public static bool get(Atom_ItemShopA m_Atom_ItemShopA, ref long Atom_ItemShopA_ID) { string Err = null; string scond = null; string sval = null; m_Atom_ItemShopA.VisibleForSelection.set(true); List<SQL_Parameter> lpar = new List<SQL_Parameter>(); m_Atom_ItemShopA.Name.setsqlp(ref lpar, "Name", ref scond, ref sval); m_Atom_ItemShopA.Description.setsqlp(ref lpar, "Description", ref scond, ref sval); m_Atom_ItemShopA.m_Taxation.ID.setsqlp(ref lpar, "Taxation_ID", ref scond, ref sval); m_Atom_ItemShopA.m_Unit.ID.setsqlp(ref lpar, "Unit_ID", ref scond, ref sval); string sql = " select ID from Atom_ItemShopA where " + m_Atom_ItemShopA.Name.cond + " and " + m_Atom_ItemShopA.Description.cond + " and " + m_Atom_ItemShopA.m_Taxation.ID.cond + " and " + m_Atom_ItemShopA.m_Unit.ID.cond; DataTable dt = new DataTable(); if (DBSync.DBSync.ReadDataTable(ref dt,sql,lpar, ref Err)) { if (dt.Rows.Count > 0) { Atom_ItemShopA_ID = (long)dt.Rows[0]["ID"]; return true; } else { sql = "insert into Atom_ItemShopA (Name,Description,Taxation_ID,Unit_ID,VisibleForSelection) values (" + m_Atom_ItemShopA.Name.value + "," + m_Atom_ItemShopA.Description.value + "," + m_Atom_ItemShopA.m_Taxation.ID.value + "," + m_Atom_ItemShopA.m_Unit.ID.value + ",1)"; object oret = null; if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql,lpar,ref Atom_ItemShopA_ID,ref oret, ref Err, "Atom_ItemShopA")) { return true; } else { LogFile.Error.Show("ERROR:ShopA_dbfunc:dbfunc:get(Atom_ItemShopA m_Atom_ItemShopA, ref long atom_ItemShopA_ID) sql=" + sql + "\r\nErr=" + Err); return false; } } } else { LogFile.Error.Show("ERROR:ShopA_dbfunc:dbfunc:get(Atom_ItemShopA m_Atom_ItemShopA, ref long atom_ItemShopA_ID) sql=" + sql + "\r\nErr=" + Err); return false; } }