/// <summary> /// F1504_s the get copy account sub fund. /// </summary> /// <returns></returns> public static F1504CopyAccountData F1504_GetCopyAccountSubFund() { F1504CopyAccountData copyAccountSubFund = new F1504CopyAccountData(); Hashtable ht = new Hashtable(); Utility.LoadDataSet(copyAccountSubFund.F1504_ListSubFund, "f1504_pclst_SubFund", ht); return(copyAccountSubFund); }
/// <summary> /// Populates the sub fund combo. /// </summary> private void PopulateSubFundCombo() { ////populating SubFund Combo this.copyaccountDataset = this.form1504Control.WorkItem.F1504_GetCopyAccountSubFund(); this.SubFundCombo.DataSource = this.copyaccountDataset.F1504_ListSubFund; this.SubFundCombo.DisplayMember = this.copyaccountDataset.F1504_ListSubFund.SubFundColumn.ColumnName; this.SubFundCombo.ValueMember = this.copyaccountDataset.F1504_ListSubFund.SubFundColumn.ColumnName; this.SubFundCombo.SelectedIndex = 0; }
/// <summary> /// F1504_s the get account detail. /// </summary> /// <param name="accountId">The account id.</param> /// <returns></returns> public static F1504CopyAccountData F1504_GetAccountDetail(int accountId) { F1504CopyAccountData getAccountDetail = new F1504CopyAccountData(); Hashtable ht = new Hashtable(); ht.Add("@AccountID", accountId); Utility.LoadDataSet(getAccountDetail.F1504_GetAccountDetail, "f1504_pcget_AccountDetail", ht); return(getAccountDetail); }
/// <summary> /// Saves the copy account details. /// </summary> private void SaveCopyAccountDetails() { int rollyear = 0; ////Checking Rollyear is empty and roll year should not be zero if (string.IsNullOrEmpty(this.RollYearTextBox.Text.Trim())) { MessageBox.Show(SharedFunctions.GetResourceString("RequiredField"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error); this.RollYearTextBox.Focus(); return; } if (this.RollYearTextBox.Text.Equals("0")) { MessageBox.Show(SharedFunctions.GetResourceString("RequiredField"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error); this.RollYearTextBox.Focus(); return; } ////Checking Subfund combo should not be null if (string.IsNullOrEmpty(this.SubFundCombo.Text.ToString())) { MessageBox.Show(SharedFunctions.GetResourceString("RequiredField"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Error); this.SubFundCombo.Focus(); return; } ////Try Parse rollyear value if (!string.IsNullOrEmpty(this.RollYearTextBox.Text.Trim())) { int.TryParse(this.RollYearTextBox.Text.ToString(), out rollyear); } ////DB Call for save this.copyaccountDataset = this.form1504Control.WorkItem.F1504_SaveCopyAccountDetails(rollyear, this.SubFundCombo.Text.Trim(), this.DescriptionTextBox.Text.Trim(), this.FunctionTextBox.Text.Trim(), this.BarsTextBox.Text.Trim(), this.ObjectTextBox.Text.Trim(), this.LineTextBox.Text.Trim(), TerraScanCommon.UserId.ToString()); ////Message will be thrown based on the retrun value int keyValue = 0; if (this.copyaccountDataset.F1504_SaveCopyAccount.Rows.Count > 0) { if (!string.IsNullOrEmpty(this.copyaccountDataset.F1504_SaveCopyAccount.Rows[0][0].ToString())) { int.TryParse(this.copyaccountDataset.F1504_SaveCopyAccount.Rows[0][0].ToString(), out keyValue); } this.ShowMessageBasedOnResultValue(keyValue, this.copyaccountDataset.F1504_SaveCopyAccount.Rows[0][1].ToString()); } }
/// <summary> /// F1504_s the save copy account details. /// </summary> /// <param name="rollYear">The roll year.</param> /// <param name="subFund">The sub fund.</param> /// <param name="description">The description.</param> /// <param name="function">The function.</param> /// <param name="bars">The bars.</param> /// <param name="accObject">The acc object.</param> /// <param name="line">The line.</param> /// <param name="userId">The user id.</param> /// <returns></returns> public static F1504CopyAccountData F1504_SaveCopyAccountDetails(int rollYear, string subFund, string description, string function, string bars, string accObject, string line, string userId) { F1504CopyAccountData copyAccountDataSet = new F1504CopyAccountData(); Hashtable ht = new Hashtable(); ht.Add("@RollYear", rollYear); ht.Add("@SubFund", subFund); ht.Add("@Description", description); ht.Add("@Function", function); ht.Add("@Bars", bars); ht.Add("@Object", accObject); ht.Add("@Line", line); ht.Add("@UserID", userId); Utility.LoadDataSet(copyAccountDataSet.F1504_SaveCopyAccount, "f1504_pcins_Account", ht); return(copyAccountDataSet); }
/// <summary> /// Populates the control values. /// </summary> /// <param name="accountId">The account id.</param> private void PopulateControlValues(int accountId) { ////Calling DB for the Copy Account Details this.copyaccountDataset = this.form1504Control.WorkItem.F1504_GetAccountDetail(accountId); this.Cursor = Cursors.WaitCursor; if (this.copyaccountDataset.F1504_GetAccountDetail.Rows.Count > 0) { ////Assigning Values to the control this.RollYearTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.RollYearColumn].ToString(); this.SubFundCombo.SelectedValue = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.SubFundColumn].ToString(); this.DescriptionTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.AcctDescColumn].ToString(); ////Based on the function flag function textbox will get enable/Disable and populate the value if (!string.IsNullOrEmpty(this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.FunctionFlagColumn].ToString()) && this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.FunctionFlagColumn].ToString().Equals("True")) { this.FunctionTextBox.Enabled = true; this.FunctionTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.FunctionIDColumn].ToString(); } else { this.FunctionTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.FunctionIDColumn].ToString(); this.FunctionTextBox.Enabled = false; } ////Based on the Bars flag Bars textbox will get enable/Disable and populate the value if (!string.IsNullOrEmpty(this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.BarsFlagColumn].ToString()) && this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.BarsFlagColumn].ToString().Equals("True")) { this.BarsTextBox.Enabled = true; this.BarsTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.BarIDColumn].ToString(); } else { this.BarsTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.BarIDColumn].ToString(); this.BarsTextBox.Enabled = false; } ////Based on the Object flag Object textbox will get enable/Disable and populate the value if (!string.IsNullOrEmpty(this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.ObjectFlagColumn].ToString()) && this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.ObjectFlagColumn].ToString().Equals("True")) { this.ObjectTextBox.Enabled = true; this.ObjectTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.ObjectIDColumn].ToString(); } else { this.ObjectTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.ObjectIDColumn].ToString(); this.ObjectTextBox.Enabled = false; } ////Based on the Line flag Line textbox will get enable/Disable and populate the value if (!string.IsNullOrEmpty(this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.LineFlagColumn].ToString()) && this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.LineFlagColumn].ToString().Equals("True")) { this.LineTextBox.Enabled = true; this.LineTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.LineIDColumn].ToString(); } else { this.LineTextBox.Text = this.copyaccountDataset.F1504_GetAccountDetail.Rows[0][this.copyaccountDataset.F1504_GetAccountDetail.LineIDColumn].ToString(); this.LineTextBox.Enabled = false; } } else { ////If record is not available then clearing all fields. this.ClearControls(); } this.Cursor = Cursors.Default; }