private void Bind_Default_View() { // ToDo -- Check permissions -- if the user is able to view the client / edit the client this.Validate_Permissions(); Common_Tools.Initialize_DropDown_Bank_Accounts(this, this.dropdown_Bank_Account); this.Bind_Credit_Card_Expiration_ComboBoxes(); if (!base.Is_Create_New_Record_Request()) { this.Set_Page_FormControls_Values(); if (!string.IsNullOrEmpty(this.Request.QueryString["mode"])) { if (Request.QueryString["mode"] == "view") { this.Bind_ReadOnly_View(); } else if (Request.QueryString["mode"] == "edit") { Bind_Edit_View(); } } else { this.Bind_ReadOnly_View(); } } else { // Request mode is Create new this.Bind_Create_View(); } }
private void Bind_Default_View() { // Bind users combo box if the current authenticated user is employee/administrator. this.dropdown_User_Selection.DataSource = Business_Logic_Layer_Facade.Instance.Users_Get_Administration_List(base.Authenticated_User_ID); this.dropdown_User_Selection.DataTextField = "FullName_With_Email"; this.dropdown_User_Selection.DataValueField = "User_Id"; this.dropdown_User_Selection.DataBind(); this.dropdown_User_Selection.Items.Insert(0, new ListItem("-- Select -- ", "")); // bind document types Common_Tools.Initialize_DropDown_Document_Types(this.dropdown_General_Document_Type); // bind the combobox of the countries Common_Tools.Initialize_DropDown_Countries(this.dropdown_Sent_By_Entity_Country); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Sent_To_Entity_Country); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Recieved_In_Country); // bind time pickers Common_Tools.Initialize_DropDown_Hours(this.dropdown_Document_Creation_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Document_Creation_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Document_Creation_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Sent_By_Entity_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Sent_By_Entity_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Sent_By_Entity_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Recieved_Document_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Recieved_Document_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Recieved_Document_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Recieved_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Recieved_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Recieved_Time_Seconds); }
private void Bind_Default_View() { // Bind users combo box if the current authenticated user is employee/administrator. this.dropdown_User_Selection.DataSource = Business_Logic_Layer_Facade.Instance.Users_Get_Administration_List(base.Authenticated_User_ID); this.dropdown_User_Selection.DataTextField = "FullName_With_Email"; this.dropdown_User_Selection.DataValueField = "User_Id"; this.dropdown_User_Selection.DataBind(); this.dropdown_User_Selection.Items.Insert(0, new ListItem("-- Select -- ", "")); if (base.User_Is_Administrator) { // If the user is administrator -- auto set the current user id this.dropdown_User_Selection.SelectedValue = base.Authenticated_User_ID.ToString(); this.Bind_DropDown_Supplier_After_User_Id_Selection(); } Common_Tools.Initialize_DropDown_Countries(this.dropdown_Invoiced_Client_To_Country); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Invoice_Supplier_Country); // bind currencies Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); // bind time pickers Common_Tools.Initialize_DropDown_Hours(this.dropdown_Invoice_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Invoice_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Invoice_Time_Seconds); // bind expense types Common_Tools.Initialize_DropDown_Expense_Types(this.dropdown_Expense_Type); }
private void Bind_Default_View() { // ToDo -- Check permissions -- if the user is able to view the client / edit the client this.Validate_Permissions(); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Country); Common_Tools.Initialize_DropDown_Document_Types(this.dropdown_Type); this.Set_Page_FormControls_Values(); if (!string.IsNullOrEmpty(this.Request.QueryString["mode"])) { if (Request.QueryString["mode"] == "view") { this.Bind_ReadOnly_View(); } else if (Request.QueryString["mode"] == "edit") { Bind_Edit_View(); } } else { this.Bind_ReadOnly_View(); } }
private void Bind_Default_View() { Common_Tools.Initialize_DropDown_Countries(this.dropdown_Country); Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); Common_Tools.Initialize_DropDown_Supplier_Types(this.dropdown_Supplier_Type); // Get the default user information for auto complete help var userDetails = Business_Logic_Layer_Facade.Instance.Users_Get_Details_By_User_Id ( base.Authenticated_User_ID, base.Authenticated_User_ID, base.Authenticated_Permission_Type); this.dropdown_Country.SelectedValue = userDetails.Country_Id.ToString(); if (userDetails.Default_Currency_Id.HasValue) { this.dropdown_Currency.SelectedValue = userDetails.Default_Currency_Id.ToString(); } if (userDetails.Country_Id > 0) { this.Bind_Vat_By_Selected_Country(); } // Set default suppier type as general to prevent validation errors. The only mandatory field at the starting page load should be the supplier name / company name. this.dropdown_Supplier_Type.SelectedValue = "1"; }
protected void Repeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Common_Tools.Initialize_DropDown_Currencies((DropDownList)e.Item.FindControl("dropdown_Transaction_Amount_Currency")); byte?currency_Id = ((Credit_Card_Transactions_To_DB_Sync_From_UI)e.Item.DataItem).Transaction_Amount_Currency_Id; if (currency_Id.HasValue) { ((DropDownList)e.Item.FindControl("dropdown_Transaction_Amount_Currency")).SelectedValue = currency_Id.Value.ToString(); ((DropDownList)e.Item.FindControl("dropdown_Transaction_Amount_Currency")).Attributes["LastEditedValue"] = currency_Id.Value.ToString(); } Label label_Transaction_Amount = ((Label)e.Item.FindControl("label_Transaction_Amount")); if (((Credit_Card_Transactions_To_DB_Sync_From_UI)e.Item.DataItem).Transaction_Amount.HasValue) { label_Transaction_Amount.Text = ((Credit_Card_Transactions_To_DB_Sync_From_UI)e.Item.DataItem).Transaction_Amount.Value.ToString("#,#.##"); if (currency_Id.HasValue) { var currency_Details = Business_Logic_Layer_Facade.Instance.Currencies_Get_By_Id(currency_Id.Value); label_Transaction_Amount.Text += currency_Details.Currency_Symbol; } } label_Transaction_Amount.Attributes["LastEditedValue"] = label_Transaction_Amount.Text; bool pendingChanges = ((Credit_Card_Transactions_To_DB_Sync_From_UI)e.Item.DataItem).Has_Pending_Changes; bool IsNewRecord = ((Credit_Card_Transactions_To_DB_Sync_From_UI)e.Item.DataItem).Is_New_Record; bool IsDeleted = ((Credit_Card_Transactions_To_DB_Sync_From_UI)e.Item.DataItem).Is_Deleted; //bool HasError = (bool)((DataRowView)e.Item.DataItem)["Has_Error"]; Panel panel_Bank_Account_Transaction_Id = (Panel)e.Item.FindControl("panel_Bank_Account_Transaction_Id"); if (pendingChanges) { //panel_Bank_Account_Transaction_Id.CssClass = "tr alert-warning"; } if (IsNewRecord) { panel_Bank_Account_Transaction_Id.CssClass = "tr NewRecord"; } if (IsDeleted) { panel_Bank_Account_Transaction_Id.CssClass = "Deleted"; } //if (HasError) //{ // panel_Bank_Account_Transaction_Id.CssClass = "tr alert-danger"; //} } }
private void Bind_Default_View() { Common_Tools.Initialize_DropDown_App_Permission_Types(this.dropdown_App_Permission_Type); Common_Tools.Initialize_DropDown_Countries(dropdown_Country); Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); }
protected void button_Language_Swap_Event_Click(object sender, EventArgs e) { string current_Requested_Page_Url = this.Request.Url.PathAndQuery.ToString(); string new_Lanauge_Code = this.hidden_New_Language_To_Swap.Value; Common_Tools.Set_Language_Cookie(new_Lanauge_Code); Response.Redirect(current_Requested_Page_Url); }
private void Bind_Default_View() { // ToDo -- Check permissions -- if the user is able to view the client / edit the client this.Validate_Permissions(); int p_Selected_User_Id_To_Return_Clients = base.Authenticated_User_ID; var list_Users_Clients = Business_Logic_Layer_Facade.Instance.Clients_Get_All_By_User_Id(p_Selected_User_Id_To_Return_Clients, base.Authenticated_User_ID); this.dropdown_Client.DataSource = list_Users_Clients; this.dropdown_Client.DataTextField = "Company_Name"; this.dropdown_Client.DataValueField = "Client_Id"; this.dropdown_Client.DataBind(); this.dropdown_Client.Items.Insert(0, new ListItem("-- Select -- ", "")); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Invoiced_Client_To_Country); // bind currencies Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); // bind time pickers Common_Tools.Initialize_DropDown_Hours(this.dropdown_Invoice_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Invoice_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Invoice_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Invoice_Creation_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Invoice_Creation_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Invoice_Creation_Time_Seconds); // bind expense types Common_Tools.Initialize_DropDown_Invoice_Types(this.dropdown_Invoice_Type); this.Set_Page_FormControls_Values(); if (!string.IsNullOrEmpty(this.Request.QueryString["mode"])) { if (Request.QueryString["mode"] == "view") { this.Bind_ReadOnly_View(); } else if (Request.QueryString["mode"] == "edit") { Bind_Edit_View(); } } else { this.Bind_ReadOnly_View(); } }
private void Bind_Default_View() { // ToDo -- Check permissions -- if the user is able to view the client / edit the client this.Validate_Permissions(); // bind document types Common_Tools.Initialize_DropDown_Document_Types(this.dropdown_General_Document_Type); // bind the combobox of the countries Common_Tools.Initialize_DropDown_Countries(this.dropdown_Sent_By_Entity_Country); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Sent_To_Entity_Country); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Recieved_In_Country); // bind time pickers Common_Tools.Initialize_DropDown_Hours(this.dropdown_Document_Creation_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Document_Creation_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Document_Creation_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Sent_By_Entity_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Sent_By_Entity_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Sent_By_Entity_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Recieved_Document_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Recieved_Document_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Recieved_Document_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Recieved_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Recieved_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Recieved_Time_Seconds); this.Set_Page_FormControls_Values(); if (!string.IsNullOrEmpty(this.Request.QueryString["mode"])) { if (Request.QueryString["mode"] == "view") { this.Bind_ReadOnly_View(); } else if (Request.QueryString["mode"] == "edit") { Bind_Edit_View(); } } else { this.Bind_ReadOnly_View(); } }
private void Set_Page_FormControls_Values() { int credit_Card_Id = int.Parse(this.Request.QueryString["id"]); int user_Id_Owner = base.Authenticated_User_ID; Credit_Cards creditCardDetails = Business_Logic_Layer_Facade.Instance.CreditCards_Get_Credit_Card_Details( credit_Card_Id, user_Id_Owner, base.Authenticated_User_ID, base.Authenticated_Permission_Type); if (creditCardDetails != null) { Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( creditCardDetails.Bank_Account_Id.ToString(), this.dropdown_Bank_Account, this.label_Bank_Account); this.textbox_Card_Name.Text = creditCardDetails.Card_Name; this.label_Card_Name.Text = creditCardDetails.Card_Name; this.textbox_Four_Ending_Digits.Text = creditCardDetails.Four_Ending_Digits; this.label_Four_Ending_Digits.Text = creditCardDetails.Four_Ending_Digits; if (creditCardDetails.Expiration_Date.HasValue) { DateTime date_Expiration_For_Display = creditCardDetails.Expiration_Date.Value.AddMonths(-1); this.dropdown_Expiration_Date_Month.SelectedValue = date_Expiration_For_Display.Month.ToString("00"); this.dropdown_Expiration_Date_Year.SelectedValue = date_Expiration_For_Display.Year.ToString(); this.label_Expiration_Date.Text = date_Expiration_For_Display.ToString("MM / yyyy "); } this.checkbox_Is_Active.Checked = creditCardDetails.Is_Active; this.label_Is_Active.Text = creditCardDetails.Is_Active ? "Yes" : "No"; this.label_Record_Created_By_User.Text = creditCardDetails.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = creditCardDetails.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = creditCardDetails.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = creditCardDetails.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); } }
private void Bind_Default_View() { Common_Tools.Initialize_DropDown_Countries(this.dropdown_Country); Common_Tools.Initialize_DropDown_App_Permission_Types(this.dropdown_App_Permission_Type); Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Registration_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Registration_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Registration_Time_Seconds); // ToDo -- Check permissions -- if the user is able to view the client / edit the client this.Validate_Permissions(); if (base.Authenticated_Permission_Type.App_Permission_Type_Id == App_Permission_Type.Permission_Type.Application_Administrator) { this.panel_Azure_Container_Ref.Visible = true; } this.Set_Page_FormControls_Values(); if (!string.IsNullOrEmpty(Request.QueryString["mode"])) { if (Request.QueryString["mode"] == "view") { this.Bind_ReadOnly_View(); } else if (Request.QueryString["mode"] == "edit") { Bind_Edit_View(); } } else { this.Bind_ReadOnly_View(); } if (base.User_Is_Administrator) { } }
private void Refresh_Totals_Textboxes() { decimal l_Vat_Percentage = 0; decimal l_Total_Amount = 0; this.textbox_Total_Without_Vat.Text = this.textbox_Total_Amount.Text; this.textbox_Total_Vat.Text = "0"; if (decimal.TryParse(this.textbox_Vat_Percentage.Text, out l_Vat_Percentage) && decimal.TryParse(this.textbox_Total_Amount.Text, out l_Total_Amount) && l_Vat_Percentage > 0 && l_Total_Amount > 0) { decimal l_Total_Without_Vat = l_Total_Amount / ((l_Vat_Percentage + 100) / 100); decimal l_Total_Vat = l_Total_Amount - l_Total_Without_Vat; Common_Tools.Set_Number_Text_Value_To_TextBox( l_Total_Without_Vat, this.textbox_Total_Without_Vat); Common_Tools.Set_Number_Text_Value_To_TextBox( l_Total_Vat, this.textbox_Total_Vat); } }
private void Sync_Repeater_ViewState_To_DataTable_Session() { var dataTable = ((Bank_Account_Transactions_Response_For_UI)this.Session["Back_Account_Transactions_Response"]).Bank_Account_Transactions_DataTable; for (int i = 0; i < this.repeater.Items.Count; i++) { string balance = ((TextBox)this.repeater.Items[i].FindControl("txt_Balance")).Text; decimal parsed_Balance = 0; if (!string.IsNullOrEmpty(balance) && decimal.TryParse(balance, out parsed_Balance)) { dataTable.Rows[i]["Transaction_Account_Balance"] = balance; } else { dataTable.Rows[i]["Transaction_Account_Balance"] = DBNull.Value; } var transaction_Date_Parsed = Common_Tools.Try_Parse_DateTime_By_Current_Culture(((TextBox)this.repeater.Items[i].FindControl("txt_Actual_DateTime")).Text); if (transaction_Date_Parsed.HasValue) { dataTable.Rows[i]["Transaction_Actual_DateTime"] = transaction_Date_Parsed; } else { dataTable.Rows[i]["Transaction_Actual_DateTime"] = DBNull.Value; } string income_Value = ((TextBox)this.repeater.Items[i].FindControl("txt_Income_Value")).Text; decimal parsed_Income_Value = 0; if (!string.IsNullOrEmpty(income_Value) && decimal.TryParse(income_Value, out parsed_Income_Value)) { dataTable.Rows[i]["Positive_Amount_Entered"] = income_Value; } else { dataTable.Rows[i]["Positive_Amount_Entered"] = DBNull.Value; } string obligo_Value = ((TextBox)this.repeater.Items[i].FindControl("txt_Obligo_Value")).Text; decimal parsed_Obligo_Value = 0; if (!string.IsNullOrEmpty(obligo_Value) && decimal.TryParse(obligo_Value, out parsed_Obligo_Value)) { dataTable.Rows[i]["Negative_Amount_Paid"] = obligo_Value; } else { dataTable.Rows[i]["Negative_Amount_Paid"] = DBNull.Value; } var value_Date_Parsed = Common_Tools.Try_Parse_DateTime_By_Current_Culture(((TextBox)this.repeater.Items[i].FindControl("txt_Value_Date")).Text); if (value_Date_Parsed.HasValue) { dataTable.Rows[i]["Transaction_Value_DateTime"] = value_Date_Parsed; } else { dataTable.Rows[i]["Transaction_Value_DateTime"] = DBNull.Value; } dataTable.Rows[i]["Reference_Number"] = ((TextBox)this.repeater.Items[i].FindControl("txt_Reference")).Text; dataTable.Rows[i]["Transaction_Bank_Description"] = ((TextBox)this.repeater.Items[i].FindControl("txt_Description")).Text; dataTable.Rows[i]["Transaction_Bank_Inner_Reference_Code"] = ((TextBox)this.repeater.Items[i].FindControl("txt_Bank_Ref")).Text; if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_PendingChanges")).Value)) { dataTable.Rows[i]["Pending_Changes"] = true; } if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_IsNewRecord")).Value)) { dataTable.Rows[i]["Is_New_Record"] = true; } if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_IsDeleted")).Value)) { dataTable.Rows[i]["Is_Deleted"] = true; } } }
private void Bind_Default_View() { Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); Common_Tools.Initialize_DropDown_Countries(this.dropdown_Branch_Country); }
private void Bind_Default_View() { Common_Tools.Initialize_DropDown_Countries(this.dropdown_Country); Common_Tools.Initialize_DropDown_Expense_Types(this.dropdown_Type); }
private void Set_Page_FormControls_Values() { // get the user Details int User_Id = int.Parse(this.Request.QueryString["id"]); int user_Id_User_Owner = base.Authenticated_User_ID; TimeLineDashboard.Shared.Models.Users userDetails = Business_Logic_Layer_Facade.Instance.Users_Get_Details_By_User_Id( User_Id, base.Authenticated_User_ID, base.Authenticated_Permission_Type); if (userDetails != null) { this.textbox_Username.Text = userDetails.Username; this.label_Username.Text = userDetails.Username; Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( userDetails.App_Permission_Type_Id.ToString(), this.dropdown_App_Permission_Type, this.label_App_Permission_Type); this.textbox_First_Name.Text = userDetails.First_Name; this.label_First_Name.Text = userDetails.First_Name; this.textbox_Middle_Name.Text = userDetails.Middle_Name; this.label_Middle_Name.Text = userDetails.Middle_Name; this.textbox_Last_Name.Text = userDetails.Last_Name; this.label_Last_Name.Text = userDetails.Last_Name; this.textbox_Email.Text = userDetails.Email; this.label_Email.Text = userDetails.Email; this.dropdown_Country.SelectedValue = userDetails.Country_Id.ToString(); this.label_Country.Text = Business_Logic_Layer_Facade.Instance.Countries_Get_By_Country_Id(userDetails.Country_Id).Country_English_Name; this.Bind_States_ComboBox(); if (userDetails.State_Id > 0) { dropdown_State.SelectedValue = userDetails.State_Id.ToString(); this.label_State.Text = Business_Logic_Layer_Facade.Instance.States_Get_By_State_Id(userDetails.State_Id).State_Name; } this.textbox_City.Text = userDetails.City; this.label_City.Text = userDetails.City; this.textbox_Address.Text = userDetails.Address; this.label_Address.Text = userDetails.Address; this.textbox_Zipcode.Text = userDetails.ZipCode; this.label_Zipcode.Text = userDetails.ZipCode; if (userDetails.Default_Currency_Id.HasValue) { this.dropdown_Currency.SelectedValue = userDetails.Default_Currency_Id.Value.ToString(); this.label_Currency.Text = Business_Logic_Layer_Facade.Instance.Currencies_Get_By_Id(userDetails.Default_Currency_Id.Value).Formatted_Currency_Display_For_Selection; } this.textbox_Mobile_Phone.Text = userDetails.Mobile_Phone; this.label_Mobile_Phone.Text = userDetails.Mobile_Phone; this.textbox_Additional_Phone_Number.Text = userDetails.Additional_Phone_Number; this.label_Additional_Phone_Number.Text = userDetails.Additional_Phone_Number; Common_Tools.Set_DateTime_To_TextBox_And_Label( userDetails.Birth_Date, this.textbox_Birth_Date, this.label_Birth_Date); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( userDetails.Gender.ToString(), this.dropdown_Gender, this.label_Gender); Common_Tools.Set_DateTime_To_ComboBoxes_And_Label( userDetails.Registration_DateTime_UTC, this.textbox_Registration_DateTime, this.label_Registration_DateTime, this.dropdown_Registration_Time_Hours, this.dropdown_Registration_Time_Minutes, this.dropdown_Registration_Time_Seconds, this.label_Registration_Time); this.textbox_Azure_Container_Ref.Text = userDetails.Azure_Container_Ref; this.label_Azure_Container_Ref.Text = userDetails.Azure_Container_Ref; this.textbox_Heard_About_Application_From.Text = userDetails.Heard_About_Application_From; this.label_Heard_About_Application_From.Text = userDetails.Heard_About_Application_From; this.textbox_Our_Administrative_Side_Notes.Text = userDetails.Our_Administrative_Side_Notes; this.label_Our_Administrative_Side_Notes.Text = userDetails.Our_Administrative_Side_Notes; this.checkbox_Is_Active.Checked = userDetails.Is_Active; this.label_Is_Active.Text = userDetails.Is_Active ? "Yes" : "No"; this.label_Record_Created_By_User.Text = userDetails.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = userDetails.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = userDetails.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = userDetails.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); } }
protected void button_Update_Expense_Details_Click(object sender, EventArgs e) { if (this.Page.IsValid) { bool l_Expense_Successfully_Updated = false; int p_Expense_Record_Id = int.Parse(this.Request.QueryString["id"]); string exception_During_Process = ""; string exception_During_Process_Extra_Data = ""; int p_User_Id = base.Authenticated_User_ID; int p_Supplier_Id = int.Parse(this.dropdown_Supplier.SelectedValue); DateTime?p_Expense_Invoice_DateTime = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Expense_Invoice_DateTime, this.dropdown_Invoice_Time_Hours, this.dropdown_Invoice_Time_Minutes, this.dropdown_Invoice_Time_Seconds); byte p_Currency_Id = byte.Parse(this.dropdown_Currency.SelectedValue); decimal p_Total_Amount = decimal.Parse(this.textbox_Total_Amount.Text); decimal p_Vat_Percentage = decimal.Parse(this.textbox_Vat_Percentage.Text); decimal p_Total_Without_Vat = decimal.Parse(this.textbox_Total_Without_Vat.Text); decimal p_Total_Vat = decimal.Parse(this.textbox_Total_Vat.Text); int?p_Invoiced_Client_On_User_Location_Id = new int?(); string p_Invoiced_Client_To_CompanyName = this.textbox_Invoiced_Client_To_CompanyName.Text; string p_Invoiced_Client_To_Tax_Reference = this.textbox_Invoiced_Client_To_Tax_Reference.Text; string p_Invoiced_Client_To_PersonName = this.textbox_Invoiced_Client_To_PersonName.Text; string p_Invoiced_Client_To_PhoneNumber = this.textbox_Invoiced_Client_To_PhoneNumber.Text; short?p_Invoiced_Client_To_Country_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoiced_Client_To_Country.SelectedValue)) { p_Invoiced_Client_To_Country_Id = short.Parse(this.dropdown_Invoiced_Client_To_Country.SelectedValue); } short?p_Invoiced_Client_To_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoiced_Client_To_State.SelectedValue)) { p_Invoiced_Client_To_State_Id = short.Parse(this.dropdown_Invoiced_Client_To_State.SelectedValue); } string p_Invoiced_Client_To_City = this.textbox_Invoiced_Client_To_City.Text; string p_Invoiced_Client_To_Address = this.textbox_Invoiced_Client_To_Address.Text; string p_Invoiced_Client_To_Zip = this.textbox_Invoiced_Client_To_Zip.Text; string p_Invoiced_Client_To_EmailAddress = this.textbox_Invoiced_Client_To_EmailAddress.Text; byte p_Expense_Type_Id = byte.Parse(this.dropdown_Expense_Type.SelectedValue); string p_Invoice_Number = this.textbox_Invoice_Number.Text; string p_Invoice_Reference_Number = this.textbox_Invoice_Reference_Number.Text; string p_Invoice_Supplier_Company_Details = this.textbox_Invoice_Supplier_Company_Details.Text; string p_Invoice_Supplier_Tax_Reference = this.textbox_Invoice_Supplier_Tax_Reference.Text; short?p_Invoice_Supplier_Country_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoice_Supplier_Country.SelectedValue)) { p_Invoice_Supplier_Country_Id = short.Parse(this.dropdown_Invoice_Supplier_Country.SelectedValue); } short?p_Invoice_Supplier_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoice_Supplier_State.SelectedValue)) { p_Invoice_Supplier_State_Id = short.Parse(this.dropdown_Invoice_Supplier_State.SelectedValue); } string p_Invoice_Supplier_City = this.textbox_Invoice_Supplier_City.Text; string p_Invoice_Supplier_Address_Description = this.textbox_Invoice_Supplier_Address_Description.Text; string p_Invoice_Supplier_ZipCode = this.textbox_Invoice_Supplier_ZipCode.Text; string p_Invoice_Supplier_WebAddress = this.textbox_Invoice_Supplier_WebAddress.Text; string p_Invoice_Supplier_Phone_Number = this.textbox_Invoice_Supplier_Phone_Number.Text; string p_Invoice_Supplier_Contact_FullName = this.textbox_Invoice_Supplier_Contact_FullName.Text; string p_Invoice_Content_Long_Description = this.textbox_Invoice_Content_Long_Description.Text; string p_User_Description = this.textbox_User_Description.Text; string p_User_Comments = this.textbox_User_Description.Text; bool p_Is_Active = this.checkbox_Is_Active.Checked; bool p_Is_Visible_To_Anonymous_Users = this.checkbox_Is_Visible_To_Anonymous_Users.Checked; bool p_Is_Available_For_Download_For_Anonymous_Users = this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked; bool p_Is_Visible_To_Followers_Users = this.checkbox_Is_Visible_To_Followers_Users.Checked; bool p_Is_Available_For_Download_For_Followers_Users = this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked; int p_User_Id_Expense_Owner = int.Parse(this.hidden_User_Id_Expense_Owner.Value); string p_Original_File_Name = ""; byte[] p_File_Content_To_Save_In_Azure = new byte[0]; if (this.fileUpload_Expense_File.HasFile) { p_Original_File_Name = this.fileUpload_Expense_File.FileName; p_File_Content_To_Save_In_Azure = this.fileUpload_Expense_File.FileBytes; } try { l_Expense_Successfully_Updated = Business_Logic_Layer_Facade.Instance.Expenses_Update_Expense_Details( p_Expense_Record_Id, p_Supplier_Id, p_Expense_Invoice_DateTime, p_Currency_Id, p_Total_Amount, p_Vat_Percentage, p_Total_Without_Vat, p_Total_Vat, p_Invoiced_Client_On_User_Location_Id, p_Invoiced_Client_To_CompanyName, p_Invoiced_Client_To_Tax_Reference, p_Invoiced_Client_To_PersonName, p_Invoiced_Client_To_PhoneNumber, p_Invoiced_Client_To_Country_Id, p_Invoiced_Client_To_State_Id, p_Invoiced_Client_To_City, p_Invoiced_Client_To_Address, p_Invoiced_Client_To_Zip, p_Invoiced_Client_To_EmailAddress, p_Expense_Type_Id, p_Invoice_Number, p_Invoice_Reference_Number, p_Invoice_Supplier_Company_Details, p_Invoice_Supplier_Tax_Reference, p_Invoice_Supplier_Country_Id, p_Invoice_Supplier_State_Id, p_Invoice_Supplier_City, p_Invoice_Supplier_Address_Description, p_Invoice_Supplier_ZipCode, p_Invoice_Supplier_WebAddress, p_Invoice_Supplier_Phone_Number, p_Invoice_Supplier_Contact_FullName, p_Invoice_Content_Long_Description, p_User_Description, p_User_Comments, p_User_Id_Expense_Owner, p_Original_File_Name, p_File_Content_To_Save_In_Azure, p_Is_Visible_To_Anonymous_Users, p_Is_Available_For_Download_For_Anonymous_Users, p_Is_Visible_To_Followers_Users, p_Is_Available_For_Download_For_Followers_Users, p_User_Id, base.Authenticated_Permission_Type, p_Is_Active ); } catch (Exception exc) { exception_During_Process = exc.Message; if (exc.InnerException != null) { exception_During_Process_Extra_Data = exc.InnerException.Message; } } if (l_Expense_Successfully_Updated) { // The client details were successfully updated. // redirect the user to view read only mode Response.Redirect("manage_Expense.aspx?id=" + Request.QueryString["id"] + "&mode=view"); } else { // show error message to the user for the failed process this.lbl_Insert_Process_Error_Result.Text = exception_During_Process; if (!string.IsNullOrEmpty(exception_During_Process_Extra_Data)) { this.lbl_Insert_Process_Error_Result.Text += " (" + exception_During_Process_Extra_Data + ")"; } } } }
private void Set_Page_FormControls_Values() { int Invoice_Record_Id = int.Parse(this.Request.QueryString["id"]); int user_Id_Invoice_Owner = base.Authenticated_User_ID; Invoices InvoiceDetails = Business_Logic_Layer_Facade.Instance.Invoices_Get_By_Id( Invoice_Record_Id, user_Id_Invoice_Owner, base.Authenticated_User_ID, base.Authenticated_Permission_Type); if (InvoiceDetails != null) { this.hidden_User_Id_Invoice_Owner.Value = InvoiceDetails.User_Id.ToString(); this.textbox_Invoice_DateTime.Text = InvoiceDetails.Invoice_DateTime.ToString("dd/MM/yyyy"); this.label_Invoice_DateTime.Text = InvoiceDetails.Invoice_DateTime.ToString("dd/MM/yyyy"); Common_Tools.Set_DateTime_To_ComboBoxes_And_Label( InvoiceDetails.Invoice_DateTime, this.textbox_Invoice_DateTime, this.label_Invoice_DateTime, this.dropdown_Invoice_Time_Hours, this.dropdown_Invoice_Time_Minutes, this.dropdown_Invoice_Time_Seconds, this.label_Invoice_Time ); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( InvoiceDetails.Client_Id.ToString(), this.dropdown_Client, this.label_Client); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( InvoiceDetails.Currency_Id.ToString(), this.dropdown_Currency, this.label_Currency); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( InvoiceDetails.Total_Amount, this.textbox_Total_Amount, this.label_Total_Amount); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( InvoiceDetails.Vat_Percentage, this.textbox_Vat_Percentage, this.label_Vat_Percentage); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( InvoiceDetails.Total_Without_Vat, this.textbox_Total_Without_Vat, this.label_Total_Without_Vat); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( InvoiceDetails.Total_Vat, this.textbox_Total_Vat, this.label_Total_Vat); Common_Tools.Set_DateTime_To_ComboBoxes_And_Label( InvoiceDetails.Creation_DateTime, this.textbox_Creation_DateTime, this.label_Creation_DateTime, this.dropdown_Invoice_Creation_Time_Hours, this.dropdown_Invoice_Creation_Time_Minutes, this.dropdown_Invoice_Creation_Time_Seconds, this.label_Invoice_Creation_Time ); this.textbox_Invoiced_On_User_Location_Id.Text = InvoiceDetails.Invoiced_Client_On_User_Location_Id.ToString(); this.label_Invoiced_On_User_Location_Id.Text = InvoiceDetails.Invoiced_Client_On_User_Location_Id.ToString(); this.textbox_Invoiced_Client_To_CompanyName.Text = InvoiceDetails.Invoiced_Client_To_CompanyName.ToString(); this.label_Invoiced_Client_To_CompanyName.Text = InvoiceDetails.Invoiced_Client_To_CompanyName.ToString(); this.textbox_Invoiced_Client_To_Tax_Reference.Text = InvoiceDetails.Invoiced_Client_To_Tax_Reference.ToString(); this.label_Invoiced_Client_To_Tax_Reference.Text = InvoiceDetails.Invoiced_Client_To_Tax_Reference.ToString(); this.textbox_Invoiced_Client_To_PersonName.Text = InvoiceDetails.Invoiced_Client_To_PersonName.ToString(); this.label_Invoiced_Client_To_PersonName.Text = InvoiceDetails.Invoiced_Client_To_PersonName.ToString(); this.textbox_Invoiced_Client_To_PhoneNumber.Text = InvoiceDetails.Invoiced_Client_To_PhoneNumber.ToString(); this.label_Invoiced_Client_To_PhoneNumber.Text = InvoiceDetails.Invoiced_Client_To_PhoneNumber.ToString(); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( InvoiceDetails.Invoiced_Client_To_Country_Id.ToString(), this.dropdown_Invoiced_Client_To_Country, this.label_Invoiced_Client_To_Country); this.Bind_Invoiced_Client_States_ComboBox(); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( InvoiceDetails.Invoiced_Client_To_State_Id.ToString(), this.dropdown_Invoiced_Client_To_State, this.label_Invoiced_Client_To_State); this.textbox_Invoiced_Client_To_City.Text = InvoiceDetails.Invoiced_Client_To_City; this.label_Invoiced_Client_To_City.Text = InvoiceDetails.Invoiced_Client_To_City; this.textbox_Invoiced_Client_To_Address.Text = InvoiceDetails.Invoiced_Client_To_Address; this.label_Invoiced_Client_To_Address.Text = InvoiceDetails.Invoiced_Client_To_Address; this.textbox_Invoiced_Client_To_Zip.Text = InvoiceDetails.Invoiced_Client_To_Zip; this.label_Invoiced_Client_To_Zip.Text = InvoiceDetails.Invoiced_Client_To_Zip; this.textbox_Invoiced_Client_To_Zip.Text = InvoiceDetails.Invoiced_Client_To_Zip; this.label_Invoiced_Client_To_Zip.Text = InvoiceDetails.Invoiced_Client_To_Zip; this.textbox_Invoiced_Client_To_EmailAddress.Text = InvoiceDetails.Invoiced_Client_To_EmailAddress; this.label_Invoiced_Client_To_EmailAddress.Text = InvoiceDetails.Invoiced_Client_To_EmailAddress; Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( InvoiceDetails.Invoice_Type_Id.ToString(), this.dropdown_Invoice_Type, this.label_Invoice_Type); this.textbox_Invoice_Number.Text = InvoiceDetails.Invoice_Number; this.label_Invoice_Number.Text = InvoiceDetails.Invoice_Number; this.textbox_Invoice_Reference_Number.Text = InvoiceDetails.Invoice_Reference_Number; this.label_Invoice_Reference_Number.Text = InvoiceDetails.Invoice_Reference_Number; this.textbox_Invoice_Content_Long_Description.Text = InvoiceDetails.Invoice_Content_Long_Description; this.label_Invoice_Content_Long_Description.Text = InvoiceDetails.Invoice_Content_Long_Description; this.textbox_User_Description.Text = InvoiceDetails.User_Description; this.label_User_Description.Text = InvoiceDetails.User_Description; this.textbox_User_Comments.Text = InvoiceDetails.User_Comments; this.label_User_Comments.Text = InvoiceDetails.User_Comments; //textbox_Original_File_Name // TODO -- Show file management / update this.checkbox_Is_Visible_To_Anonymous_Users.Checked = InvoiceDetails.Is_Visible_To_Anonymous_Users; this.label_Is_Visible_To_Anonymous_Users.Text = InvoiceDetails.Is_Visible_To_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked = InvoiceDetails.Is_Available_For_Download_For_Anonymous_Users; this.label_Is_Available_For_Download_For_Anonymous_Users.Text = InvoiceDetails.Is_Available_For_Download_For_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Visible_To_Followers_Users.Checked = InvoiceDetails.Is_Visible_To_Followers_Users; this.label_Is_Visible_To_Followers_Users.Text = InvoiceDetails.Is_Visible_To_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked = InvoiceDetails.Is_Available_For_Download_For_Followers_Users; this.label_Is_Available_For_Download_For_Followers_Users.Text = InvoiceDetails.Is_Available_For_Download_For_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Active.Checked = InvoiceDetails.Is_Active; this.label_Is_Active.Text = InvoiceDetails.Is_Active ? "Yes" : "No"; this.label_Record_Created_By_User.Text = InvoiceDetails.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = InvoiceDetails.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = InvoiceDetails.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = InvoiceDetails.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); } }
protected void button_Create_Document_Click(object sender, EventArgs e) { if (this.Page.IsValid) { bool l_Document_Successfully_Created = false; int l_New_Document_Id = 0; string exception_During_Process = ""; string exception_During_Process_Extra_Data = ""; int p_User_Id = int.Parse(this.dropdown_User_Selection.SelectedValue); short p_General_Document_Type_Id = short.Parse(this.dropdown_General_Document_Type.SelectedValue); DateTime?p_Document_Creation_DateTime = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Document_Creation_Date, this.dropdown_Document_Creation_Time_Hours, this.dropdown_Document_Creation_Time_Minutes, this.dropdown_Document_Creation_Time_Seconds); string p_Title = this.textbox_Title.Text; string p_Description = this.textbox_Description.Text; string p_Sent_By_Entity_Name = this.textbox_Sent_By_Entity_Name.Text; short? p_Sent_By_Entity_Country_Id = new short?(); short? p_Sent_By_Entity_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Sent_By_Entity_Country.SelectedValue)) { p_Sent_By_Entity_Country_Id = short.Parse(this.dropdown_Sent_By_Entity_Country.SelectedValue); if (!string.IsNullOrEmpty(this.dropdown_Sent_By_Entity_State.SelectedValue)) { p_Sent_By_Entity_State_Id = short.Parse(this.dropdown_Sent_By_Entity_State.SelectedValue); } } string p_Sent_By_Entity_City = this.textbox_Sent_By_Entity_City.Text; string p_Sent_By_Entity_Address = this.textbox_Sent_By_Entity_Address.Text; string p_Sent_By_Entity_ZipCode = this.textbox_Sent_By_Entity_ZipCode.Text; DateTime?p_Sent_By_Entity_DateTime = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Sent_By_Entity_DateTime, this.dropdown_Sent_By_Entity_Time_Hours, this.dropdown_Sent_By_Entity_Time_Minutes, this.dropdown_Sent_By_Entity_Time_Seconds); string p_Sent_By_Entity_Email_Address = this.textbox_Sent_By_Entity_Email_Address.Text; string p_Sent_To_Entity_Name = this.textbox_Sent_To_Entity_Name.Text; short? p_Sent_To_Entity_Country_Id = new short?(); short? p_Sent_To_Entity_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Sent_To_Entity_Country.SelectedValue)) { p_Sent_To_Entity_Country_Id = short.Parse(this.dropdown_Sent_To_Entity_Country.SelectedValue); if (!string.IsNullOrEmpty(this.dropdown_Sent_By_Entity_State.SelectedValue)) { p_Sent_To_Entity_State_Id = short.Parse(this.dropdown_Sent_By_Entity_State.SelectedValue); } } string p_Sent_To_Entity_City = this.textbox_Sent_To_Entity_City.Text; string p_Sent_To_Entity_Address = this.textbox_Sent_To_Entity_Address.Text; string p_Sent_To_Entity_ZipCode = this.textbox_Sent_To_Entity_ZipCode.Text; string p_Sent_To_Entity_Email_Address = this.textbox_Sent_To_Entity_Email_Address.Text; DateTime?p_Recieved_Document_DateTime = new DateTime?(); p_Recieved_Document_DateTime = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Recieved_Document_DateTime, this.dropdown_Recieved_Document_Time_Hours, this.dropdown_Recieved_Document_Time_Minutes, this.dropdown_Recieved_Document_Time_Seconds); short?p_Recieved_In_Country_Id = new short?(); short?p_Recieved_In_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Recieved_In_Country.SelectedValue)) { p_Recieved_In_Country_Id = short.Parse(this.dropdown_Recieved_In_Country.SelectedValue); if (!string.IsNullOrEmpty(this.dropdown_Recieved_In_State.SelectedValue)) { p_Recieved_In_State_Id = short.Parse(this.dropdown_Recieved_In_State.SelectedValue); } } string p_Recieved_In_City = this.textbox_Recieved_In_City.Text; string p_Recieved_In_Address = this.textbox_Recieved_In_Address.Text; string p_Recieved_In_ZipCode = this.textbox_Recieved_In_ZipCode.Text; string p_Recieved_In_Email_Address = this.textbox_Recieved_In_Email_Address.Text; string p_User_Comments = this.textbox_User_Comments.Text; int? p_Recieved_By_User_Id = new int?(); if (!string.IsNullOrEmpty(this.dropdown_Recieved_By_User.SelectedValue)) { p_Recieved_By_User_Id = int.Parse(this.dropdown_Recieved_By_User.SelectedValue); } DateTime?p_Recieved_DateTime = new DateTime?(); if (!string.IsNullOrEmpty(this.textbox_Recieved_DateTime.Text)) { p_Recieved_DateTime = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Recieved_DateTime, this.dropdown_Recieved_Time_Hours, this.dropdown_Recieved_Time_Minutes, this.dropdown_Recieved_Time_Seconds); } string p_Original_File_Name = this.textbox_Original_File_Name.Text; string p_Azure_Block_Blob_Reference = "N/A"; bool p_Is_Visible_To_Anonymous_Users = this.checkbox_Is_Visible_To_Anonymous_Users.Checked; bool p_Is_Available_For_Download_For_Anonymous_Users = this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked; bool p_Is_Visible_To_Followers_Users = this.checkbox_Is_Visible_To_Followers_Users.Checked; bool p_Is_Available_For_Download_For_Followers_Users = this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked; int p_Record_Created_By_User_Id = base.Authenticated_User_ID; DateTime p_Record_Creation_DateTime_UTC = DateTime.UtcNow; int p_Record_Last_Updated_By_User_Id = base.Authenticated_User_ID; DateTime p_Record_Last_Updated_DateTime_UTC = DateTime.UtcNow; bool p_Is_Active = this.checkbox_Is_Active.Checked; TimeLineDashboard.Shared.Models.General_Documents new_General_Document_Details = null; try { new_General_Document_Details = Business_Logic_Layer_Facade.Instance.GeneralDocuments_Insert_New_General_Document_Details( p_User_Id, p_General_Document_Type_Id, p_Title, p_Description, p_Document_Creation_DateTime, p_Sent_By_Entity_Name, p_Sent_By_Entity_Country_Id, p_Sent_By_Entity_State_Id, p_Sent_By_Entity_City, p_Sent_By_Entity_Address, p_Sent_By_Entity_ZipCode, p_Sent_By_Entity_DateTime, p_Sent_By_Entity_Email_Address, p_Sent_To_Entity_Name, p_Sent_To_Entity_Country_Id, p_Sent_To_Entity_State_Id, p_Sent_To_Entity_City, p_Sent_To_Entity_Address, p_Sent_To_Entity_ZipCode, p_Sent_To_Entity_Email_Address, p_Recieved_Document_DateTime, p_Recieved_In_Country_Id, p_Recieved_In_State_Id, p_Recieved_In_City, p_Recieved_In_Address, p_Recieved_In_ZipCode, p_Recieved_In_Email_Address, p_User_Comments, p_Recieved_By_User_Id, p_Recieved_DateTime, p_Original_File_Name, p_Azure_Block_Blob_Reference, p_Is_Visible_To_Anonymous_Users, p_Is_Available_For_Download_For_Anonymous_Users, p_Is_Visible_To_Followers_Users, p_Is_Available_For_Download_For_Followers_Users, p_Record_Created_By_User_Id, p_Record_Creation_DateTime_UTC, p_Record_Last_Updated_By_User_Id, p_Record_Last_Updated_DateTime_UTC, p_Is_Active ); l_New_Document_Id = new_General_Document_Details.General_Document_Id; l_Document_Successfully_Created = true; } catch (Exception exc) { exception_During_Process = exc.Message; if (exc.InnerException != null) { exception_During_Process_Extra_Data = exc.InnerException.Message; } } if (l_Document_Successfully_Created && l_New_Document_Id > 0) { // The user details was successfully created.. // Show success message and redirect the user to view page or back to users page (depends on where the user came from) Response.Redirect("list_Documents.aspx"); } else { // show error message to the user for the failed process this.lbl_Insert_Process_Error_Result.Text = exception_During_Process; if (!string.IsNullOrEmpty(exception_During_Process_Extra_Data)) { this.lbl_Insert_Process_Error_Result.Text += " (" + exception_During_Process_Extra_Data + ")"; } } } }
private void Bind_Default_View() { // Bind users combo box if the current authenticated user is employee/administrator. this.dropdown_User_Selection.DataSource = Business_Logic_Layer_Facade.Instance.Users_Get_Administration_List(base.Authenticated_User_ID); this.dropdown_User_Selection.DataTextField = "FullName_With_Email"; this.dropdown_User_Selection.DataValueField = "User_Id"; this.dropdown_User_Selection.DataBind(); this.dropdown_User_Selection.Items.Insert(0, new ListItem("-- Select -- ", "")); if (base.User_Is_Administrator) { // If the user is administrator -- auto set the current user id this.dropdown_User_Selection.SelectedValue = base.Authenticated_User_ID.ToString(); this.Bind_DropDown_Client_After_User_Id_Selection(); } Common_Tools.Initialize_DropDown_Countries(this.dropdown_Invoiced_Client_To_Country); // bind currencies Common_Tools.Initialize_DropDown_Currencies(this.dropdown_Currency); // bind time pickers Common_Tools.Initialize_DropDown_Hours(this.dropdown_Invoice_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Invoice_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Invoice_Time_Seconds); Common_Tools.Initialize_DropDown_Hours(this.dropdown_Invoice_Creation_Time_Hours); Common_Tools.Initialize_DropDown_Minutes(this.dropdown_Invoice_Creation_Time_Minutes); Common_Tools.Initialize_DropDown_Seconds(this.dropdown_Invoice_Creation_Time_Seconds); // bind expense types Common_Tools.Initialize_DropDown_Invoice_Types(this.dropdown_Invoice_Type); if (!string.IsNullOrEmpty(this.Request.QueryString["type"])) { // An invoice type has been requested. The user probably wants to add the invoice type and have helping auto values filled on the form byte l_Invoice_Type_Id = 0; byte.TryParse(this.Request.QueryString["type"], out l_Invoice_Type_Id); if (l_Invoice_Type_Id > 0) { DateTime now = DateTime.Now; Common_Tools.Set_DateTime_To_ComboBoxes( now, this.textbox_Invoice_DateTime, this.dropdown_Invoice_Time_Hours, this.dropdown_Invoice_Time_Minutes, this.dropdown_Invoice_Time_Seconds); Common_Tools.Set_DateTime_To_ComboBoxes( now, this.textbox_Creation_DateTime, this.dropdown_Invoice_Creation_Time_Hours, this.dropdown_Invoice_Creation_Time_Minutes, this.dropdown_Invoice_Creation_Time_Seconds); this.dropdown_Invoice_Type.SelectedValue = l_Invoice_Type_Id.ToString(); this.Get_Next_Invoice_Number_If_Type_Selected(); } } }
private void Set_Page_FormControls_Values() { int Bank_Account_Id = int.Parse(this.Request.QueryString["id"]); int user_Id_BankAccount_Owner = base.Authenticated_User_ID; Bank_Account_Transactions transactionDetails = Business_Logic_Layer_Facade.Instance.BankAccount_Transactions_Get_Transaction_Details_By_Transaction_Id( Bank_Account_Id, user_Id_BankAccount_Owner, user_Id_BankAccount_Owner); if (transactionDetails != null) { Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( transactionDetails.Transaction_Account_Balance, this.textbox_Transaction_Account_Balance, this.label_Transaction_Account_Balance); Common_Tools.Set_DateTime_To_TextBox_And_Label( transactionDetails.Transaction_Actual_DateTime, this.textbox_Transaction_Actual_DateTime, this.label_Transaction_Actual_DateTime); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( transactionDetails.Positive_Amount_Entered, this.textbox_Positive_Amount_Entered, this.label_Positive_Amount_Entered); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( transactionDetails.Negative_Amount_Paid, this.textbox_Negative_Amount_Paid, this.label_Negative_Amount_Paid); Common_Tools.Set_DateTime_To_TextBox_And_Label( transactionDetails.Transaction_Value_DateTime, this.textbox_Transaction_Value_DateTime, this.label_Transaction_Value_DateTime); this.textbox_Reference_Number.Text = transactionDetails.Reference_Number; this.label_Reference_Number.Text = transactionDetails.Reference_Number; this.textbox_Transaction_Bank_Description.Text = transactionDetails.Transaction_Bank_Description; this.label_Transaction_Bank_Description.Text = transactionDetails.Transaction_Bank_Description; this.textbox_Transaction_Bank_Inner_Reference_Code.Text = transactionDetails.Transaction_Bank_Inner_Reference_Code; this.label_Transaction_Bank_Inner_Reference_Code.Text = transactionDetails.Transaction_Bank_Inner_Reference_Code; this.textbox_Transaction_User_Description.Text = transactionDetails.Transaction_User_Description; this.label_Transaction_User_Description.Text = transactionDetails.Transaction_User_Description; this.textbox_Transaction_User_Comments.Text = transactionDetails.Transaction_User_Comments; this.label_Transaction_User_Comments.Text = transactionDetails.Transaction_User_Comments; this.checkbox_Is_Visible_To_Anonymous_Users.Checked = transactionDetails.Is_Visible_To_Anonymous_Users; this.label_Is_Visible_To_Anonymous_Users.Text = transactionDetails.Is_Visible_To_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Visible_To_Followers_Users.Checked = transactionDetails.Is_Visible_To_Followers_Users; this.label_Is_Visible_To_Followers_Users.Text = transactionDetails.Is_Visible_To_Followers_Users ? "Yes" : "No"; this.label_Record_Created_By_User.Text = transactionDetails.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = transactionDetails.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = transactionDetails.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = transactionDetails.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); } else { throw new Exception("Could not find any details for the transction."); } }
private void Set_Page_FormControls_Values() { int Bank_Account_Id = int.Parse(this.Request.QueryString["id"]); int user_Id_BankAccount_Owner = base.Authenticated_User_ID; Bank_Accounts BankAccountDetails = Business_Logic_Layer_Facade.Instance.BankAccounts_Get_Bank_Account_Details( Bank_Account_Id, user_Id_BankAccount_Owner); if (BankAccountDetails != null) { this.textbox_Bank_Name.Text = BankAccountDetails.Bank_Name; this.label_Bank_Name.Text = BankAccountDetails.Bank_Name; this.textbox_Bank_Number.Text = BankAccountDetails.Bank_Number; this.label_Bank_Number.Text = BankAccountDetails.Bank_Number; this.textbox_Branch_Name.Text = BankAccountDetails.Branch_Name; this.label_Branch_Name.Text = BankAccountDetails.Branch_Name; this.textbox_Branch_Number.Text = BankAccountDetails.Branch_Number; this.label_Branch_Number.Text = BankAccountDetails.Branch_Number; this.textbox_Account_Number.Text = BankAccountDetails.Account_Number; this.label_Account_Number.Text = BankAccountDetails.Account_Number; this.textbox_Account_Name.Text = BankAccountDetails.Account_Name; this.label_Account_Name.Text = BankAccountDetails.Account_Name; this.textbox_IBAN.Text = BankAccountDetails.IBAN; this.label_IBAN.Text = BankAccountDetails.IBAN; this.textbox_IBAN.Text = BankAccountDetails.IBAN; this.label_Currency.Text = BankAccountDetails.IBAN; Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( BankAccountDetails.Currency_Id.ToString(), this.dropdown_Currency, this.label_Currency); Common_Tools.Set_DateTime_To_TextBox_And_Label( BankAccountDetails.Opened_Account_DateTime, this.textbox_Opened_Account_DateTime, this.label_Opened_Account_DateTime); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( BankAccountDetails.Branch_Country_Id.ToString(), this.dropdown_Branch_Country, this.label_Branch_Country); this.Bind_States_ComboBox(); if (BankAccountDetails.Branch_State_Id.HasValue) { Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( BankAccountDetails.Branch_State_Id.ToString(), this.dropdown_Branch_State, this.label_Branch_State); } this.textbox_Branch_City.Text = BankAccountDetails.Branch_City; this.label_Branch_City.Text = BankAccountDetails.Branch_City; this.textbox_Branch_Address.Text = BankAccountDetails.Branch_Address; this.label_Branch_Address.Text = BankAccountDetails.Branch_Address; this.textbox_Branch_Zipcode.Text = BankAccountDetails.Branch_Zipcode; this.label_Branch_Zipcode.Text = BankAccountDetails.Branch_Zipcode; this.textbox_Branch_Zipcode.Text = BankAccountDetails.Branch_Zipcode; this.label_Branch_Zipcode.Text = BankAccountDetails.Branch_Zipcode; this.textbox_Branch_Phone.Text = BankAccountDetails.Branch_Phone; this.label_Branch_Phone.Text = BankAccountDetails.Branch_Phone; this.textbox_Branch_Main_Email_Address.Text = BankAccountDetails.Branch_Main_Email_Address; this.label_Branch_Main_Email_Address.Text = BankAccountDetails.Branch_Main_Email_Address; this.textbox_Branch_Main_Contact.Text = BankAccountDetails.Branch_Main_Contact; this.label_Branch_Main_Contact.Text = BankAccountDetails.Branch_Main_Contact; this.textbox_Main_Contact_Phone_Number.Text = BankAccountDetails.Main_Contact_Phone_Number; this.label_Main_Contact_Phone_Number.Text = BankAccountDetails.Main_Contact_Phone_Number; Common_Tools.Set_DateTime_To_TextBox_And_Label( BankAccountDetails.Account_Active_From_Date, this.textbox_Account_Active_From_Date, this.label_Account_Active_From_Date); Common_Tools.Set_DateTime_To_TextBox_And_Label( BankAccountDetails.Account_Active_To_Date, this.textbox_Account_Active_To_Date, this.label_Account_Active_To_Date); this.checkbox_Is_Visible_To_Anonymous_Users.Checked = BankAccountDetails.Is_Visible_To_Anonymous_Users; this.label_Is_Visible_To_Anonymous_Users.Text = BankAccountDetails.Is_Visible_To_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked = BankAccountDetails.Is_Available_For_Download_For_Anonymous_Users; this.label_Is_Available_For_Download_For_Anonymous_Users.Text = BankAccountDetails.Is_Available_For_Download_For_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Visible_To_Followers_Users.Checked = BankAccountDetails.Is_Visible_To_Followers_Users; this.label_Is_Visible_To_Followers_Users.Text = BankAccountDetails.Is_Visible_To_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked = BankAccountDetails.Is_Available_For_Download_For_Followers_Users; this.label_Is_Available_For_Download_For_Followers_Users.Text = BankAccountDetails.Is_Available_For_Download_For_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Active.Checked = BankAccountDetails.Is_Active; this.label_Is_Active.Text = BankAccountDetails.Is_Active ? "Yes" : "No"; this.label_Record_Created_By_User.Text = BankAccountDetails.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = BankAccountDetails.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = BankAccountDetails.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = BankAccountDetails.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); } }
private void Set_Page_FormControls_Values() { int ccStatement_Id = int.Parse(this.Request.QueryString["id"]); var ccStatement_Details = Business_Logic_Layer_Facade.Instance.CreditCardStatements_Get_Credit_Card_Statement_Details_By_Credit_Card_Statement_Id( ccStatement_Id, base.Authenticated_User_ID, base.Authenticated_User_ID, base.Authenticated_Permission_Type); if (this.dropdown_BankAccounts.SelectedValue != ccStatement_Details.Bank_Account_Id.ToString()) { this.Bind_Credit_Cards_List(); } Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( ccStatement_Details.Bank_Account_Id.ToString(), this.dropdown_BankAccounts, this.label_BankAccount); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( ccStatement_Details.Credit_Card_Id.ToString(), this.dropdown_CreditCard, this.label_CreditCard); this.textbox_CCStatement_DateTime.Text = ccStatement_Details.Statement_Date.ToString("dd/MM/yyyy"); this.label_CCStatement_DateTime.Text = ccStatement_Details.Statement_Date.ToString("dd/MM/yyyy"); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( ccStatement_Details.Currency_Id.ToString(), this.dropdown_Currency, this.label_Currency); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( ccStatement_Details.Total_Amount, this.textbox_Total_Amount, this.label_Total_Amount); bool l_Download_CCStatement_Visible = false; if (string.IsNullOrEmpty(ccStatement_Details.Original_File_Name)) { this.link_Download_CCStatement.Target = ""; this.link_Download_CCStatement.NavigateUrl = ""; this.link_Download_CCStatement.Enabled = false; this.link_Download_CCStatement.Text = "N/A"; // this.link_Download_CCStatement.Visible = false; O.o IS NOT WORKING ?!?!?!?!?!? this.panel_Image_Download_CCStatement.FindControl("link_Download_CCStatement").Visible = false; l_Download_CCStatement_Visible = false; } else { this.link_Download_CCStatement.Target = "_blank"; this.link_Download_CCStatement.NavigateUrl = "downloader.aspx?id=" + ccStatement_Details.Credit_Card_Statement_Id + "&type=ccstatement"; this.link_Download_CCStatement.Enabled = true; this.link_Download_CCStatement.Text = ccStatement_Details.Original_File_Name; // this.link_Download_CCStatement.Visible = true; O.o IS NOT WORKING ?!?!?!?!?!? this.panel_Image_Download_CCStatement.FindControl("link_Download_CCStatement").Visible = true; l_Download_CCStatement_Visible = true; } this.link_Download_CCStatement2.Target = this.link_Download_CCStatement.Target; this.link_Download_CCStatement2.NavigateUrl = this.link_Download_CCStatement.NavigateUrl; this.link_Download_CCStatement2.Enabled = this.link_Download_CCStatement.Enabled; this.link_Download_CCStatement2.Visible = l_Download_CCStatement_Visible; //if (this.link_Download_CCStatement.Visible) if (l_Download_CCStatement_Visible) { this.panel_Image_Download_CCStatement.CssClass += " download-link-with-image"; } this.checkbox_Is_Visible_To_Anonymous_Users.Checked = ccStatement_Details.Is_Visible_To_Anonymous_Users; this.label_Is_Visible_To_Anonymous_Users.Text = ccStatement_Details.Is_Visible_To_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked = ccStatement_Details.Is_Available_For_Download_For_Anonymous_Users; this.label_Is_Available_For_Download_For_Anonymous_Users.Text = ccStatement_Details.Is_Available_For_Download_For_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Visible_To_Followers_Users.Checked = ccStatement_Details.Is_Visible_To_Followers_Users; this.label_Is_Visible_To_Followers_Users.Text = ccStatement_Details.Is_Visible_To_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked = ccStatement_Details.Is_Available_For_Download_For_Followers_Users; this.label_Is_Available_For_Download_For_Followers_Users.Text = ccStatement_Details.Is_Available_For_Download_For_Followers_Users ? "Yes" : "No"; this.label_Record_Created_By_User.Text = ccStatement_Details.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = ccStatement_Details.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = ccStatement_Details.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = ccStatement_Details.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); }
protected void button_Create_Expense_Click(object sender, EventArgs e) { if (this.Page.IsValid) { bool l_Expense_Successfully_Created = false; int l_New_Expense_Id = 0; string exception_During_Process = ""; string exception_During_Process_Extra_Data = ""; int p_User_Id = int.Parse(this.dropdown_User_Selection.SelectedValue); int p_Supplier_Id = int.Parse(this.dropdown_Supplier.SelectedValue); DateTime?p_Expense_Invoice_DateTime = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Expense_Invoice_DateTime, this.dropdown_Invoice_Time_Hours, this.dropdown_Invoice_Time_Minutes, this.dropdown_Invoice_Time_Seconds); byte p_Currency_Id = byte.Parse(this.dropdown_Currency.SelectedValue); decimal p_Total_Amount = decimal.Parse(this.textbox_Total_Amount.Text); decimal p_Vat_Percentage = decimal.Parse(this.textbox_Vat_Percentage.Text); decimal p_Total_Without_Vat = decimal.Parse(this.textbox_Total_Without_Vat.Text); decimal p_Total_Vat = decimal.Parse(this.textbox_Total_Vat.Text); int?p_Invoiced_Client_On_User_Location_Id = new int?(); string p_Invoiced_Client_To_CompanyName = this.textbox_Invoiced_To_CompanyName.Text; string p_Invoiced_Client_To_Tax_Reference = this.textbox_Invoiced_Client_To_Tax_Reference.Text; string p_Invoiced_Client_To_PersonName = this.textbox_Invoiced_To_PersonName.Text; string p_Invoiced_Client_To_PhoneNumber = this.textbox_Invoiced_Client_To_PhoneNumber.Text; short?p_Invoiced_Client_To_Country_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoiced_Client_To_Country.SelectedValue)) { p_Invoiced_Client_To_Country_Id = short.Parse(this.dropdown_Invoiced_Client_To_Country.SelectedValue); } short?p_Invoiced_Client_To_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoiced_Client_To_State.SelectedValue)) { p_Invoiced_Client_To_State_Id = short.Parse(this.dropdown_Invoiced_Client_To_State.SelectedValue); } string p_Invoiced_Client_To_City = this.textbox_Invoiced_Client_To_City.Text; string p_Invoiced_Client_To_Address = this.textbox_Invoiced_Client_To_Address.Text; string p_Invoiced_Client_To_Zip = this.textbox_Invoiced_Client_To_Zip.Text; string p_Invoiced_Client_To_EmailAddress = this.textbox_Invoiced_Client_To_EmailAddress.Text; byte p_Expense_Type_Id = byte.Parse(this.dropdown_Expense_Type.SelectedValue); string p_Invoice_Number = this.textbox_Invoice_Number.Text; string p_Invoice_Reference_Number = this.textbox_Invoice_Reference_Number.Text; string p_Invoice_Supplier_Company_Details = this.textbox_Invoice_Supplier_Company_Details.Text; string p_Invoice_Supplier_Tax_Reference = this.textbox_Invoice_Supplier_Tax_Reference.Text; short?p_Invoice_Supplier_Country_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoiced_Client_To_Country.SelectedValue)) { p_Invoice_Supplier_Country_Id = short.Parse(this.dropdown_Invoice_Supplier_Country.SelectedValue); } short?p_Invoice_Supplier_State_Id = new short?(); if (!string.IsNullOrEmpty(this.dropdown_Invoice_Supplier_State.SelectedValue)) { p_Invoice_Supplier_State_Id = short.Parse(this.dropdown_Invoice_Supplier_State.SelectedValue); } string p_Invoice_Supplier_City = this.textbox_Invoice_Supplier_City.Text; string p_Invoice_Supplier_Address_Description = this.textbox_Invoice_Supplier_Address_Description.Text; string p_Invoice_Supplier_ZipCode = this.textbox_Invoice_Supplier_ZipCode.Text; string p_Invoice_Supplier_WebAddress = this.textbox_Invoice_Supplier_WebAddress.Text; string p_Invoice_Supplier_Phone_Number = this.textbox_Invoice_Supplier_Phone_Number.Text; string p_Invoice_Supplier_Contact_FullName = this.textbox_Invoice_Supplier_Contact_FullName.Text; string p_Invoice_Content_Long_Description = this.textbox_Invoice_Content_Long_Description.Text; string p_User_Description = this.textbox_User_Description.Text; string p_User_Comments = this.textbox_User_Description.Text; string p_Original_File_Name = ""; byte[] p_File_Content_To_Save_In_Azure = new byte[0]; if (this.fileUpload_Expense_File.HasFile) { p_Original_File_Name = this.fileUpload_Expense_File.FileName; p_File_Content_To_Save_In_Azure = this.fileUpload_Expense_File.FileBytes; } bool p_Is_Visible_To_Anonymous_Users = this.checkbox_Is_Visible_To_Anonymous_Users.Checked; bool p_Is_Available_For_Download_For_Anonymous_Users = this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked; bool p_Is_Visible_To_Followers_Users = this.checkbox_Is_Visible_To_Followers_Users.Checked; bool p_Is_Available_For_Download_For_Followers_Users = this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked; int p_Record_Created_By_User_Id = base.Authenticated_User_ID; DateTime p_Record_Creation_DateTime_UTC = DateTime.UtcNow; int p_Record_Last_Updated_By_User_Id = base.Authenticated_User_ID; DateTime p_Record_Last_Updated_DateTime_UTC = DateTime.UtcNow; bool p_Is_Active = this.checkbox_Is_Active.Checked; TimeLineDashboard.Shared.Models.Expenses new_Expense_Details = null; try { new_Expense_Details = Business_Logic_Layer_Facade.Instance.Expenses_Insert_New_Expense( p_User_Id, p_Supplier_Id, p_Expense_Invoice_DateTime, p_Currency_Id, p_Total_Amount, p_Vat_Percentage, p_Total_Without_Vat, p_Total_Vat, p_Invoiced_Client_On_User_Location_Id, p_Invoiced_Client_To_CompanyName, p_Invoiced_Client_To_Tax_Reference, p_Invoiced_Client_To_PersonName, p_Invoiced_Client_To_PhoneNumber, p_Invoiced_Client_To_Country_Id, p_Invoiced_Client_To_State_Id, p_Invoiced_Client_To_City, p_Invoiced_Client_To_Address, p_Invoiced_Client_To_Zip, p_Invoiced_Client_To_EmailAddress, p_Expense_Type_Id, p_Invoice_Number, p_Invoice_Reference_Number, p_Invoice_Supplier_Company_Details, p_Invoice_Supplier_Tax_Reference, p_Invoice_Supplier_Country_Id, p_Invoice_Supplier_State_Id, p_Invoice_Supplier_City, p_Invoice_Supplier_Address_Description, p_Invoice_Supplier_ZipCode, p_Invoice_Supplier_WebAddress, p_Invoice_Supplier_Phone_Number, p_Invoice_Supplier_Contact_FullName, p_Invoice_Content_Long_Description, p_User_Description, p_User_Comments, p_Original_File_Name, p_File_Content_To_Save_In_Azure, p_Is_Visible_To_Anonymous_Users, p_Is_Available_For_Download_For_Anonymous_Users, p_Is_Visible_To_Followers_Users, p_Is_Available_For_Download_For_Followers_Users, p_Record_Created_By_User_Id, base.Authenticated_Permission_Type, p_Is_Active ); l_New_Expense_Id = new_Expense_Details.Expense_Record_Id; l_Expense_Successfully_Created = true; } catch (Exception exc) { exception_During_Process = exc.Message; if (exc.InnerException != null) { exception_During_Process_Extra_Data = exc.InnerException.Message; } } if (l_Expense_Successfully_Created && l_New_Expense_Id > 0) { // The user details was successfully created.. // Show success message and redirect the user to view page or back to users page (depends on where the user came from) Response.Redirect("list_Expenses.aspx"); } else { // show error message to the user for the failed process this.lbl_Insert_Process_Error_Result.Text = exception_During_Process; if (!string.IsNullOrEmpty(exception_During_Process_Extra_Data)) { this.lbl_Insert_Process_Error_Result.Text += " (" + exception_During_Process_Extra_Data + ")"; } } } }
protected void button_Save_Bank_Account_Transactions_Click(object sender, EventArgs e) { this.Sync_Repeater_ViewState_To_DataTable_Session(); var transcations_Current_Viewed_List_As_DataTable = ((Bank_Account_Transactions_Response_For_UI)this.Session["Back_Account_Transactions_Response"]).Bank_Account_Transactions_DataTable; // Try to grab the balance from the rows List <Bank_Account_Transactions_To_DB_Sync_From_UI> transactions_To_Sync_To_Database = new List <Bank_Account_Transactions_To_DB_Sync_From_UI>(); int errors_Counter = 0; List <int> transaction_Id_Error_Array = new List <int>(); for (int i = 0; i < this.repeater.Items.Count; i++) { Bank_Account_Transactions_To_DB_Sync_From_UI transactionToAdd = new Bank_Account_Transactions_To_DB_Sync_From_UI(); try { transactionToAdd.Bank_Account_Transaction_Id = int.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_Transaction_Record_ID")).Value); string balance = ((TextBox)this.repeater.Items[i].FindControl("txt_Balance")).Text; if (!string.IsNullOrEmpty(balance)) { transactionToAdd.Transaction_Account_Balance = decimal.Parse(balance); } var transaction_Date_Parsed = Common_Tools.Try_Parse_DateTime_By_Current_Culture(((TextBox)this.repeater.Items[i].FindControl("txt_Actual_DateTime")).Text); if (transaction_Date_Parsed.HasValue) { transactionToAdd.Transaction_Actual_DateTime = transaction_Date_Parsed.Value; } else { string exception = "Todo show exception transaction date is mandatory"; errors_Counter++; continue; // skip this item and try to save the others } string income_Value = ((TextBox)this.repeater.Items[i].FindControl("txt_Income_Value")).Text; if (!string.IsNullOrEmpty(income_Value)) { transactionToAdd.Positive_Amount_Entered = decimal.Parse(income_Value); } string obligo_Value = ((TextBox)this.repeater.Items[i].FindControl("txt_Obligo_Value")).Text; if (!string.IsNullOrEmpty(obligo_Value)) { transactionToAdd.Negative_Amount_Paid = decimal.Parse(obligo_Value); } var value_Date_Parsed = Common_Tools.Try_Parse_DateTime_By_Current_Culture(((TextBox)this.repeater.Items[i].FindControl("txt_Value_Date")).Text); if (value_Date_Parsed.HasValue) { transactionToAdd.Transaction_Value_DateTime = value_Date_Parsed; } else { transactionToAdd.Transaction_Value_DateTime = null; } transactionToAdd.Reference_Number = ((TextBox)this.repeater.Items[i].FindControl("txt_Reference")).Text; transactionToAdd.Transaction_Bank_Description = ((TextBox)this.repeater.Items[i].FindControl("txt_Description")).Text; transactionToAdd.Transaction_Bank_Inner_Reference_Code = ((TextBox)this.repeater.Items[i].FindControl("txt_Bank_Ref")).Text; transactionToAdd.Is_Visible_To_Anonymous_Users = bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_Is_Visible_To_Anonymous_Users")).Value); transactionToAdd.Is_Visible_To_Followers_Users = bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_Is_Visible_To_Followers_Users")).Value); if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_IsNewRecord")).Value)) { transactionToAdd.Is_New_Record = true; } transactionToAdd.Has_Pending_Changes = bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_PendingChanges")).Value); transactionToAdd.Is_Deleted = bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_IsDeleted")).Value); if (transactionToAdd.Has_Pending_Changes) { transactions_To_Sync_To_Database.Add(transactionToAdd); } } catch { transaction_Id_Error_Array.Add(transactionToAdd.Bank_Account_Transaction_Id); errors_Counter++; } } if (errors_Counter == 0 && transactions_To_Sync_To_Database.Count > 0) { // No errors during the preparations for the DB sync and there are transactions to sync. // We can Proceed with the save operation int bankAccountId = int.Parse(this.Request.QueryString["id"]); int succesfully_Processed_Records = 0; for (int i = 0; i < transactions_To_Sync_To_Database.Count; i++) { int transaction_Id = transactions_To_Sync_To_Database[i].Bank_Account_Transaction_Id; int affected_Saved_Rows = Business_Logic_Layer_Facade.Instance.BankAccount_Transactions_Save_Transactions_From_UI_To_Database( bankAccountId, transactions_To_Sync_To_Database[i], base.Authenticated_User_ID ); if (affected_Saved_Rows > 0) { // Row has been saved! Mark it as not a new row, And without pending changes. succesfully_Processed_Records++; for (int r = 0; r < transcations_Current_Viewed_List_As_DataTable.Rows.Count; r++) { if ((int)transcations_Current_Viewed_List_As_DataTable.Rows[r]["Bank_Account_Transaction_Id"] == transaction_Id) { transcations_Current_Viewed_List_As_DataTable.Rows[r]["Pending_Changes"] = false; transcations_Current_Viewed_List_As_DataTable.Rows[r]["Is_New_Record"] = false; transcations_Current_Viewed_List_As_DataTable.Rows[r]["Is_Deleted"] = false; transcations_Current_Viewed_List_As_DataTable.Rows[r]["Has_Error"] = false; break; } } } else { // Error syncing the row to the database! for (int r = 0; r < transcations_Current_Viewed_List_As_DataTable.Rows.Count; r++) { if ((int)transcations_Current_Viewed_List_As_DataTable.Rows[r]["Bank_Account_Transaction_Id"] == transaction_Id) { transcations_Current_Viewed_List_As_DataTable.Rows[r]["Has_Error"] = true; break; } } } } //int succesfully_Processed_Records = Business_Logic_Layer_Facade.Instance.BankAccount_Transactions_Save_Transactions_From_UI_To_Database( // bankAccountId, // transactions_To_Sync_To_Database, // base.Authenticated_User_ID // ); if (succesfully_Processed_Records == transactions_To_Sync_To_Database.Count) { // Update operations was successfull! Refresh the grid results and fully refresh paged state. this.Bind_Bank_Accounts_Transactions_Results(); this.hidden_Pending_Changes.Value = "false"; this.panel_Expired_Session_Warning.CssClass = "alert alert-warning hidden"; } else { // One or more records were not successfully updated. // Todo: Show appropriate message to the user and mark the error records that were not saved successfully. int unsuccessfullSavesCount = transactions_To_Sync_To_Database.Count - succesfully_Processed_Records; ScriptManager.RegisterStartupScript(up_Transactions, up_Transactions.GetType(), "ConfirmSaveErrors", "alert('There were errors saving " + unsuccessfullSavesCount + " records.');", true); this.repeater.DataSource = transcations_Current_Viewed_List_As_DataTable; this.repeater.DataBind(); } } else { // display another confirmation for the user that some rows has an error. // TODO: Those rows should be marked with CSS class so the user will be edit and fix them //ScriptManager.RegisterStartupScript(up_Transactions, up_Transactions.GetType(), "ConfirmSaveErrors", "alert('Some errors ');", true); ScriptManager.RegisterStartupScript(up_Transactions, up_Transactions.GetType(), "SaveErrors", "alert('There are errors saving " + transaction_Id_Error_Array.Count + " records.');", true); this.Show_Errors_Refresh_Grid(transaction_Id_Error_Array); } }
protected void Button_Run_Auto_Complete_Based_On_Selected_FileName_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.hidden_Uploading_FileName_For_AutoComplete_Helper.Value)) { this.textbox_Total_Amount.Text = string.Empty; this.textbox_Vat_Percentage.Text = string.Empty; this.textbox_Total_Without_Vat.Text = string.Empty; this.textbox_Total_Vat.Text = string.Empty; int l_User_Id_Expense_Owner = int.Parse(this.hidden_User_Id_Expense_Owner.Value); var auto_Complete_Values = Business_Logic_Layer_Facade.Instance .Expenses_Get_AutoComplete_Suggestion_Based_On_Uploaded_FileName( this.hidden_Uploading_FileName_For_AutoComplete_Helper.Value, l_User_Id_Expense_Owner, this.Authenticated_User_ID ); if (auto_Complete_Values.Expense_Invoice_DateTime.HasValue) { Common_Tools.Set_DateTime_To_ComboBoxes( auto_Complete_Values.Expense_Invoice_DateTime, this.textbox_Expense_Invoice_DateTime, this.dropdown_Invoice_Time_Hours, this.dropdown_Invoice_Time_Minutes, this.dropdown_Invoice_Time_Seconds); } if (auto_Complete_Values.Supplier_Id.HasValue) { this.dropdown_Supplier.SelectedValue = auto_Complete_Values.Supplier_Id.Value.ToString(); User_Supplier_Selected(); } Common_Tools.Set_Number_Text_Value_To_TextBox( auto_Complete_Values.Total_Amount, this.textbox_Total_Amount); Common_Tools.Set_Number_Text_Value_To_TextBox( auto_Complete_Values.Vat_Percentage, this.textbox_Vat_Percentage); Common_Tools.Set_Number_Text_Value_To_TextBox( auto_Complete_Values.Total_Without_Vat, this.textbox_Total_Without_Vat); Common_Tools.Set_Number_Text_Value_To_TextBox( auto_Complete_Values.Total_Vat, this.textbox_Total_Vat); if (auto_Complete_Values.Currency_Id.HasValue) { this.dropdown_Currency.SelectedValue = auto_Complete_Values.Currency_Id.Value.ToString(); } this.textbox_Invoice_Content_Long_Description.Text = auto_Complete_Values.Invoice_Content_Long_Description; // Set default expense type as general (unless it was already selected diffrently from previous steps ) if (string.IsNullOrEmpty(this.dropdown_Expense_Type.SelectedValue)) { this.dropdown_Expense_Type.SelectedValue = "1"; } } }
private void Sync_Repeater_ViewState() { var credit_Card_Transactions = ((Credit_Card_Transactions_Response_For_UI)this.ViewState["Credit_Card_Transactions_Response"]); for (int i = 0; i < this.repeater.Items.Count; i++) { var transaction_Date_Parsed = Common_Tools.Try_Parse_DateTime_By_Current_Culture(((TextBox)this.repeater.Items[i].FindControl("txt_Transaction_Date")).Text); if (transaction_Date_Parsed.HasValue) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Date = transaction_Date_Parsed.Value; } else { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Date = null; } credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Business_Name = ((TextBox)this.repeater.Items[i].FindControl("txt_Business_Name")).Text; string transaction_Amount = ((TextBox)this.repeater.Items[i].FindControl("txt_Transaction_Amount")).Text; decimal parsed_Transaction_Amount = 0; if (!string.IsNullOrEmpty(transaction_Amount) && decimal.TryParse(transaction_Amount, out parsed_Transaction_Amount)) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Amount = parsed_Transaction_Amount; } else { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Amount = null; } string transaction_Amount_Currency_Id = ((DropDownList)this.repeater.Items[i].FindControl("dropdown_Transaction_Amount_Currency")).SelectedValue; if (!string.IsNullOrEmpty(transaction_Amount_Currency_Id)) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Amount_Currency_Id = byte.Parse(transaction_Amount_Currency_Id); var currency_Details = Business_Logic_Layer_Facade.Instance.Currencies_Get_By_Id(byte.Parse(transaction_Amount_Currency_Id)); credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Amount_Currency_Name = currency_Details.Currency_Code + " - " + currency_Details.Currency_Symbol; } else { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Amount_Currency_Id = null; credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Amount_Currency_Name = string.Empty; } string transaction_Transaction_Actual_Payment_Amount = ((TextBox)this.repeater.Items[i].FindControl("txt_Transaction_Actual_Payment_Amount")).Text; decimal parsed_Transaction_Actual_Payment_Amount = 0; if (!string.IsNullOrEmpty(transaction_Transaction_Actual_Payment_Amount) && decimal.TryParse(transaction_Transaction_Actual_Payment_Amount, out parsed_Transaction_Actual_Payment_Amount)) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Actual_Payment_Amount = parsed_Transaction_Actual_Payment_Amount; } else { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Transaction_Actual_Payment_Amount = null; } credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Description = ((TextBox)this.repeater.Items[i].FindControl("txt_Description")).Text; if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_PendingChanges")).Value)) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Has_Pending_Changes = true; } if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_IsNewRecord")).Value)) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Is_New_Record = true; } if (bool.Parse(((HiddenField)this.repeater.Items[i].FindControl("hidden_IsDeleted")).Value)) { credit_Card_Transactions.Credit_Card_Transactions_To_DB_Sync_From_Or_To_UI[i].Is_Deleted = true; } } }
private void Set_Page_FormControls_Values() { int expense_Record_Id = int.Parse(this.Request.QueryString["id"]); int user_Id_Expense_Owner = base.Authenticated_User_ID; Expenses expenseDetails = Business_Logic_Layer_Facade.Instance.Expenses_Get_By_Id( expense_Record_Id, user_Id_Expense_Owner, base.Authenticated_User_ID, base.Authenticated_Permission_Type); if (expenseDetails != null) { this.hidden_User_Id_Expense_Owner.Value = expenseDetails.User_Id.ToString(); if (string.IsNullOrEmpty(expenseDetails.Original_File_Name)) { this.panel_Image_Download_Expense.Visible = false; this.link_Download_Expense.Target = ""; this.link_Download_Expense.NavigateUrl = ""; this.link_Download_Expense.Enabled = false; this.link_Download_Expense.Text = "N/A"; } else { this.panel_Image_Download_Expense.Visible = true; this.link_Download_Expense.Target = "_blank"; this.link_Download_Expense.NavigateUrl = "downloader.aspx?id=" + expenseDetails.Expense_Record_Id + "&type=expense"; this.link_Download_Expense.Enabled = true; this.link_Download_Expense.Text = expenseDetails.Original_File_Name; } this.link_Download_Expense2.Target = this.link_Download_Expense.Target; this.link_Download_Expense2.NavigateUrl = this.link_Download_Expense.NavigateUrl; this.link_Download_Expense2.Enabled = this.link_Download_Expense.Enabled; this.textbox_Expense_Invoice_DateTime.Text = expenseDetails.Expense_Invoice_DateTime.ToString("dd/MM/yyyy"); this.label_Expense_Invoice_DateTime.Text = expenseDetails.Expense_Invoice_DateTime.ToString("dd/MM/yyyy"); Common_Tools.Set_DateTime_To_ComboBoxes_And_Label( expenseDetails.Expense_Invoice_DateTime, this.textbox_Expense_Invoice_DateTime, this.label_Expense_Invoice_DateTime, this.dropdown_Invoice_Time_Hours, this.dropdown_Invoice_Time_Minutes, this.dropdown_Invoice_Time_Seconds, this.label_Expense_Invoice_Time ); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Supplier_Id.ToString(), this.dropdown_Supplier, this.label_Supplier); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Currency_Id.ToString(), this.dropdown_Currency, this.label_Currency); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( expenseDetails.Total_Amount, this.textbox_Total_Amount, this.label_Total_Amount); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( expenseDetails.Vat_Percentage, this.textbox_Vat_Percentage, this.label_Vat_Percentage); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( expenseDetails.Total_Without_Vat, this.textbox_Total_Without_Vat, this.label_Total_Without_Vat); Common_Tools.Set_Number_Text_Value_To_TextBox_Label_Text( expenseDetails.Total_Vat, this.textbox_Total_Vat, this.label_Total_Vat); this.textbox_Invoiced_On_User_Location_Id.Text = expenseDetails.Invoiced_Client_On_User_Location_Id.ToString(); this.label_Invoiced_On_User_Location_Id.Text = expenseDetails.Invoiced_Client_On_User_Location_Id.ToString(); this.textbox_Invoiced_Client_To_CompanyName.Text = expenseDetails.Invoiced_Client_To_CompanyName.ToString(); this.label_Invoiced_Client_To_CompanyName.Text = expenseDetails.Invoiced_Client_To_CompanyName.ToString(); this.textbox_Invoiced_Client_To_Tax_Reference.Text = expenseDetails.Invoiced_Client_To_Tax_Reference.ToString(); this.label_Invoiced_Client_To_Tax_Reference.Text = expenseDetails.Invoiced_Client_To_Tax_Reference.ToString(); this.textbox_Invoiced_Client_To_PersonName.Text = expenseDetails.Invoiced_Client_To_PersonName.ToString(); this.label_Invoiced_Client_To_PersonName.Text = expenseDetails.Invoiced_Client_To_PersonName.ToString(); this.textbox_Invoiced_Client_To_PhoneNumber.Text = expenseDetails.Invoiced_Client_To_PhoneNumber.ToString(); this.label_Invoiced_Client_To_PhoneNumber.Text = expenseDetails.Invoiced_Client_To_PhoneNumber.ToString(); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Invoiced_Client_To_Country_Id.ToString(), this.dropdown_Invoiced_Client_To_Country, this.label_Invoiced_Client_To_Country); this.Bind_Invoiced_Client_States_ComboBox(); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Invoiced_Client_To_State_Id.ToString(), this.dropdown_Invoiced_Client_To_State, this.label_Invoiced_Client_To_State); this.textbox_Invoiced_Client_To_City.Text = expenseDetails.Invoiced_Client_To_City; this.label_Invoiced_Client_To_City.Text = expenseDetails.Invoiced_Client_To_City; this.textbox_Invoiced_Client_To_Address.Text = expenseDetails.Invoiced_Client_To_Address; this.label_Invoiced_Client_To_Address.Text = expenseDetails.Invoiced_Client_To_Address; this.textbox_Invoiced_Client_To_Zip.Text = expenseDetails.Invoiced_Client_To_Zip; this.label_Invoiced_Client_To_Zip.Text = expenseDetails.Invoiced_Client_To_Zip; this.textbox_Invoiced_Client_To_Zip.Text = expenseDetails.Invoiced_Client_To_Zip; this.label_Invoiced_Client_To_Zip.Text = expenseDetails.Invoiced_Client_To_Zip; this.textbox_Invoiced_Client_To_EmailAddress.Text = expenseDetails.Invoiced_Client_To_EmailAddress; this.label_Invoiced_Client_To_EmailAddress.Text = expenseDetails.Invoiced_Client_To_EmailAddress; Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Expense_Type_Id.ToString(), this.dropdown_Expense_Type, this.label_Expense_Type); this.textbox_Invoice_Number.Text = expenseDetails.Invoice_Number; this.label_Invoice_Number.Text = expenseDetails.Invoice_Number; this.textbox_Invoice_Reference_Number.Text = expenseDetails.Invoice_Reference_Number; this.label_Invoice_Reference_Number.Text = expenseDetails.Invoice_Reference_Number; this.textbox_Invoice_Supplier_Company_Details.Text = expenseDetails.Invoice_Supplier_Company_Details; this.label_Invoice_Supplier_Company_Details.Text = expenseDetails.Invoice_Supplier_Company_Details; this.textbox_Invoice_Supplier_Tax_Reference.Text = expenseDetails.Invoice_Supplier_Tax_Reference; this.label_Invoice_Supplier_Tax_Reference.Text = expenseDetails.Invoice_Supplier_Tax_Reference; Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Invoice_Supplier_Country_Id.ToString(), this.dropdown_Invoice_Supplier_Country, this.label_Invoice_Supplier_Country); this.Bind_States_ComboBox(); Common_Tools.Set_ComboBox_Selected_Value_And_Label_Text( expenseDetails.Invoiced_Client_To_State_Id.ToString(), this.dropdown_Invoice_Supplier_State, this.label_Invoice_Supplier_State); this.textbox_Invoice_Supplier_City.Text = expenseDetails.Invoice_Supplier_City; this.label_Invoice_Supplier_City.Text = expenseDetails.Invoice_Supplier_City; this.textbox_Invoice_Supplier_Address_Description.Text = expenseDetails.Invoice_Supplier_Address_Description; this.label_Invoice_Supplier_Address_Description.Text = expenseDetails.Invoice_Supplier_Address_Description; this.textbox_Invoice_Supplier_ZipCode.Text = expenseDetails.Invoice_Supplier_ZipCode; this.label_Invoice_Supplier_ZipCode.Text = expenseDetails.Invoice_Supplier_ZipCode; this.textbox_Invoice_Supplier_WebAddress.Text = expenseDetails.Invoice_Supplier_WebAddress; this.label_Invoice_Supplier_WebAddress.Text = expenseDetails.Invoice_Supplier_WebAddress; this.textbox_Invoice_Supplier_Phone_Number.Text = expenseDetails.Invoice_Supplier_Phone_Number; this.label_Invoice_Supplier_Phone_Number.Text = expenseDetails.Invoice_Supplier_Phone_Number; this.textbox_Invoice_Supplier_Contact_FullName.Text = expenseDetails.Invoice_Supplier_Contact_FullName; this.label_Invoice_Supplier_Contact_FullName.Text = expenseDetails.Invoice_Supplier_Contact_FullName; this.textbox_Invoice_Content_Long_Description.Text = expenseDetails.Invoice_Content_Long_Description; this.label_Invoice_Content_Long_Description.Text = expenseDetails.Invoice_Content_Long_Description; this.textbox_User_Description.Text = expenseDetails.User_Description; this.label_User_Description.Text = expenseDetails.User_Description; this.textbox_User_Comments.Text = expenseDetails.User_Comments; this.label_User_Comments.Text = expenseDetails.User_Comments; this.checkbox_Is_Visible_To_Anonymous_Users.Checked = expenseDetails.Is_Visible_To_Anonymous_Users; this.label_Is_Visible_To_Anonymous_Users.Text = expenseDetails.Is_Visible_To_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Anonymous_Users.Checked = expenseDetails.Is_Available_For_Download_For_Anonymous_Users; this.label_Is_Available_For_Download_For_Anonymous_Users.Text = expenseDetails.Is_Available_For_Download_For_Anonymous_Users ? "Yes" : "No"; this.checkbox_Is_Visible_To_Followers_Users.Checked = expenseDetails.Is_Visible_To_Followers_Users; this.label_Is_Visible_To_Followers_Users.Text = expenseDetails.Is_Visible_To_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Available_For_Download_For_Followers_Users.Checked = expenseDetails.Is_Available_For_Download_For_Followers_Users; this.label_Is_Available_For_Download_For_Followers_Users.Text = expenseDetails.Is_Available_For_Download_For_Followers_Users ? "Yes" : "No"; this.checkbox_Is_Active.Checked = expenseDetails.Is_Active; this.label_Is_Active.Text = expenseDetails.Is_Active ? "Yes" : "No"; this.label_Record_Created_By_User.Text = expenseDetails.Record_Created_By_User_Details.FullName_With_Email; this.label_Record_Creation_DateTime_UTC.Text = expenseDetails.Record_Creation_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); this.label_Record_Last_Updated_By_User.Text = expenseDetails.Record_Last_Updated_By_User_Details.FullName_With_Email.ToString(); this.label_Record_Last_Updated_DateTime_UTC.Text = expenseDetails.Record_Last_Updated_DateTime_UTC.ToString("dd/MM/yyyy HH:mm:ss UTC"); } }
protected void button_Update_User_Details_Click(object sender, EventArgs e) { if (this.Page.IsValid) { bool l_User_Successfully_Updated = false; string exception_During_Process = ""; string exception_During_Process_Extra_Data = ""; int p_User_Id = int.Parse(this.Request.QueryString["id"]); string p_Username = this.textbox_Username.Text; string p_First_Name = this.textbox_First_Name.Text; string p_Middle_Name = this.textbox_Middle_Name.Text; string p_Last_Name = this.textbox_Last_Name.Text; string p_Email = this.textbox_Email.Text; short p_Country_Id = short.Parse(this.dropdown_Country.SelectedValue); short?p_State_Id = new short?(); if (this.dropdown_State.Items.Count > 0) { p_State_Id = short.Parse(this.dropdown_State.SelectedValue); } string p_City = this.textbox_City.Text; string p_Address = this.textbox_Address.Text; string p_ZipCode = this.textbox_Zipcode.Text; byte?p_Default_Currency_Id = new byte?(); if (!string.IsNullOrEmpty(this.dropdown_Currency.SelectedValue)) { p_Default_Currency_Id = byte.Parse(this.dropdown_Currency.SelectedValue); } string p_Mobile_Phone = this.textbox_Mobile_Phone.Text; string p_Additional_Phone_Number = this.textbox_Additional_Phone_Number.Text; DateTime?p_Birth_Date = new DateTime?(); if (!string.IsNullOrEmpty(this.textbox_Birth_Date.Text)) { p_Birth_Date = Common_Tools.Try_Parse_DateTime_By_Current_Culture(this.textbox_Birth_Date.Text); } byte?p_Gender = new byte?(); if (!string.IsNullOrWhiteSpace(this.dropdown_Gender.SelectedValue)) { p_Gender = byte.Parse(this.dropdown_Gender.SelectedValue); } DateTime?p_Registration_Date = new DateTime?(); if (!string.IsNullOrEmpty(this.textbox_Registration_DateTime.Text)) { p_Registration_Date = Common_Tools.Get_DateTime_From_ComboBoxes( this.textbox_Registration_DateTime, this.dropdown_Registration_Time_Hours, this.dropdown_Registration_Time_Minutes, this.dropdown_Registration_Time_Seconds); } string p_Azure_Container_Ref = this.textbox_Azure_Container_Ref.Text; string p_Heard_About_Application_From = this.textbox_Heard_About_Application_From.Text; string p_Our_Administrative_Side_Notes = this.textbox_Our_Administrative_Side_Notes.Text; bool p_Is_Active = this.checkbox_Is_Active.Checked; int p_Authenticated_User_ID = base.Authenticated_User_ID; try { l_User_Successfully_Updated = Business_Logic_Layer_Facade.Instance.Users_Update_User_Details( p_User_Id, p_Username, p_First_Name, p_Middle_Name, p_Last_Name, p_Email, p_Country_Id, p_State_Id, p_City, p_Address, p_ZipCode, p_Default_Currency_Id, p_Mobile_Phone, p_Additional_Phone_Number, p_Birth_Date, p_Gender, p_Registration_Date, p_Azure_Container_Ref, p_Heard_About_Application_From, p_Our_Administrative_Side_Notes, p_Is_Active, p_Authenticated_User_ID, this.Authenticated_Permission_Type); } catch (Exception exc) { exception_During_Process = exc.Message; if (exc.InnerException != null) { exception_During_Process_Extra_Data = exc.InnerException.Message; } } if (l_User_Successfully_Updated) { // The user details were successfully updated. // redirect the user to view read only mode Response.Redirect("manage_User.aspx?id=" + Request.QueryString["id"] + "&mode=view"); } else { // show error message to the user for the failed process this.lbl_Insert_Process_Error_Result.Text = exception_During_Process; if (!string.IsNullOrEmpty(exception_During_Process_Extra_Data)) { this.lbl_Insert_Process_Error_Result.Text += " (" + exception_During_Process_Extra_Data + ")"; } } } }