protected void btnRefresh_Click(object sender, EventArgs e)
        {
            Page.Validate("Search");
            if (Page.IsValid)
            {
                var letter = ConfirmationLetterService.GetConfirmationLetter(txtConfirmationLetterNo.Text);
                if (letter == null)
                {
                    WebFormHelper.SetLabelTextWithCssClass(lblStatus,
                                                           String.Format("Cannot find Confirmation Letter {0}", txtConfirmationLetterNo.Text),
                                                           LabelStyleNames.ErrorMessage);
                    return;
                }
                else
                {
                    if (letter.VoidDate.HasValue)
                    {
                        WebFormHelper.SetLabelTextWithCssClass(lblStatus,
                                                               String.Format("Confirmation Letter {0} has been marked as void.",
                                                                             txtConfirmationLetterNo.Text),
                                                               LabelStyleNames.ErrorMessage);
                        return;
                    }
                }

                txtConfirmationLetterNo.ReadOnly = true;
                ConfirmationLetterDetail1.LoadConfirmationLetter(txtConfirmationLetterNo.Text);
                pnlReceiveDate.Visible = true;
                txtReason.Focus();
            }
        }
        protected void sdsMaster_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
        {
            var letter = ConfirmationLetterService.GetConfirmationLetter(Convert.ToInt32(Request["LetterID"]));

            e.Command.Parameters["@Customer"].Value     = txtFindName.Text;
            e.Command.Parameters["@CustomerType"].Value = ddlFindCustomerType.SelectedValue;
            e.Command.Parameters["@Gender"].Value       = ddlFindGender.SelectedValue;
            e.Command.Parameters["@LetterNo"].Value     = letter.LetterNo;
        }
Пример #3
0
 protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName == "EditRow")
     {
         mvwForm.SetActiveView(viwAddEdit);
         RowID             = Convert.ToInt32(e.CommandArgument);
         hidLetterID.Value = Convert.ToString(RowID);
         var letter = ConfirmationLetterService.GetConfirmationLetter(RowID);
         ViewState["LetterNo"] = letter.LetterNo;
         ConfirmationLetterDetail1.LoadConfirmationLetter(letter.LetterNo);
         FillDropDown();
     }
 }
Пример #4
0
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "EditRow")
            {
                mvwForm.SetActiveView(viwAddEdit);
                FillDropDown();
                RowID = Convert.ToInt32(e.CommandArgument);

                var letter    = ConfirmationLetterService.GetConfirmationLetter(RowID);
                var customer  = letter.Customer;
                var refLetter = letter.ConfirmationLetter2;

                lblConfirmationLetterNo.Text    = letter.LetterNo;
                cboAccountManager.SelectedValue = letter.AccountManagerID.ToString();
                txtCustomerName.Text            = customer.Name;
                hidCustomerCode.Value           = customer.Code;
                txtTrainingLocation.Text        = letter.TrainingLocation;
                txtDescription.Text             = letter.Description;
                ddlClassType.SelectedValue      = letter.ClassTypeID.ToString();
                ddlTopic.SelectedValue          = letter.TopicID.ToString();
                txtCLRef.Text                  = refLetter == null ? String.Empty : refLetter.LetterNo;
                ntbPrice.Value                 = Convert.ToDouble(letter.Price);
                ntbTax.Value                   = Convert.ToDouble(letter.Tax);
                ntbPPH.Value                   = Convert.ToDouble(letter.PPH);
                ntbDiscount.Value              = Convert.ToDouble(letter.Discount);
                ntbTotalPrice.Value            = Convert.ToDouble(letter.TotalPrice);
                ddlBank.SelectedValue          = Convert.ToString(letter.TransferToBankID.GetValueOrDefault());
                dtpPaymentDueDate.SelectedDate = letter.PaymentDueDate;
                ntbTotalParticipants.Value     = letter.TotalParticipants;
                letter.Modules.ForEach(module => cblModule.Items.Cast <ListItem>().SingleOrDefault(item => item.Value == module.ID.ToString(CultureInfo.InvariantCulture)).Selected = true);

                hypCLRef.Attributes.Add("onclick", "window.open('PromptConfirmationLetter.aspx?CLNo=ctl00_cphMainContent_txtCLRef&CurrentCLNo=" + letter.LetterNo + "', null, 550, 1000);");

                cboAccountManager.Focus();

                if (letter.VoidDate.HasValue)
                {
                    btnSave.Enabled = false;
                    WebFormHelper.SetLabelTextWithCssClass(lblStatusAddEdit, "This letter has been marked as void", LabelStyleNames.ErrorMessage);
                }

                TrainingDates = ConfirmationLetterService.GetTrainingDates(RowID).Select(date => date.Date).ToList();
                LoadTrainingDates();
                //txtName.Focus();
            }
        }