02-24-2014 10:23 AM
Include the following code.
OnForm Load:
NHibernate.ISession _session = new Sage.Platform.Orm.SessionScopeWrapper();
NHibernate.IQuery _query = _session.CreateSQLQuery("select PLUGINID,NAME FROM PLUGIN where TYPE=1 AND USERID<>'ADMIN'");
var _salesprocess = _query.List<object[]>();
foreach (var item in _salesprocess)
{
comboboxSalesProcess.Items.Add(new ListItem(item[1].ToString(), item[0].ToString()));
}
cmdSave:
string _oppId = string.Format("{0}", (BindingSource.Current as Sage.Platform.ComponentModel.IComponentReference).Id);
string _spId = this.cbbProcessoVenda.SelectedValue.ToString();
Sage.Entity.Interfaces.ISalesProcesses _newSP = Sage.Platform.EntityFactory.Create<Sage.Entity.Interfaces.ISalesProcesses>();
_newSP.InitSalesProcess(_spId, _oppId);
_newSP.Save();
Enjoy!