void btnUpdateLead_Click(object sender, RoutedEventArgs e) { try { //Int64 varID = parentRow; //objLeadFormat = ClsLeadFormatBusiness.GetByLeadFormatID(varID); if (objLeadFormat.LeadFormatName.ToLower() != txtLeadFormatName.Text.ToLower() || objLeadFormat.Description.ToLower() != txtDescription.Text.ToLower()) { objLeadFormat.LeadFormatName = txtLeadFormatName.Text; objLeadFormat.Description = txtDescription.Text; objLeadFormat.FormatType = cmbFormatType.SelectionBoxItem.ToString(); int cntRecord = objLeadFormat.LeadFormatSave(); if (cntRecord > 0) { MessageBox.Show("Records Successfully Updated"); } } else { MessageBox.Show("No Change In Record"); } //shilpa code this.CtlGridChild.Visibility = Visibility.Hidden; funSetGrid(); this.CtlGrid.Visibility = Visibility.Visible; txtLeadFormatName.Text = ""; //cmbFieldType.IsEnabled = true; cmbFormatType.IsEnabled = true; txtDescription.Text = ""; btnNext.Visibility = Visibility.Visible; btnUpdateLead.Visibility = Visibility.Hidden; tbiDispositions.IsEnabled = false; } catch (Exception ex) { VMuktiHelper.ExceptionHandler(ex, "btnUpdateLead_Click()", "ctlLeadFormatDesigner.xaml.cs"); } }
void btnSave_Click(object sender, RoutedEventArgs e) { try { bool checkValue = false; if (((ListBoxItem)cmbFieldName.SelectedItem).Tag.ToString() == "") { MessageBox.Show("Select Field Name"); } else { int affectedRow; ClsLeadFormatBusiness LeadFormat = new ClsLeadFormatBusiness(); if ((TempString1.ToLower() != txtLeadFormatName.Text.ToLower()) && flag == 0) { flag = 1; // LeadFormat.LeadFormatID = -2; } else if ((TempString1.ToLower() == txtLeadFormatName.Text.ToLower())) { flag = 0; // LeadFormat.LeadFormatID = curID; } TempString1 = txtLeadFormatName.Text; LeadFormat.ID = -1; LeadFormat.LeadFormatName = txtLeadFormatName.Text; LeadFormat.FormatType = cmbFormatType.SelectionBoxItem.ToString(); LeadFormat.Description = txtDescription.Text; LeadFormat.FieldID = Convert.ToInt64(((ListBoxItem)cmbFieldName.SelectedItem).Tag); LeadFormat.DefaultValue = txtDefaultValue.Text; //LeadFormat.LeadFormatID = -2; LeadFormat.LeadFieldsID = -1; LeadFormat.IsRequired = true; if (isEditing) { LeadFormat.LeadFormatID = curID; } else { LeadFormat.LeadFormatID = -2; } if (cmbSelection == "excel" || cmbSelection == "csv") { if (cmbColumn.SelectionBoxItem.ToString() != "") { LeadFormat.StartPosition = int.Parse(cmbColumn.SelectionBoxItem.ToString()); LeadFormat.Length = 0; LeadFormat.Delimiters = null; checkValue = true; } else { checkValue = false; MessageBox.Show("Select map column"); } } else { if (txtFieldStartPosition.Text == "" || txtFieldLength.Text == "" || cmbDelimiter.SelectionBoxItem.ToString() == "") { MessageBox.Show("Enter all required information"); checkValue = false; } else { LeadFormat.StartPosition = int.Parse(txtFieldStartPosition.Text); LeadFormat.Length = int.Parse(txtFieldLength.Text); LeadFormat.Delimiters = cmbDelimiter.SelectionBoxItem.ToString(); checkValue = true; } } if (checkValue == true) { if (flag == 1) { affectedRow = LeadFormat.LeadFormatSave(); flag = 0; //funSetGrid(); } int cntInsert = 0; cntInsert = LeadFormat.LeadFormatDesignerSave(); if (cntInsert > 0) { cmbColumn.Items.Remove(cmbColumn.SelectedItem); BlankFields(); } } } if (parentRow != -1) { CtlGrid.Visibility = Visibility.Hidden; CtlGridChild.Visibility = Visibility.Visible; btnUpdateLead.Visibility = Visibility.Visible; btnNext.Visibility = Visibility.Hidden; funSetChildGrid(parentRow); } } catch (NullReferenceException ex) { VMuktiHelper.ExceptionHandler(ex, "btnSave_Click()", "ctlLeadFormatDesigner.xaml.cs"); } }