Skip to content

Instantly share code, notes, and snippets.

@bayramcetin
Created August 11, 2022 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bayramcetin/f57d40f92142577d5f733bc3ff4a14e8 to your computer and use it in GitHub Desktop.
Save bayramcetin/f57d40f92142577d5f733bc3ff4a14e8 to your computer and use it in GitHub Desktop.
Change company
class ETGInventModelGroupUpdate
{
/// <summary>
/// Runs the class with the specified arguments.
/// </summary>
/// <param name = "_args">The specified arguments.</param>
public static void main(Args _args)
{
CompanyInfo companyInfo;
InventModelGroup inventModelGroup;
Dialog dialog = new Dialog("Hizmet olanları güncelle");
DialogField field = dialog.addField(extendedTypeStr(InventModelGroupId));
DialogField field2 = dialog.addField(extendedTypeStr(InventLocationId));
if(dialog.run())
{
if (!field.value())
throw warning("Model grubu seçiniz.");
InventModelGroupId inventModelGroupId = field.value();
InventLocationId inventLocationId = field2.value();
while select DataArea from companyInfo
{
changecompany(companyInfo.DataArea)
{
inventModelGroup = InventModelGroup::find(inventModelGroupId, true);
if(inventModelGroup)
{
ttsbegin;
inventModelGroup.ETGIsService = true;
if(inventLocationId)
{
inventModelGroup.ETGInventLocationId = inventLocationId;
}
inventModelGroup.update();
ttscommit;
}
}
}
Info("Güncelleme bitti.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment