Пример #1
0
        //end

        private void UpdateOptions(string itemKey)
        {
            ItemKey = itemKey;
            string regionCode = string.Empty;

            if (Utils.IsWholeNumber(ItemKey))
            {
                regionCode = ddClassRegions.SelectedValue.ToString();
                //QC 2746 -- Modified by Sateesh on 20 July 2009
                GetLanguagesByRegion(regionCode);
                //QC 2746 -- Modified by Sateesh on 20 July 2009
                CurrentItemType = CurrentItemTypeEnum.Class;
                try
                {
                    //using (TRClass t = TRClass.GetByKey(Convert.ToInt64(ItemKey), regionCode))
                    //Modified by Venkata 07 oct 16
                    using (TRClass t = GetTRClassByKey(Convert.ToInt64(ItemKey), regionCode))
                    {
                        //ddClassRegions.Visible = true;
                        //ddTermsRegions.Visible = false;
                        pnl_ClassPanel.Visible = true;
                        pnl_TermsPanel.Visible = false;
                        UpdateClassOptions(t, regionCode);
                    }
                }
                catch (Exception ex)
                {
                    lbError.Visible = true;
                    if (ex.Message.ToString() == "Object reference not set to an instance of an object.")
                    {
                        lbError.Text = "No TRClass exists for this Class,RegionCode combination.Contact Support.Please verify TRClassSettings table.";
                    }
                    lbError.Text    += "ERROR:" + ex.Message;
                    lbError.CssClass = "hc_error";
                }
            }
            else
            {
                CurrentItemType = CurrentItemTypeEnum.Term;

                //QC 2746 -- Modified by Sateesh on 20 July 2009
                regionCode = ddTermsRegions.SelectedValue.ToString();
                //QC 2746 -- Modified by Sateesh on 20 July 2009
                GetLanguagesByRegion(regionCode);
                using (TermType tt = TermType.GetByKey(Convert.ToChar(ItemKey)))
                {
                    pnl_ClassPanel.Visible = false;
                    pnl_TermsPanel.Visible = true;
                    UpdateTermOptions(tt, regionCode);
                }
            }
        }
Пример #2
0
        protected void advancedToolBar_ButtonClicked(object sender, Infragistics.WebUI.UltraWebToolbar.ButtonEvent be)
        {
            advancedToolBar.ClientSideEvents.InitializeToolbar = "";
            uwToolbar.Items.FromKeyButton("Export").Pressed(true);
            switch (be.Button.Key)
            {
            case "TotalExport":
                using (HyperComponents.Data.dbAccess.Database dbObj = new HyperComponents.Data.dbAccess.Database(SessionState.CacheComponents["CRYSTAL_DB"].ConnectionString))
                {
                    string code = DDL_TermTypeList.SelectedIndex > 0 ? DDL_TermTypeList.SelectedValue.ToString() : string.Empty;
                    using (DataSet ds = dbObj.RunSPReturnDataSet("_Term_Export", new System.Data.SqlClient.SqlParameter("@TermTypeCode", code)))
                    {
                        code = code == string.Empty ? " " : code;                     // assigning the code to have empty space if it is empty
                        using (TermType tt = TermType.GetByKey(Convert.ToChar(code))) // If the code value is " ", then tt would be null
                        {
                            code = code != " " ? tt.Name : "All terms";
                        }
                        HyperCatalog.UI.Tools.Export.ExportTermReport(ds, code, this.Page);
                    }
                }
                break;

            case "RunValidationReport":
                using (HyperComponents.Data.dbAccess.Database dbObj = new HyperComponents.Data.dbAccess.Database(SessionState.CacheComponents["CRYSTAL_DB"].ConnectionString))
                {
                    Infragistics.WebUI.WebSchedule.WebDateChooser startDate = (Infragistics.WebUI.WebSchedule.WebDateChooser)advancedToolBar.Items.FromKeyCustom("startDate").FindControl("startDate");
                    if (startDate != null)
                    {
                        using (DataSet ds = dbObj.RunSPReturnDataSet("_Term_GetChoicesValidationReport", new System.Data.SqlClient.SqlParameter("@DayNew", startDate.Value)))
                        {
                            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                            {
                                HyperCatalog.UI.Tools.Export.ExportTermValidationReport(ds, (DateTime)startDate.Value, Page);
                            }
                            else
                            {
                                errorMsg.Text    = "No activity since this date.";
                                errorMsg.Visible = true;
                            }
                        }
                    }
                }
                break;

            default:
                Response.Write("coucou");
                break;
            }
        }
Пример #3
0
        private void SaveCurrentTerm()
        {
            using (TermType business = TermType.GetByKey(Convert.ToChar(ItemKey)))
            {
                #region save BatchDays
                business.RegionCode = ddTermsRegions.SelectedValue.ToString();
                business.MTRDays.Clear();
                foreach (ListItem item in cbMTRDays.Items)
                {
                    if (item.Selected)
                    {
                        business.MTRDays.Add(Convert.ToInt32(item.Value));
                    }
                }
                business.SaveMTRDays();
                #endregion
                #region save MTR Languages
                business.Languages.Clear();
                foreach (ListItem item in cbTermLanguages.Items)
                {
                    if (item.Selected)
                    {
                        using (HyperCatalog.Business.Language l = HyperCatalog.Business.Language.GetByKey(item.Value.ToString()))
                        {
                            business.Languages.Add(l);
                        }
                    }
                }
                business.SaveLanguages();

                //Included for 4179 --Translation settings unique logging issue
                HyperCatalog.Business.ActivityLog.TRActivityLog(business, SessionState.User);

                #endregion
            }
        }