fork download
  1. #region Included Namespaces
  2. using System;
  3. using System.Text;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.HtmlControls;
  10. using SelfMobile.EnumerationTable;
  11. using AjaxControlToolkit;
  12. #endregion
  13.  
  14.  
  15. namespace SelfMobile
  16. {
  17. public partial class PersonalCabinet : System.Web.UI.Page
  18. {
  19. static bool postbackUserInfo = false;
  20.  
  21. protected void Page_Load(object sender, EventArgs e)
  22. {
  23. CheckCookies();
  24. SetCurrentPageEvents();
  25. }
  26.  
  27. protected override void OnInit(EventArgs e)
  28. {
  29. base.OnInit(e);
  30.  
  31. if (IsPostBack)
  32. {
  33. RefreshTableContent();
  34. if (postbackUserInfo) SetSceneMyProfile();
  35. }
  36. }
  37.  
  38. void CheckCookies()
  39. {
  40. if (!AuthProtection.CheckCookiesExist(this.Request)) Response.Redirect("Default.aspx");
  41. }
  42.  
  43. void SetCurrentPageEvents()
  44. {
  45. SetHeadPanel();
  46. SetTabsEvents();
  47. SetDockEvents();
  48. SetSubpanelEvents();
  49. }
  50.  
  51. void SetHeadPanel()
  52. {
  53. this.buttonProfile.Click += new EventHandler(buttonViewMyProfile_Click);
  54. this.buttonViewMyProfile.Click += new EventHandler(buttonViewMyProfile_Click);
  55. this.buttonChangeMyPassword.Click += new EventHandler(buttonChangeMyPassword_Click);
  56. this.buttonMessages.Click += new EventHandler(buttonMessages_Click);
  57. this.buttonExit.Click += new EventHandler(buttonExit_Click);
  58. }
  59.  
  60. void SetDockEvents()
  61. {
  62. this.dockIconMyProfile.Click += new EventHandler(dockIconMyProfile_Click);
  63. this.dockIconMarket.Click += new EventHandler(dockIconMarket_Click);
  64. }
  65.  
  66. void SetTabsEvents()
  67. {
  68. this.tabDashboard.Click += new EventHandler(tabDashboard_Click);
  69. this.tabFirst.Click += new EventHandler(tabFirst_Click);
  70. this.tabSecond.Click += new EventHandler(tabSecond_Click);
  71. }
  72.  
  73. void SetSubpanelEvents()
  74. {
  75. this.buttonChangeCurrentPassword.Click += new EventHandler(buttonChangeCurrentPassword_Click);
  76. }
  77.  
  78. void dockIconMarket_Click(object sender, EventArgs e)
  79. {
  80. SetSceneMarket();
  81. }
  82.  
  83. void dockIconMyProfile_Click(object sender, EventArgs e)
  84. {
  85. SetSceneMyProfile();
  86. }
  87.  
  88. void tabDashboard_Click(object sender, EventArgs e)
  89. {
  90. SetSceneDashboard();
  91. }
  92.  
  93. void tabFirst_Click(object sender, EventArgs e)
  94. {
  95. LinkButton control = (LinkButton)sender;
  96.  
  97. switch (control.Text)
  98. {
  99. case "Мои данные":
  100. SetSceneMyProfile();
  101. break;
  102. case "":
  103.  
  104. break;
  105. }
  106. }
  107.  
  108. void tabSecond_Click(object sender, EventArgs e)
  109. {
  110. LinkButton control = (LinkButton)sender;
  111.  
  112. switch (control.Text)
  113. {
  114. case "Копия данных с ЭЦП":
  115. SetSceneMyProfileTabTokenData();
  116. break;
  117. case "":
  118.  
  119. break;
  120. }
  121. }
  122.  
  123. void buttonViewMyProfile_Click(object sender, EventArgs e)
  124. {
  125. SetSceneMyProfile();
  126. }
  127.  
  128. void buttonChangeMyPassword_Click(object sender, EventArgs e)
  129. {
  130. SetSceneChangePassword();
  131. }
  132.  
  133. void buttonChangeCurrentPassword_Click(object sender, EventArgs e)
  134. {
  135. if (CheckFieldsOfPasswordChange())
  136. {
  137.  
  138. }
  139. else
  140. {
  141. SetPanelAlertText(AlertBoxStyle.Error,
  142. "Поля <b>не должны</b> быть пустыми!",
  143. "boxPasswordChange",
  144. "statePasswordChange");
  145. boxPasswordChange.Visible = true;
  146. }
  147. }
  148.  
  149. bool CheckFieldsOfPasswordChange()
  150. {
  151. if (this.fieldOldPass.Text == String.Empty) return false;
  152. if (this.fieldNewPass.Text == String.Empty) return false;
  153. if (this.fieldNewRepass.Text == String.Empty) return false;
  154. return true;
  155. }
  156.  
  157. void buttonMessages_Click(object sender, EventArgs e)
  158. {
  159.  
  160. }
  161.  
  162. void buttonExit_Click(object sender, EventArgs e)
  163. {
  164. AuthProtection.TruncateCookies(this.Request, this.Response);
  165. }
  166.  
  167. void AddDynamicallyTokenData()
  168. {
  169. InternalApi api = new InternalApi();
  170. Literal tokenData = new Literal();
  171. tokenData.ID = "fullTokenData";
  172. string[] dataToWrite = api.GetTokenInfoByUsername(Request.Cookies["userName"].Value).Split(',');
  173. StringBuilder output = new StringBuilder();
  174. output.Append("<p>");
  175.  
  176. for (int i = 0; i < dataToWrite.Length; i++)
  177. {
  178. output.Append(dataToWrite[i]);
  179. output.Append("<br />");
  180. }
  181.  
  182. output.Append("</p>");
  183. tokenData.Text = output.ToString();
  184. this.contentViewTokendata.Controls.Add(tokenData);
  185. }
  186.  
  187. void AddDynamicallyFullUserInfo()
  188. {
  189. InternalApi api = new InternalApi();
  190.  
  191. // fetching Web Data from DB
  192. Literal webData = new Literal();
  193. webData.ID = "fullUserInfo";
  194. webData.Text = "<p>" + api.GetFullUserInfo(Request.Cookies["userName"].Value) + "</p>";
  195.  
  196. // init controls
  197. LinkButton buttonEditData = new LinkButton();
  198. buttonEditData.ID = "buttonEditUserInfo";
  199. buttonEditData.CssClass = "button round blue image-right ic-edit text-upper";
  200. buttonEditData.Click += new EventHandler(buttonEditData_Click);
  201. buttonEditData.Text = "Изменить личные данные";
  202.  
  203. // adding controls to User Info panel
  204. this.contentViewWebdata.Controls.Add(webData);
  205. this.contentViewWebdata.Controls.Add(buttonEditData);
  206. postbackUserInfo = true;
  207. }
  208.  
  209. void buttonEditData_Click(object sender, EventArgs e)
  210. {
  211. this.contentViewWebdata.Controls.Clear();
  212. SetSceneEditableUserInfo();
  213. }
  214.  
  215. void SetSceneEditableUserInfo()
  216. {
  217. // init objects
  218. InternalApi api = new InternalApi();
  219. var serializedData = api.GetSerializedUserInfo(Request.Cookies["userName"].Value);
  220.  
  221. // <p> start
  222. this.contentViewWebdata.Controls.Add(Page.ParseControl("<p>"));
  223.  
  224. // set User GUID editable field
  225. Label labelUserGuid = new Label();
  226. labelUserGuid.ID = "editableLabelUserGuid";
  227. labelUserGuid.Text = "GUID-идентификатор пользователя: ";
  228. TextBox editableUserGuid = new TextBox();
  229. editableUserGuid.ID = "editableTextBoxUserGuid";
  230. editableUserGuid.CssClass = "round default-width-input";
  231. editableUserGuid.Text = serializedData.guid.ToString();
  232. editableUserGuid.Enabled = false;
  233. this.contentViewWebdata.Controls.Add(labelUserGuid);
  234. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  235. this.contentViewWebdata.Controls.Add(editableUserGuid);
  236. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  237.  
  238. // set Username editable field
  239. Label labelUserName = new Label();
  240. labelUserName.ID = "editableLabelUserName";
  241. labelUserName.Text = "Логин: ";
  242. TextBox editableUserName = new TextBox();
  243. editableUserName.ID = "editableTextBoxUserName";
  244. editableUserName.CssClass = "round default-width-input";
  245. editableUserName.Text = serializedData.login;
  246. editableUserName.Enabled = false;
  247. this.contentViewWebdata.Controls.Add(labelUserName);
  248. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  249. this.contentViewWebdata.Controls.Add(editableUserName);
  250. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  251.  
  252. // set User E-mail editable field
  253. Label labelUserEmail = new Label();
  254. labelUserEmail.ID = "editableLabelUserEmail";
  255. labelUserEmail.Text = "E-mail: ";
  256. TextBox editableUserEmail = new TextBox();
  257. editableUserEmail.ID = "editableTextBoxUserEmail";
  258. editableUserEmail.CssClass = "round default-width-input";
  259. editableUserEmail.Text = serializedData.email;
  260. this.contentViewWebdata.Controls.Add(labelUserEmail);
  261. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  262. this.contentViewWebdata.Controls.Add(editableUserEmail);
  263. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  264.  
  265. // set User surname editable field
  266. Label labelUserSurname = new Label();
  267. labelUserSurname.ID = "editableLabelRealName";
  268. labelUserSurname.Text = "Фамилия: ";
  269. TextBox editableUserSurname = new TextBox();
  270. editableUserSurname.ID = "editableTextBoxRealName";
  271. editableUserSurname.CssClass = "round default-width-input";
  272. editableUserSurname.Text = serializedData.surname;
  273. this.contentViewWebdata.Controls.Add(labelUserSurname);
  274. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  275. this.contentViewWebdata.Controls.Add(editableUserSurname);
  276. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  277.  
  278. // set User real name editable field
  279. Label labelUserRealName = new Label();
  280. labelUserRealName.ID = "editableLabelRealName";
  281. labelUserRealName.Text = "Имя: ";
  282. TextBox editableUserRealName = new TextBox();
  283. editableUserRealName.ID = "editableTextBoxRealName";
  284. editableUserRealName.CssClass = "round default-width-input";
  285. editableUserRealName.Text = serializedData.name;
  286. this.contentViewWebdata.Controls.Add(labelUserRealName);
  287. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  288. this.contentViewWebdata.Controls.Add(editableUserRealName);
  289. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  290.  
  291. // set User second name editable field
  292. Label labelUserSecondName = new Label();
  293. labelUserSecondName.ID = "editableLabelSecondName";
  294. labelUserSecondName.Text = "Отчество: ";
  295. TextBox editableUserSecondName = new TextBox();
  296. editableUserSecondName.ID = "editableTextBoxSecondName";
  297. editableUserSecondName.CssClass = "round default-width-input";
  298. editableUserSecondName.Text = serializedData.secondName;
  299. this.contentViewWebdata.Controls.Add(labelUserSecondName);
  300. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  301. this.contentViewWebdata.Controls.Add(editableUserSecondName);
  302. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  303.  
  304. // set User birthdate
  305. Label labelUserBirthdate = new Label();
  306. labelUserBirthdate.ID = "editableLabelSecondName";
  307. labelUserBirthdate.Text = "Дата рождения: ";
  308. TextBox editableBirthdate = new TextBox();
  309. editableBirthdate.ID = "editableTextBoxBirthday";
  310. editableBirthdate.CssClass = "round default-width-input";
  311. CalendarExtender birthdateCalendar = new CalendarExtender();
  312. birthdateCalendar.ID = "calendarExtender" + Guid.NewGuid().ToString();
  313. birthdateCalendar.TargetControlID = "editableTextBoxBirthday";
  314. this.contentViewWebdata.Controls.Add(labelUserBirthdate);
  315. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  316. this.contentViewWebdata.Controls.Add(editableBirthdate);
  317. this.contentViewWebdata.Controls.Add(birthdateCalendar);
  318. this.contentViewWebdata.Controls.Add(Page.ParseControl("<br />"));
  319.  
  320. // </p> end
  321. this.contentViewWebdata.Controls.Add(Page.ParseControl("</p>"));
  322. }
  323.  
  324. void SetSceneDashboard()
  325. {
  326. // Dock
  327. this.dock.Visible = true;
  328.  
  329. // CSS
  330. this.tabDashboard.CssClass = "active-tab dashboard-tab";
  331. this.tabFirst.CssClass = String.Empty;
  332. this.tabSecond.CssClass = String.Empty;
  333. this.tabThird.CssClass = String.Empty;
  334. this.tabFourth.CssClass = String.Empty;
  335.  
  336. // Text
  337. this.tabFirst.Text = String.Empty;
  338. this.tabSecond.Text = String.Empty;
  339. this.tabThird.Text = String.Empty;
  340. this.tabFourth.Text = String.Empty;
  341.  
  342. // Visible
  343. this.tabFirst.Visible = false;
  344. this.tabSecond.Visible = false;
  345. this.tabThird.Visible = false;
  346. this.tabFourth.Visible = false;
  347.  
  348. // Content panel head
  349. this.contentTitle.Text = String.Empty;
  350. this.contentHeader.Visible = false;
  351.  
  352. // Content panel views
  353. this.contentMarket.Visible = false;
  354. this.contentViewWebdata.Visible = false;
  355. this.contentViewTokendata.Visible = false;
  356. this.contentСhangePassword.Visible = false;
  357.  
  358. // Subpanels controls
  359. this.tableMarket.Visible = false;
  360. this.boxPasswordChange.Visible = false;
  361. this.statePasswordChange.Visible = false;
  362. }
  363.  
  364. void SetSceneMarket()
  365. {
  366. // Dock
  367. this.dock.Visible = false;
  368.  
  369. // CSS
  370. this.tabDashboard.CssClass = "dashboard-tab";
  371. this.tabFirst.CssClass = "active-tab";
  372. this.tabSecond.CssClass = String.Empty;
  373. this.tabThird.CssClass = String.Empty;
  374. this.tabFourth.CssClass = String.Empty;
  375.  
  376. // Text
  377. this.tabFirst.Text = "Все предложения";
  378. this.tabSecond.Text = "Мои избранные заявки";
  379. this.tabThird.Text = "Мои текущие заявки на кредит";
  380. this.tabFourth.Text = "История моих заявок";
  381.  
  382. // Visible
  383. this.tabFirst.Visible = true;
  384. this.tabSecond.Visible = true;
  385. this.tabThird.Visible = true;
  386. this.tabFourth.Visible = true;
  387.  
  388. // Content panel head
  389. this.contentTitle.Text = "Cписок всех предложений";
  390. this.contentHeader.Visible = true;
  391.  
  392. // Free panel controls
  393. this.contentViewWebdata.Controls.Clear();
  394. this.contentViewTokendata.Controls.Clear();
  395.  
  396. // Content panel views
  397. this.contentMarket.Visible = true;
  398. this.contentViewWebdata.Visible = true;
  399. this.contentViewTokendata.Visible = false;
  400. this.contentСhangePassword.Visible = false;
  401.  
  402. // Subpanels controls
  403. this.tableMarket.Visible = true;
  404. this.boxPasswordChange.Visible = false;
  405. this.statePasswordChange.Visible = false;
  406.  
  407. RefreshTableContent();
  408. }
  409.  
  410. void RefreshTableContent()
  411. {
  412. ClearOldContentFromTable();
  413. SetTableHeadForSceneMarket();
  414. SetTableBodyForSceneMarket();
  415. }
  416.  
  417. void ClearOldContentFromTable()
  418. {
  419. this.tableMarket = new Table();
  420. this.tableHeader = new TableHeaderRow();
  421. this.tableMarket.Controls.Add(tableHeader);
  422. this.contentMarket.Controls.Clear();
  423. this.contentMarket.Controls.Add(tableMarket);
  424. }
  425.  
  426. void SetTableHeadForSceneMarket()
  427. {
  428. /* Set header of current table */
  429.  
  430. // First cell
  431. TableHeaderCell cellFirst = new TableHeaderCell();
  432. cellFirst.ID = "cellCheckBoxSelectAll";
  433. CheckBox checkBoxSelectAll = new CheckBox();
  434. checkBoxSelectAll.ID = "checkBoxSelectAll";
  435. cellFirst.Controls.Add(checkBoxSelectAll);
  436.  
  437. // Second cell
  438. TableHeaderCell cellSecond = new TableHeaderCell();
  439. cellSecond.ID = "cellBankNames";
  440. cellSecond.Text = "Наименование банка";
  441.  
  442. // Third cell
  443. TableHeaderCell cellThird = new TableHeaderCell();
  444. cellThird.ID = "cellCreditSum";
  445. cellThird.Text = "Сумма кредита";
  446.  
  447. // Fourth cell
  448. TableHeaderCell cellFourth = new TableHeaderCell();
  449. cellFourth.ID = "cellPercentage";
  450. cellFourth.Text = "Процент";
  451.  
  452. // Fifth cell
  453. TableHeaderCell cellFifth = new TableHeaderCell();
  454. cellFifth.ID = "cellCredittime";
  455. cellFifth.Text = "Срок кредита";
  456.  
  457. // Sixth cell
  458. TableHeaderCell cellSixth = new TableHeaderCell();
  459. cellSixth.ID = "cellActions";
  460. cellSixth.Text = "Действия";
  461.  
  462. // Add cells to current header
  463. tableHeader.Controls.Add(cellFirst);
  464. tableHeader.Controls.Add(cellSecond);
  465. tableHeader.Controls.Add(cellThird);
  466. tableHeader.Controls.Add(cellFourth);
  467. tableHeader.Controls.Add(cellFifth);
  468. tableHeader.Controls.Add(cellSixth);
  469.  
  470. // Finally
  471. this.tableMarket.Controls.Add(tableHeader);
  472. }
  473.  
  474. void SetTableBodyForSceneMarket()
  475. {
  476. InternalApi api = new InternalApi();
  477. var offers = api.GetAllOffersStandardInfo();
  478. var enumerator = offers.GetEnumerator();
  479. int rowCounter = 0;
  480.  
  481. while (enumerator.MoveNext())
  482. {
  483. TableRow row = new TableRow();
  484. row.ID = "rowData" + rowCounter.ToString();
  485.  
  486. // init CheckBox for row
  487. TableCell cellSelectButton = new TableCell();
  488. CheckBox checkBox = new CheckBox();
  489. checkBox.ID = "checkBoxRow" + "offerId" + enumerator.Current.offerId + "rowNumber" + rowCounter.ToString();
  490. cellSelectButton.Controls.Add(checkBox);
  491.  
  492. // init Bank Name for row
  493. TableCell cellBank = new TableCell();
  494. cellBank.ID = "bankId" + enumerator.Current.bankId + "rowNumber" + rowCounter.ToString();
  495. cellBank.Text = enumerator.Current.bankName;
  496.  
  497. // init Offer Sum for row
  498. TableCell cellOfferSum = new TableCell();
  499. cellOfferSum.ID = "offerSumOfferId" + enumerator.Current.offerId + "rowNumber" + rowCounter.ToString();
  500. cellOfferSum.Text = enumerator.Current.offerSum.ToString();
  501.  
  502. // init Offer Percentage for row
  503. TableCell cellOfferPercentage = new TableCell();
  504. cellOfferPercentage.ID = "offerPercentageOfferId" + enumerator.Current.offerId + "rowNumber" + rowCounter.ToString();
  505. cellOfferPercentage.Text = enumerator.Current.offerPercentage.ToString() + " %";
  506.  
  507. // init Offer Credit Time for row
  508. TableCell cellOfferCreditTime = new TableCell();
  509. cellOfferCreditTime.ID = "offerCreditTimeOfferId" + enumerator.Current.offerId + "rowNumber" + rowCounter.ToString();
  510. cellOfferCreditTime.Text = enumerator.Current.offerCreditTime;
  511.  
  512. /* init Action Buttons for row */
  513. TableCell cellActions = new TableCell();
  514. cellActions.ID = "offerActionsOfferId" + enumerator.Current.offerId;
  515. // button View More for cell
  516. LinkButton buttonViewExpanded = new LinkButton();
  517. buttonViewExpanded.ID = "buttonViewExpandedOfferId" + enumerator.Current.offerId + "rowNumber" + rowCounter.ToString();
  518. buttonViewExpanded.CssClass = "table-actions-button ic-table-info";
  519. buttonViewExpanded.Click += new EventHandler(buttonViewExpanded_Click);
  520. buttonViewExpanded.ToolTip = "посмотреть расширенное описание предложения";
  521. cellActions.Controls.Add(buttonViewExpanded);
  522. // add space between actions icons
  523. Literal spaceControl = new Literal();
  524. spaceControl.ID = "spaceLiteral" + rowCounter.ToString() + Guid.NewGuid().ToString();
  525. spaceControl.Text = " ";
  526. cellActions.Controls.Add(spaceControl);
  527. // button Add to Favourites for cell
  528. LinkButton buttonAddToFavourites = new LinkButton();
  529. buttonAddToFavourites.ID = "buttonAddToFavouritesOfferId" + enumerator.Current.offerId + "rowNumber" + rowCounter.ToString();
  530. buttonAddToFavourites.CssClass = "table-actions-button ic-table-favourite";
  531. buttonAddToFavourites.Click += new EventHandler(buttonAddToFavourites_Click);
  532. buttonAddToFavourites.ToolTip = "добавить в избранное";
  533. cellActions.Controls.Add(buttonAddToFavourites);
  534. /* end of Action Buttons */
  535.  
  536. // add Cells to Rows
  537. row.Cells.Add(cellSelectButton);
  538. row.Cells.Add(cellBank);
  539. row.Cells.Add(cellOfferSum);
  540. row.Cells.Add(cellOfferPercentage);
  541. row.Cells.Add(cellOfferCreditTime);
  542. row.Cells.Add(cellActions);
  543.  
  544. // add Row to Main Table
  545. this.tableMarket.Controls.Add(row);
  546. rowCounter++;
  547. }
  548. }
  549.  
  550. void buttonViewExpanded_Click(object sender, EventArgs e)
  551. {
  552.  
  553. }
  554.  
  555. void buttonAddToFavourites_Click(object sender, EventArgs e)
  556. {
  557.  
  558. }
  559.  
  560. void SetSceneMyProfile()
  561. {
  562. // Dock
  563. this.dock.Visible = false;
  564.  
  565. // CSS
  566. this.tabDashboard.CssClass = "dashboard-tab";
  567. this.tabFirst.CssClass = "active-tab";
  568. this.tabSecond.CssClass = String.Empty;
  569. this.tabThird.CssClass = String.Empty;
  570. this.tabFourth.CssClass = String.Empty;
  571.  
  572. // Text
  573. this.tabFirst.Text = "Мои данные";
  574. this.tabSecond.Text = "Копия данных с ЭЦП";
  575. this.tabThird.Text = String.Empty;
  576. this.tabFourth.Text = String.Empty;
  577.  
  578. // Visible
  579. this.tabFirst.Visible = true;
  580. this.tabSecond.Visible = true;
  581. this.tabThird.Visible = false;
  582. this.tabFourth.Visible = false;
  583.  
  584. // Content panel head
  585. this.contentTitle.Text = "Просмотр регистрационных данных";
  586. this.contentHeader.Visible = true;
  587.  
  588. // Content panel views
  589. this.contentMarket.Visible = false;
  590. this.contentViewWebdata.Visible = true;
  591. this.contentViewTokendata.Visible = false;
  592. this.contentСhangePassword.Visible = false;
  593.  
  594. // Subpanels controls
  595. this.tableMarket.Visible = false;
  596. this.boxPasswordChange.Visible = false;
  597. this.statePasswordChange.Visible = false;
  598.  
  599. // Update current subpanel data
  600. var control = FindControl("fullUserInfo");
  601. if (control == null) AddDynamicallyFullUserInfo();
  602. }
  603.  
  604. void SetSceneMyProfileTabTokenData()
  605. {
  606. // Dock
  607. this.dock.Visible = false;
  608.  
  609. // CSS
  610. this.tabDashboard.CssClass = "dashboard-tab";
  611. this.tabFirst.CssClass = String.Empty;
  612. this.tabSecond.CssClass = "active-tab";
  613. this.tabThird.CssClass = String.Empty;
  614. this.tabFourth.CssClass = String.Empty;
  615.  
  616. // Text
  617. this.tabFirst.Text = "Мои данные";
  618. this.tabSecond.Text = "Копия данных с ЭЦП";
  619. this.tabThird.Text = String.Empty;
  620. this.tabFourth.Text = String.Empty;
  621.  
  622. // Visible
  623. this.tabFirst.Visible = true;
  624. this.tabSecond.Visible = true;
  625. this.tabThird.Visible = false;
  626. this.tabFourth.Visible = false;
  627.  
  628. // Content panel head
  629. this.contentTitle.Text = "Просмотр резервной копии данных с ЭЦП";
  630. this.contentHeader.Visible = true;
  631.  
  632. // Content panel views
  633. this.contentMarket.Visible = false;
  634. this.contentViewWebdata.Visible = false;
  635. this.contentViewTokendata.Visible = true;
  636. this.contentСhangePassword.Visible = false;
  637.  
  638. // Subpanels controls
  639. this.tableMarket.Visible = false;
  640. this.boxPasswordChange.Visible = false;
  641. this.statePasswordChange.Visible = false;
  642.  
  643. // Update current subpanel data
  644. var control = FindControl("fullTokenData");
  645. if (control == null) AddDynamicallyTokenData();
  646. }
  647.  
  648. void SetSceneChangePassword()
  649. {
  650. // Dock
  651. this.dock.Visible = false;
  652.  
  653. // CSS
  654. this.tabDashboard.CssClass = "dashboard-tab";
  655. this.tabFirst.CssClass = "active-tab";
  656. this.tabSecond.CssClass = String.Empty;
  657. this.tabThird.CssClass = String.Empty;
  658. this.tabFourth.CssClass = String.Empty;
  659.  
  660. // Text
  661. this.tabFirst.Text = "Смена пароля";
  662. this.tabSecond.Text = String.Empty;
  663. this.tabThird.Text = String.Empty;
  664. this.tabFourth.Text = String.Empty;
  665.  
  666. // Visible
  667. this.tabFirst.Visible = true;
  668. this.tabSecond.Visible = false;
  669. this.tabThird.Visible = false;
  670. this.tabFourth.Visible = false;
  671.  
  672. // Content panel head
  673. this.contentTitle.Text = "Обновление пароля для пользователя <b>"
  674. + Request.Cookies["userName"].Value + "</b>";
  675. this.contentHeader.Visible = true;
  676.  
  677. // Content panel views
  678. this.contentMarket.Visible = false;
  679. this.contentViewWebdata.Visible = false;
  680. this.contentViewTokendata.Visible = false;
  681. this.contentСhangePassword.Visible = true;
  682.  
  683. // Subpanels controls
  684. this.tableMarket.Visible = false;
  685. this.boxPasswordChange.Visible = false;
  686. this.statePasswordChange.Visible = false;
  687. }
  688.  
  689. void SetPanelAlertText(AlertBoxStyle boxStyle, string inputText, string panelId, string labelId)
  690. {
  691. Panel box = (Panel)FindControl(panelId);
  692. Label state = (Label)FindControl(labelId);
  693.  
  694. if (box != null && state != null)
  695. {
  696. switch (boxStyle)
  697. {
  698. case AlertBoxStyle.Error:
  699. box.CssClass = "error-box round";
  700. state.Text = inputText;
  701. break;
  702. case AlertBoxStyle.Information:
  703. box.CssClass = "information-box round";
  704. state.Text = inputText;
  705. break;
  706. case AlertBoxStyle.OK:
  707. box.CssClass = "confirmation-box round";
  708. state.Text = inputText;
  709. break;
  710. case AlertBoxStyle.Warning:
  711. box.CssClass = "warning-box round";
  712. state.Text = inputText;
  713. break;
  714. }
  715.  
  716. box.Visible = true;
  717. state.Visible = true;
  718. }
  719. }
  720. }
  721. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(17,55): error CS0234: The type or namespace name `UI' does not exist in the namespace `System.Web'. Are you missing an assembly reference?
prog.cs(7,18): error CS0234: The type or namespace name `UI' does not exist in the namespace `System.Web'. Are you missing an assembly reference?
prog.cs(8,18): error CS0234: The type or namespace name `UI' does not exist in the namespace `System.Web'. Are you missing an assembly reference?
prog.cs(9,18): error CS0234: The type or namespace name `UI' does not exist in the namespace `System.Web'. Are you missing an assembly reference?
prog.cs(10,18): error CS0234: The type or namespace name `EnumerationTable' does not exist in the namespace `SelfMobile'. Are you missing an assembly reference?
prog.cs(11,7): error CS0246: The type or namespace name `AjaxControlToolkit' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(27,33): error CS0115: `SelfMobile.PersonalCabinet.OnInit(System.EventArgs)' is marked as an override but no suitable method found to override
prog.cs(689,32): error CS0246: The type or namespace name `AlertBoxStyle' could not be found. Are you missing a using directive or an assembly reference?
Compilation failed: 8 error(s), 0 warnings
stdout
Standard output is empty