示例#1
0
        /// <summary>
        ///     Инициализация/создание кнопок меню
        /// </summary>
        private void SetMenuButtons()
        {
            var btnAccept = new Button
            {
                ID           = "btnAccept",
                V4Page       = this,
                Text         = Resx.GetString("cmdApply"),
                Title        = Resx.GetString("cmdApply"),
                Width        = 105,
                IconJQueryUI = ButtonIconsEnum.Ok,
                OnClick      = "cmd('cmd', 'Save');"
            };

            var btnClose = new Button
            {
                ID           = "btnClose",
                V4Page       = this.ParentPage,
                Text         = Resx.GetString("cmdClose"),
                Title        = Resx.GetString("cmdCloseTitleApp"),
                IconJQueryUI = ButtonIconsEnum.Close,
                Width        = 105,
                OnClick      = "parent.vagon_Records_Close(idp);"
            };

            Button[] buttons = { btnAccept, btnClose };

            AddMenuButton(buttons);
        }
示例#2
0
 GetOrderInfo
 (
     Trade order
 )
 {
     // Was the order successful?
     if (order.ZorroTradeId > 0)
     {
         order = Broker.BrokerTrade(order.ZorroTradeId);
         if (order != null)
         {
             LogHelper.Log($"{Resx.GetString("TEST_ORDER_INFO_SUCCESS")} {order.Status}.");
             return(true);
         }
         else
         {
             LogHelper.Log(LogLevel.Error, $"{Resx.GetString("TEST_ORDER_INFO_FAILURE")}.");
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
示例#3
0
        Save
            ()
        {
            try
            {
                // Get the next Zorro Trade Id to assign to this trade
                ZorroTradeId = GetZorroTradeId();

                // Does the record already exist?
                if (GetTradeByZorroId(ZorroTradeId) == null)
                {
                    // NO: Insert it.
                    DataAccess.Insert(this);
                }

                // Return success code (Zorro trade id)
                return(ZorroTradeId);
            }
            catch (Exception e)
            {
                // Log the error
                LogHelper.Log(LogLevel.Error, $"{Resx.GetString("ERROR")}: " + e.Message);

                // Return error code
                return(-1);
            }
        }
        UpdateAssetsCSV
            ()
        {
            // Method members
            string symbols;

            try
            {
                // Read all lines of the CSV file and get the symbols
                symbols = GetSymbols();

                // Access the TD Ameritrade API and get quotes for all the
                // symbols
                List <TDAsset> assetList = GetQuotes(symbols).GetAwaiter().GetResult();

                // Write out a new CSV file
                WriteCSVFile(assetList);

                // Return success code
                return(true);
            }
            catch (Exception e)
            {
                // Log the error and return
                LogHelper.Log(LogLevel.Error, $"    {Resx.GetString("ERROR")}: " + e.Message);
            }

            // Return failure code
            return(false);
        }
示例#5
0
        /// <summary>
        /// Сохранение изменений
        /// </summary>
        /// <param name="SaveWithCheck"></param>
        private void Save(bool SaveWithCheck = true)
        {
            var msg = "";

            if (efWorkPlace.Value == "")
            {
                // Для сохранения необходимо выбрать рабочее место.
                ShowMessage(Resx.GetString("Users_lblSelectWorkplaceToSave"), efWorkPlace);
                return;
            }

            if (SaveWithCheck)
            {
                var error = false;
                msg = CheckSaveWorkPlace(efWorkPlace.Value, Id, out error);

                if (error)
                {
                    ShowMessage(msg, "Error", MessageStatus.Error);
                    return;
                }
            }

            if (String.IsNullOrEmpty(msg))
            {
                SaveConfirm();
            }
            else
            {
                ShowConfirm(msg, "cmdasync('cmd', 'SaveWithOutCheck')", null);
            }
        }
        /// <summary>
        ///     Инициализация/создание кнопок меню
        /// </summary>
        private void SetMenuButtons()
        {
            var btnAdd = new Button
            {
                ID           = "btnAccept",
                V4Page       = this,
                Text         = Resx.GetString("cmdApply"),
                Title        = Resx.GetString("cmdApply"),
                Width        = 105,
                IconJQueryUI = ButtonIconsEnum.Ok,
                OnClick      = "cmd('cmd', 'NaborOk');"
            };

            var btnClose = new Button
            {
                ID           = "btnClose",
                V4Page       = this.ParentPage,
                Text         = Resx.GetString("cmdClose"),
                Title        = Resx.GetString("cmdCloseTitleApp"),
                IconJQueryUI = ButtonIconsEnum.Close,
                Width        = 105,
                OnClick      = "parent.distrib_Records_Close(idp);"
            };

            var buttons = ParentPage.DocEditable ? new[] { btnAdd, btnClose } : new[] { btnClose };

            AddMenuButton(buttons);
        }
        /// <summary>
        ///     Конструктор контрола
        /// </summary>
        public DBSPersonContact()
        {
            Filter                    = new DSOPersonContact();
            KeyField                  = "Id";
            ValueField                = "Name";
            DisplayFields             = "Name, ContactTypeName";
            IsNotUseSelectTop         = false;
            AnvancedHeaderPopupResult =
                string.Format(
                    "<tr class='gridHeaderSelect v4s_noselect'><td><b>{0}</b></td><td><b>{1}</b></td></tr>",
                    Resx.GetString("lblContact"), Resx.GetString("TTN_lblType"));

            //URLAdvancedSearch = Config.person_search;
            //URLShowEntity = Config.person_contact_form_v4;
            //URLShowEntity = string.Concat(Config.person_contact_form_v4, "?id=", 0);
            //id=0&idclient={3}&personcontacttext={2}&personcontactcategor=1&personcontacttype={4}&docview=yes');\">",ID,Env.PersonsRoot,txt,dso.Person.GetItemValue(0),dso.Type.GetItemValue(0));

            var employee = new Employee(true);

            // добавление разрешено для роли "Администратор лиц"
            if (employee.HasRole(11))
            {
                URIsCreateEntity = new List <URICreateEntity>
                {
                    new URICreateEntity("/styles/User.gif", Config.person_contact_form_v4,
                                        Resx.GetString("TTN_lblCreateContact"))
                };
            }
        }
        /// <summary>
        ///     Отрисовка таблицы расположения Лиц
        /// </summary>
        private void SetPersonLocationsGridDataSource()
        {
            var sqlParams = new Dictionary <string, object> {
                { "@КодРасположения", _location.Id }
            };

/*
 *          var listColumnVisible = new List<string>
 *          {
 *              "КодСотрудника"
 *          };
 */
            gridPersonLocations.ShowGroupPanel           = false;
            gridPersonLocations.ExistServiceColumn       = false;
            gridPersonLocations.ExistServiceColumnDetail = false;
            gridPersonLocations.RowsPerPage = 100;
            gridPersonLocations.ShowPageBar = false;
            //gridPersonLocations.EmptyDataString = Resx.GetString("Inv_msgNoEmployeesAtLocation");
            gridPersonLocations.SetDataSource(SQLQueries.SELECT_РасположенияЛицВРасположении, Config.DS_user, CommandType.Text, sqlParams);
            //gridPersonLocations.Settings.SetColumnDisplayVisible(listColumnVisible, false);
            gridPersonLocations.Settings.SetColumnNoWrapText("Компания");
            gridPersonLocations.Settings.SetColumnHeaderAlias("Компания", Resx.GetString("Inv_lblCompany"));

            //gridPersonLocations.Settings.SetColumnHrefEmployee("Сотрудник", "КодСотрудника");
            gridPersonLocations.RefreshGridData();
            gridPersonLocations.Visible = gridPersonLocations.GеtRowCount() > 0;
        }
        /// <summary>
        ///     Сохранение расположений
        /// </summary>
        private void SaveData(string type)
        {
            try
            {
                if (type == "AddLocation")
                {
                    var sqlParams = new Dictionary <string, object>
                    {
                        { "@Расположение", tbNode.Value },
                        { "@РабочееМесто", 0 },
                        { "@Parent", LocationId }
                    };
                    var locationId = DBManager.ExecuteScalar(SQLQueries.INSERT_Расположения, CommandType.Text,
                                                             Config.DS_user, sqlParams);
                }
                else
                {
                    var sqlParams = new Dictionary <string, object>
                    {
                        { "@КодРасположения", LocationId },
                        { "@Расположение", tbNode.Value }
                    };
                    DBManager.ExecuteNonQuery(SQLQueries.UPDATE_Расположения, CommandType.Text, Config.DS_user, sqlParams);
                    LoadDataLocation(LocationId);
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex.Message, Resx.GetString("alertError"));
            }

            JS.Write("Wait.render(false);");
            JS.Write("v4_closeLocationForm();");
            JS.Write("v4_reloadNode('tvLocation');");
        }
示例#10
0
        /// <summary>
        ///     Инициализируем коллекцию условий и устанавливаем другие свойства составного контрола
        /// </summary>
        public override void V4OnInit()
        {
            if (!IsUseCondition) return;
            _list.Add(new Item(((int) NumbersEnum.Equally).ToString(CultureInfo.InvariantCulture),
                "(=) " + Resx.GetString("cEqually")));
            _list.Add(new Item(((int) NumbersEnum.More).ToString(CultureInfo.InvariantCulture),
                "(>) " + Resx.GetString("cMore")));
            _list.Add(new Item(((int) NumbersEnum.Less).ToString(CultureInfo.InvariantCulture),
                "(<) " + Resx.GetString("cLess")));
            _list.Add(new Item(((int) NumbersEnum.MoreOrEqual).ToString(CultureInfo.InvariantCulture),
                "(>=) " + Resx.GetString("cMoreOrEqual")));
            _list.Add(new Item(((int) NumbersEnum.LessOrEqual).ToString(CultureInfo.InvariantCulture),
                "(<=) " + Resx.GetString("cLessOrEqual")));
            _list.Add(new Item(((int) NumbersEnum.NotEqual).ToString(CultureInfo.InvariantCulture),
                "(<>) " + Resx.GetString("cNotEqual")));
            _list.Add(new Item(((int) NumbersEnum.Interval).ToString(CultureInfo.InvariantCulture),
                Resx.GetString("dInterval")));
            if (!IsNotUseEmpty)
            {
                _list.Add(new Item(((int) NumbersEnum.Any).ToString(CultureInfo.InvariantCulture),
                    Resx.GetString("lblAnyValue")));
                _list.Add(new Item(((int) NumbersEnum.NoValue).ToString(CultureInfo.InvariantCulture),
                    Resx.GetString("lblNotValue")));
            }

            IsUseCondition = true;
        }
        /// <summary>
        ///     Отрисовка таблицы сотрудников
        /// </summary>
        private void SetEmployeeGridDataSource()
        {
            var sqlParams = new Dictionary <string, object> {
                { "@КодРасположения", _location.Id }
            };

            var listColumnVisible = new List <string>
            {
                "КодСотрудника"
            };

            gridEmployees.ShowGroupPanel           = false;
            gridEmployees.ExistServiceColumn       = false;
            gridEmployees.ExistServiceColumnDetail = false;
            gridEmployees.RowsPerPage     = 100;
            gridEmployees.ShowPageBar     = false;
            gridEmployees.EmptyDataString = Resx.GetString("Inv_msgNoEmployeesAtLocation");
            gridEmployees.SetDataSource(SQLQueries.SELECT_СотрудникиВРасположении, Config.DS_user, CommandType.Text,
                                        sqlParams);
            gridEmployees.Settings.SetColumnDisplayVisible(listColumnVisible, false);
            gridEmployees.Settings.SetColumnNoWrapText("Сотрудник");
            gridEmployees.Settings.SetColumnHrefEmployee("Сотрудник", "КодСотрудника");
            gridEmployees.Settings.SetColumnHeaderAlias("Сотрудник", Resx.GetString("Inv_lblEmployee"));
            //gridEmployees.Settings.TableColumns.
            gridEmployees.RefreshGridData();
        }
示例#12
0
        GetInterestRate
        (
            string currency
        )
        {
            try
            {
                // Is the read time of the interest rates document older than the
                // set amount?
                if (DateTime.UtcNow.Subtract(TimeRead).TotalHours
                    > ReadTimeExpiration || !InterestRateDict.ContainsKey(currency))
                {
                    // Re-initialize the currency interest rate table
                    InitCurrencyInterestRates();
                }

                // Return the rate converted to a decimal
                return(InterestRateDict[currency]);
            }
            catch (Exception e)
            {
                LogHelper.Log(LogLevel.Error, $"    {Resx.GetString("ERROR")}: For {currency} " + e.Message);
            }

            return(0.0);
        }
示例#13
0
        protected override void EntityFieldInit()
        {
            if (!V4IsPostBack)
            {
                id           = Request.QueryString["id"];
                idDoc        = Request.QueryString["idDoc"];
                idParentPage = Request.QueryString["idpp"];
                resultGuid   = Request.QueryString["idResult"];

                ParentPage = KescoHub.GetPage(idParentPage) as Nakladnaya;

                if (ParentPage == null)
                {
                    ShowMessage(Resx.GetString("errRetrievingPageObject"), Resx.GetString("errPrinting"), MessageStatus.Error);
                    return;
                }

                if (Request.QueryString["sf"] != null)
                {
                    efShipperStore.Value = Request.QueryString["sf"].Length == 0 ? "0" : Request.QueryString["sf"];
                }
                if (Request.QueryString["st"] != null)
                {
                    efPayerStore.Value = Request.QueryString["st"].Length == 0 ? "0" : Request.QueryString["st"];
                }
            }

            base.EntityFieldInit();
        }
示例#14
0
        /// <summary>
        ///     Кнопка: Сохранить
        /// </summary>
        private void SaveData()
        {
            #region Проверка идентичности ГО/ГП, транспортных узлов в выбранных отправках

            var info = string.Empty;
            if (ParentPage.CheckIdentity(resultGuid, out info))
            {
                var stavkaNDS = new StavkaNDS(efNDS.Value);

                var reloadParentForm = false;
                if (idDoc == "0")
                {
                    List <DBCommand> cmds = null;
                    Document.Save(false, cmds);
                    idDoc            = Document.DocId.ToString();
                    reloadParentForm = true;
                }


                ParentPage.Document.FillPositionsByGuid(new Guid(resultGuid), int.Parse(efNDS.Value), Lib.ConvertExtention.Convert.Str2Decimal(efCost.Value), (decimal)stavkaNDS.Величина, efShipperStore.Value, efPayerStore.Value);

                JS.Write("parent.vagon_Records_Save('{0}');", reloadParentForm);
            }
            else
            {
                if (info != string.Empty)
                {
                    ShowMessage(info, Resx.GetString("errPrinting"), MessageStatus.Error);
                }
            }
            #endregion
        }
        /// <summary>
        ///     Инициализируем коллекцию условий и устанавливаем другие свойства составного контрола
        /// </summary>
        public override void V4OnInit()
        {
            if (!IsUseCondition)
            {
                return;
            }
            _list.Add(new Item(((int)DatePickerEnum.Equal).ToString(CultureInfo.InvariantCulture),
                               Resx.GetString("dEqual")));
            _list.Add(new Item(((int)DatePickerEnum.LessOrEqual).ToString(CultureInfo.InvariantCulture),
                               Resx.GetString("dLessOrEqual")));
            _list.Add(new Item(((int)DatePickerEnum.MoreOrEqual).ToString(CultureInfo.InvariantCulture),
                               Resx.GetString("dMoreOrEqual")));
            _list.Add(new Item(((int)DatePickerEnum.Interval).ToString(CultureInfo.InvariantCulture),
                               Resx.GetString("dInterval")));
            if (!IsNotUseEmpty)
            {
                _list.Add(new Item(((int)DatePickerEnum.Any).ToString(CultureInfo.InvariantCulture),
                                   Resx.GetString("lblAnyValue")));
                _list.Add(new Item(((int)DatePickerEnum.Null).ToString(CultureInfo.InvariantCulture),
                                   Resx.GetString("dNull")));
            }

            IsUseCondition = true;

            //TODO: Ограничение по мин и макс дате для TextBox
        }
示例#16
0
        /// <summary>
        ///     Подготовка данных для отрисовки заголовка страницы(панели с кнопками)
        /// </summary>
        /// <returns></returns>
        protected string RenderHeader()
        {
            using (var w = new StringWriter())
            {
                var btnEdit = MenuButtons.Find(btn => btn.ID == "btnEdit");
                RemoveMenuButton(btnEdit);
                var btnSave = MenuButtons.Find(btn => btn.ID == "btnSave");
                RemoveMenuButton(btnSave);
                var btnApply = MenuButtons.Find(btn => btn.ID == "btnApply");
                RemoveMenuButton(btnApply);
                var btnReCheck = MenuButtons.Find(btn => btn.ID == "btnReCheck");
                RemoveMenuButton(btnReCheck);
                var btnRefresh = MenuButtons.Find(btn => btn.ID == "btnRefresh");
                RemoveMenuButton(btnRefresh);

                var btnMove = new Button
                {
                    ID           = "btnMove",
                    V4Page       = this,
                    Text         = Resx.GetString("Users_lblMoveEquipment"),
                    Title        = Resx.GetString("Users_lblMoveEquipment"),
                    IconJQueryUI = ButtonIconsEnum.Copy,
                    Width        = 205,
                    OnClick      = "Move();"
                };
                AddMenuButton(btnMove);

                RenderButtons(w);

                return(w.ToString());
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!V4IsPostBack)
     {
         divTitle.Value = string.Format("{0}: {1}", typeNabor == "Shipper" ? Resx.GetString("TTN_lblSetArrival") : Resx.GetString("TTN_lblSetCost"), typeNabor == "Shipper" ? mris.ShipperStore.Name : mris.PayerStore.Name);
     }
 }
示例#18
0
        /// <summary>
        ///     Заполнение списка
        /// </summary>
        /// <param name="search">Строка поиска</param>
        /// <returns>Список</returns>
        public override IEnumerable FillSelect(string search)
        {
            base.FillSelect(search);
            var displayFields             = "Name";
            var anvancedHeaderPopupResult = string.Format("<tr class='gridHeaderSelect v4s_noselect'><td>{0}</td>",
                                                          Resx.GetString("STORE_Name"));

            //if (Filter.StoreTypeId.Value == "")
            //{
            displayFields             += ",StoreTypeName";
            anvancedHeaderPopupResult += string.Format("<td>{0}</td>", Resx.GetString("TTN_lblType"));
            //}
            if (Filter.StoreResourceId.Value == "")
            {
                displayFields             += ",ResourceName";
                anvancedHeaderPopupResult += string.Format("<td>{0}</td>", Resx.GetString("STORE_Resource"));
            }

            displayFields             += ",KeeperName";
            anvancedHeaderPopupResult += string.Format("<td>{0}</td>", Resx.GetString("STORE_Keeper"));

            if (Filter.ManagerId.Value == "")
            {
                displayFields             += ",ManagerName";
                anvancedHeaderPopupResult += string.Format("<td>{0}</td>", Resx.GetString("TTN_lblSteward"));
            }

            DisplayFields             = displayFields;
            AnvancedHeaderPopupResult = anvancedHeaderPopupResult;

            return(GetStores(search, MaxItemsInQuery));
        }
        public override void ProcessCommand(NameValueCollection collection)
        {
            if (collection["v"] != null)
            {
                Like = Convert.ToInt32(collection["v"]);
                var sqlParams = new Dictionary <string, object>
                {
                    { "@КодИдентификатораОценки", LikeId },
                    { "@Оценка", Like }
                };

                try
                {
                    DBManager.ExecuteNonQuery(SQLQueries.INSERT_ОценкиИнтерфейса, CommandType.Text, Config.DS_errors, sqlParams);
                }
                catch (Exception e)
                {
                    V4Page.ShowMessage(e.Message, Resx.GetString("errDoisserWarrning"), MessageStatus.Error);
                    Logger.WriteEx(new DetailedException("Ошибка при установке оценки!", e));
                }

                GetStatus();

                JS.Write("$('#{0}').attr('src','/Styles/{1}.png');", HtmlID + "_L", Like > 0 ? "like" : "like_off");
                JS.Write("gi('{0}').innerHTML = '{1}';", "spL_" + HtmlID, Like > 0 ? Like.ToString() : "");
                JS.Write("$('#{0}').attr('src','/Styles/{1}.png');", HtmlID + "_D", Like < 0 ? "dislike" : "dislike_off");
                JS.Write("gi('{0}').innerHTML = '{1}';", "spR_" + HtmlID, Like < 0 ? (-Like).ToString() : "");
            }

            else
            {
                base.ProcessCommand(collection);
            }
        }
示例#20
0
        /// <summary>
        ///     Обработка списка документов
        /// </summary>
        /// <param name="w"></param>
        /// <param name="dv"></param>
        private void GetLinkedDocsInfo(TextWriter w, DataView dv)
        {
            if (V4Page.Doc.IsNew || V4Page.Doc.Unavailable || V4Page.Doc.DataUnavailable)
            {
                return;
            }

            var dt = Document.LoadSequelDocs(V4Page.Doc.Id);

            if (dv.Count > 0)
            {
                w.Write(
                    "<img id=\"img_doc\" style=\"border:0;cursor:pointer;\" border=\"0\" src=\"/styles/new.gif\" title=\"{0}\" ",
                    Resx.GetString("listNewDoc"));
                w.Write("onclick=\"cmd('cmd', 'Listener', 'ctrlId', {0}, 'cmdName', 'OpenLinkedDoc')\"",
                        LinkedDocCmdListnerIndex);
                w.Write("/>&nbsp;{0}:", Resx.GetString("listFollowType"));
            }

            for (var i = 0; i < dv.Count; i++)
            {
                var dtable = dt.Clone();
                var query  = dt.AsEnumerable().Where(dr =>
                                                     dr.Field <int>("КодТипаДокумента").Equals(dv[i]["КодТипаДокументаВытекающего"]));
                query.CopyToDataTable(dtable, LoadOption.OverwriteChanges);

                RenderLinkedDocsInfoDetails(w, dtable,
                                            Resx.GetString("listFollowType"),
                                            Resx.GetString("oneFollowType"),
                                            dv[i]["КодТипаДокументаВытекающего"].ToString(), dv[i]["ТипСвязи"].ToString(),
                                            dv[i]["КодПоляДокумента"].ToString(),
                                            dv[i]["ПолеДокумента"].ToString(), dv[i]["ПолеДокументаEn"].ToString());
            }
        }
        SaveInComboList
            ()

        {
            try
            {
                // Does the combo order list need to be initialized
                if (comboOrders == null)
                {
                    comboOrders = new List <OrderSubmission>();
                }

                // Add this order to the combo order list
                comboOrders.Add(this);

                // Return with success
                return(true);
            }
            catch (Exception e)
            {
                // Log error
                LogHelper.Log(LogLevel.Error, $"    {Resx.GetString("ERROR")}: {Resx.GetString("SAVING_COMBO_OPTION_ORDER")}. " + e.Message);

                // Return with failure
                return(false);
            }
        }
示例#22
0
        //public BaseException(string log, Enum code, Exception innerException) : base(log, innerException)
        //{
        //    this.LogName = log;
        //    this.Code = Convert.ToInt32(code);
        //    Tag = code.ToString();
        //    Save();
        //}

        //protected BaseException(SerializationInfo info, StreamingContext context) : base(info, context)
        //{
        //    Save();
        //}

        protected string Dscription()
        {
            if (Code < 0)
            {
                return($"({Code * -1}) {String.Join(". ", Values)}");
            }


            var ResxName = $"M{Code.ToString("00000")}_{Values.Length}";

            //klib.content.Location.resources
            var msg = String.Empty;

            try
            {
                msg = Resx.GetString(ResxName);
                msg = msg ?? $"Args ({Values.Length}): {String.Join(", ", Values)}";
                msg = String.Format($"[{Code:X}] " + msg, Values);
            }
            catch (ArgumentException ex)
            {
                Diagnostic.Error(R.ID, LOG, ex.Message, ex.StackTrace, ex.Source);
                msg = $"{msg} - Args ({Values.Length}): {String.Join(", ", Values)}";
            }

            return(msg);
        }
示例#23
0
        private void DBSStore_RenderText(string rsId, string ctrlId)
        {
            var sb = new StringBuilder();

            if (string.IsNullOrEmpty(rsId))
            {
                sb.Append("");
            }
            else
            {
                var s = new Lib.Entities.Stores.Store(rsId);
                if (s != null && !s.Unavailable)
                {
                    var bankName    = "";
                    var bankAddress = "";
                    var bankKpp     = "";

                    var bank = GetPerson(s.KeeperId, radioLang.Value, ref bankName, ref bankAddress, ref bankKpp);

                    sb.AppendFormat("{0}: ",
                                    radioLang.Value == "en" ? "Bank" : Resx.GetString("STORE_SP_Lbl_Data_Bank"));

                    sb.Append(bankName);
                    sb.Append(" ");
                    sb.Append(bankAddress);

                    sb.Append(radioLang.Value == "en"
                        ? " SWIFT: " + bank.SWIFT
                        : $"{(bank.BIK.Length > 0 ? $" БИК: {bank.BIK}" : "")}{(bank.CorrAccount.Length > 0 ? $" К/С: {bank.CorrAccount}" : "")}");
                }
            }

            SetTextValue(sb.ToString(), ctrlId);
        }
        /// <summary>
        ///     Инициализация контролов
        /// </summary>
        protected override void EntityFieldInit()
        {
            efStatus.DataItems = new Dictionary <string, object>
            {
                { "0", Resx.GetString("Users_fldWorks") },          // работает
                { "1", Resx.GetString("Users_fldDecreeHoliday") },  // декр.отпуск
                { "2", Resx.GetString("Users_fldGuestPersonal") },  // гость персональный
                { "3", Resx.GetString("Users_fldFired") },          // уволен
                { "4", Resx.GetString("Users_fldGuestCardGuest") }, // гость по гостевой карточке
                { "5", Resx.GetString("Users_fldOutsider") } // посторонний
            };

            efLang.DataItems = new Dictionary <string, object>
            {
                { "ru", "ru" },
                { "en", "en" },
                { "fr", "fr" },
                { "de", "de" }
            };

            efAreaRegistrationLink.Title = Resx.GetString("Users_lblOpenDossierOfIndividuals");
            efAreaRegistrationLink.Text  =
                Resx.GetString("Users_ntfNoCountryOfRegistration"); // У физ.лица не указана страна регистрации

            efBirthDateLink.Title = Resx.GetString("Users_lblOpenDossierOfIndividuals");
            efBirthDateLink.Text  = Resx.GetString("Users_ntfNoBirthDate");        // У физ.лица не указана дата рождения

            efINNLink.Title = Resx.GetString("Users_lblOpenDossierOfIndividuals"); // У физ.лица не указан ИНН
            efINNLink.Text  = Resx.GetString("Users_ntfNoINN");

            btnUnLock.Visible = CurrentUser.HasRole((int)Role.Дежурный_инженер) || CurrentUser.HasRole((int)Role.Сотрудник_службы_поддержки_пользователей);

            base.EntityFieldInit();
        }
示例#25
0
        /// <summary>
        ///     Отрисовка контрола
        /// </summary>
        /// <param name="w">Поток</param>
        public override void RenderControl(TextWriter w)
        {
            w.Write("<div id='{0}_0' class='{1}' style='display:none'>", HtmlID, CSSClass);
            w.Write("<table>");
            w.Write(
                "<tr><td id='{0}_head' width='100%' style='background:darkgray; text-align: center'><font color=\"white\" style=\"font-weight: bold\">{1}</font><img align=\"left\" src=\"\\Styles\\Notes.gif\"/><img align=\"right\" src=\"\\Styles\\Cancel.gif\" border=\"0\" onclick='v4_cometChatHide(\"{0}\")'/></td><td></td></tr>",
                HtmlID, Resx.GetString("lblChat"));
            w.Write("<tr><td colspan=2>");
            w.Write("<div id='{0}_3' style='max-height:{1}px;max-width:400px; overflow:auto;'></div>", HtmlID, MaxHeight);
            w.Write("</td></tr>");
            w.Write("<tr><td colspan=2>");
            w.Write(
                "<input id='{0}_2' style='width: 98%; border-radius: 6px; box-shadow:0px 2px 10px 0px grey' onkeydown='return v4_cometChatKeyDown(event);' help='{1}' type='text'></input>",
                HtmlID, HttpUtility.HtmlEncode(Help));
            w.Write("</td></tr>");
            w.Write("</table>");
            w.Write("</div>");
            w.Write(
                "<img id='{0}_1' src=\"/Styles/chat.png\" border=\"0\"  onkeydown='return v4_cometChatShow(\"{0}\");' onclick='v4_cometChatShow(\"{0}\")' help='{1}' {2} />",
                HtmlID, HttpUtility.HtmlEncode(Help),
                TabIndex.HasValue ? " tabindex=" + TabIndex.Value : "");

            w.Write(
                "<script>$(\"#{0}_0\").draggable({{ containment: 'window', handle: '#{0}_head', cursor: 'move' }});</script>",
                HtmlID);
        }
        /// <summary>
        ///     Инициализация контролов
        /// </summary>
        private void SetInitValue()
        {
            efCount.Precision = factUsl.ResourceId > 0
                ? factUsl.Resource.GetScale4Unit(factUsl.UnitId.ToString(), 3,
                                                 Document.PlatelschikField.Value.ToString())
                : 3;

            efCostOutNDS.Precision        =
                efSummaOutNDS.Precision   =
                    efSummaNDS.Precision  =
                        efVsego.Precision = Scale;

            var orderList = new Dictionary <string, object>();
            var sqlParams = new Dictionary <string, object> {
                { "@КодДокумента", Document.Id }
            };
            var curOrder = 0;
            var dt       = DBManager.GetData(SQLQueries.SELECT_ID_DOC_ОказанныеУслуги_GRID, Config.DS_document,
                                             CommandType.Text, sqlParams);
            var isNew = factUsl.PositionId == null || factUsl.PositionId.Value == 0;

            if (dt == null || !isNew && dt.Rows.Count < 2 || isNew && dt.Rows.Count < 1)
            {
                OrderPanel.Visible = false;
            }
            else
            {
                orderList.Add("0", Resx.GetString("TTN_lblPutOnFirstPosition"));
                foreach (DataRow row in dt.Rows)
                {
                    if (isNew || row["КодОказаннойУслуги"].ToString() != factUsl.PositionId.Value.ToString())
                    {
                        orderList.Add(row["КодОказаннойУслуги"].ToString(),
                                      row["РесурсРус"] + " [" + row["ЦенаБезНДС"] + "]");
                    }

                    if (!isNew && row["КодОказаннойУслуги"].ToString() == factUsl.PositionId.Value.ToString())
                    {
                        curOrder = orderList.Count;
                    }
                }
            }

            efOrder.DataItems = orderList;
            if (orderList.Count > 1)
            {
                if (factUsl.PositionId == null || factUsl.PositionId.Value == 0)
                {
                    efOrder.Value = orderList.ElementAt(orderList.Count - 1).Key;
                }
                else
                {
                    if (curOrder > 0)
                    {
                        curOrder = curOrder - 1;
                    }
                    efOrder.Value = orderList.ElementAt(curOrder).Key;
                }
            }
        }
 private void ShowCalcMessage(string message)
 {
     if (!message.IsNullEmptyOrZero())
     {
         ShowMessage(Resx.GetString(message), Resx.GetString("errDoisserWarrning"));
     }
 }
        /// <summary>
        ///     Отображает диалоговое окно выбора типа перерасчета
        /// </summary>
        /// <param name="name">Название изменяемого поля</param>
        /// <param name="value">Новое значение изменяемого поля</param>
        /// <param name="ndx">Индекс</param>
        private void DialogRecalc(string name, string value, string ndx)
        {
            var helpText = string.Format(@"
            Нажмите:<br>
					<b>{0}</b> - {1};
					<b>{2}</b> - {3};
					<b>{4}</b> - {5};
					<b>{6}</b> - {7}"                    ,
                                         "OK",
                                         Resx.GetString("TTN_msgOKInfo"),
                                         Resx.GetString("QSBtnRecalc"),
                                         Resx.GetString("TTN_msgRecalcInfo"),
                                         Resx.GetString("QSBtnCancel"),
                                         Resx.GetString("TTN_msgCancel"),
                                         Resx.GetString("QSBtnChange"),
                                         Resx.GetString("TTN_msgChange")
                                         );

            ShowRecalc(helpText, Resx.GetString("TTN_msgOKInfo"), "ОК", Resx.GetString("QSBtnRecalc"),
                       Resx.GetString("QSBtnCancel"), Resx.GetString("QSBtnChange")
                       , "dialogRecalc('DialogRecalc_Yes','" + name + "','" + value + "','" + ndx + "');"
                       , "dialogRecalc('DialogRecalc_Recalc','" + name + "','" + value + "','" + ndx + "');"
                       , "dialogRecalc('DialogRecalc_No','" + name + "','" + value + "','" + ndx + "');"
                       , "dialogRecalc('DialogRecalc_Change','" + name + "','" + value + "','" + ndx + "');"
                       , null, 500);
        }
 /// <summary>
 ///     Инициализация таблицы Территории
 /// </summary>
 private void InitGridTerritory()
 {
     gridTerritory.ExistServiceColumn = true;
     //gridTerritory.SetServiceColumnAdd("rate_add", Resx.GetString("ExRate_btnAddPosition"));
     gridTerritory.EmptyDataString = Resx.GetString("Inv_msgNoTerritories");
     gridTerritory.ShowGroupPanel  = false;
     gridTerritory.RowsPerPage     = 47;
 }
 /// <summary>
 ///     Отображает диалоговое окно выбора вида расчета
 /// </summary>
 /// <param name="name">Название изменяемого поля</param>
 /// <param name="value">Новое значение изменяемого поля</param>
 /// <param name="ndx">Индекс</param>
 private void DialogCostRecalc(string name, string value, string ndx)
 {
     ShowConfirm(Resx.GetString("TTN_msgNDSSUM"), Resx.GetString("TTN_msgChoiceCalculationType"),
                 Resx.GetString("QSBtnYes"), Resx.GetString("QSBtnNo")
                 , "dialogRecalc('DialogCostRecalc_Yes','" + name + "','" + value + "','" + ndx + "');"
                 , "dialogRecalc('DialogCostRecalc_No','" + name + "','" + value + "','" + ndx + "');"
                 , "btnSave", null);
 }