void btnSaveOtherLanguage_Click(object sender, EventArgs e)
{
if (ViewState[CMSViewStateManager.SupplierID] != null && ucPortalLanguage.SelectedLanguageID > 0)
{
try
{
// Update Info Except Language Info :
Supplier Supplier =
SupplierManager.GetSupplier(Convert.ToInt32(ViewState[CMSViewStateManager.SupplierID]),CMSContext.PortalID, CMSContext.LanguageID);
if (Supplier != null)
{
Supplier.IsEnabled = cbIsEnabled.Checked;
List<string> files = ucSWFUpload.GetFilesName();
if (files.Count > 0)
Supplier.LogoImage = files[0];
else
Supplier.LogoImage = string.Empty;
int parentSupplierId = -1;
int.TryParse(ddlParentSupplier.SelectedValue, out parentSupplierId);
if (parentSupplierId > 0)
Supplier.ParentSupplierID = parentSupplierId;
SupplierManager.Update(Supplier);
//SaveLanguage Info Only :
Supplier langSupplier = new Supplier
{
ID = Convert.ToInt32(ViewState[CMSViewStateManager.SupplierID]),
Name = txtName.Text,
Description = txtDescription.Text,
MetaTitle = txtMetaTitle.Text,
MetaDescription = txtMetaDescription.Text,
MetaKeywords = txtMetaKeywords.Text,
LanguageID = ucPortalLanguage.SelectedLanguageID,
ModuleID = (int)CMSEnums.ECommerceModule.Supplier,
};
SupplierManager.AddOtherLanguage(langSupplier);
BeginAddMode();
FillSupplierTree();
upnlSupplier.Update();
upnlSupplierItem.Update();
}
}
catch (Exception ex)
{
dvProblems.Visible = true;
dvProblems.InnerText = ex.ToString();
upnlSupplier.Update();
}
}
}