/// <summary>
 /// Save PLC
 /// </summary>
 private void SavePLC()
 {
     using (PLC itemPLC = PLC.GetByKey(itemId, curCountryCode))
     {
         if (itemPLC != null)
         {
             #region Bundles rule
             // public intro date for bundles cannot be before the latest public intro dates of all the components.
             // Obsolescence dates cannot be set later than the earliest obsolescence date of the components
             if (curItemType == (int)ItemTypesEnum.BUNDLE)
             {
                 if (!itemPLC.CheckPLCforBundle(curCountryCode, (DateTime?)wdcPID.Value, (DateTime?)wdcObsoleteDate.Value))
                 {
                     lError.Text    = PLC.LastError;
                     lError.Visible = true;
                     return;
                 }
             }
             #endregion
             // all PLC are unlock before changes, prevent API rules
             #region PID
             itemPLC.FullLocked   = false;
             itemPLC.FullDate     = (DateTime?)wdcPID.Value;
             itemPLC.FullDateType = cboxPID.Checked ? 'C' : 'R';
             itemPLC.FullLocked   = cbPIDL.Checked;
             #endregion
             #region Announcement date
             itemPLC.AnnouncementLocked   = false;
             itemPLC.AnnouncementDate     = (DateTime?)wdcAnnouncementDate.Value;
             itemPLC.AnnouncementDateType = cboxAnnouncementDate.Checked ? 'C' : 'R';
             itemPLC.AnnouncementLocked   = cbAnnL.Checked;
             #endregion
             #region Blind date
             itemPLC.BlindLocked   = false;
             itemPLC.BlindDate     = (DateTime?)wdcBlindDate.Value;
             itemPLC.BlindDateType = cboxBlindDate.Checked ? 'C' : 'R';
             itemPLC.BlindLocked   = cbBlindL.Checked;
             #endregion
             #region Obsolete date
             itemPLC.ObsoleteLocked   = false;
             itemPLC.ObsoleteDate     = (DateTime?)wdcObsoleteDate.Value;
             itemPLC.ObsoleteDateType = cboxObsoleteDate.Checked ? 'C' : 'R';
             itemPLC.ObsoleteLocked   = cbObsoL.Checked;
             #endregion
             #region Removal date
             itemPLC.RemovalLocked   = false;
             itemPLC.RemovalDate     = (DateTime?)wdcRemovalDate.Value;
             itemPLC.RemovalDateType = cboxRemovalDate.Checked ? 'C' : 'R';
             itemPLC.RemovalLocked   = cbRemovL.Checked;
             #endregion
             if (itemPLC.Save(SessionState.User.Id))
             {
                 //Sateesh -- Language Scope Management - ACQ 3.6 - 27/05/2009
                 Item.UpdateWorkingTables(itemPLC.ItemId, SessionState.Culture.Code, true);
                 if (Request["dg"] == null)
                 {
                     Page.ClientScript.RegisterStartupScript(this.GetType(), "reloadParent", "<script>ReloadParent();</script>");
                 }
                 else // We have been opened by another page that contains an Infragistics Grid
                 // Call parent refresh function to reflect the changes.
                 {
                     if (Request["row"] != null && Request["col"] != null)
                     {
                         Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "reloadParent", "<script>top.window.close()</script>");
                     }
                 }
             }
             else
             {
                 lError.Text    = PLC.LastError;
                 lError.Visible = true;
             }
         }
     }
 }