Esempio n. 1
0
 protected override void ClearText(object sender, System.EventArgs e)
 {
     this.SelectedBenefit = null;
     if (this.OnBenefitSelected != null)
     {
         this.OnBenefitSelected(null);
     }
 }
Esempio n. 2
0
 public void Selected(Benefit benefit)
 {
     this.SelectedBenefit = benefit;
     if (this.OnBenefitSelected != null)
     {
         this.OnBenefitSelected(benefit);
     }
 }
Esempio n. 3
0
 public AddBenefitForm(Benefit bn)
     : this()
 {
     if ((bn == null) || (bn == Benefit.Null))
     {
         this.set_Text("Добавление льготы");
         this.benefit = Benefit.Null;
     }
     else
     {
         this.set_Text("Изменение льготы");
         this.benefit = bn;
         this.tbxCode.set_Text(this.benefit.Code.ToString());
         this.tbxExternalCode.set_Text((this.benefit.ExternalCode == 0) ? ((string) "") : ((int) this.benefit.ExternalCode).ToString());
         this.tbxShortName.set_Text(this.benefit.ShortName);
         this.tbxLongName.set_Text(this.benefit.LongName);
     }
 }
 private void InitializeComponent()
 {
     this.components = new Container();
     Benefit benefit = new Benefit();
     this.label5 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.label2 = new System.Windows.Forms.Label();
     this.label1 = new System.Windows.Forms.Label();
     this.btnSetToResidents = new System.Windows.Forms.Button();
     this.nudToResidents = new System.Windows.Forms.NumericUpDown();
     this.bsBenefitNormsForSquare = new System.Windows.Forms.BindingSource(this.components);
     this.nudFromResidents = new System.Windows.Forms.NumericUpDown();
     this.nudSumm = new System.Windows.Forms.NumericUpDown();
     this.btnCancel = new System.Windows.Forms.Button();
     this.btnYes = new System.Windows.Forms.Button();
     this.dbFromDate = new DateBox();
     this.selectBenefit1 = new SelectBenefit();
     this.label6 = new System.Windows.Forms.Label();
     this.nudToResidents.BeginInit();
     this.bsBenefitNormsForSquare.BeginInit();
     this.nudFromResidents.BeginInit();
     this.nudSumm.BeginInit();
     base.SuspendLayout();
     this.label5.set_AutoSize(true);
     this.label5.set_Location(new System.Drawing.Point(12, 0x4e));
     this.label5.set_Name("label5");
     this.label5.set_Size(new System.Drawing.Size(0x19, 13));
     this.label5.set_TabIndex(0x1a);
     this.label5.set_Text("До:");
     this.label4.set_AutoSize(true);
     this.label4.set_Location(new System.Drawing.Point(12, 0x68));
     this.label4.set_Name("label4");
     this.label4.set_Size(new System.Drawing.Size(0x3d, 13));
     this.label4.set_TabIndex(0x19);
     this.label4.set_Text("Норматив:");
     this.label3.set_AutoSize(true);
     this.label3.set_Location(new System.Drawing.Point(12, 0x34));
     this.label3.set_Name("label3");
     this.label3.set_Size(new System.Drawing.Size(0x17, 13));
     this.label3.set_TabIndex(0x18);
     this.label3.set_Text("От:");
     this.label2.set_AutoSize(true);
     this.label2.set_Location(new System.Drawing.Point(12, 0x1d));
     this.label2.set_Name("label2");
     this.label2.set_Size(new System.Drawing.Size(0x9d, 13));
     this.label2.set_TabIndex(0x17);
     this.label2.set_Text("На количество проживающих");
     this.label1.set_AutoSize(true);
     this.label1.set_Location(new System.Drawing.Point(12, 9));
     this.label1.set_Name("label1");
     this.label1.set_Size(new System.Drawing.Size(0x5e, 13));
     this.label1.set_TabIndex(0x16);
     this.label1.set_Text("Дата норматива:");
     this.btnSetToResidents.set_Location(new System.Drawing.Point(0x10d, 0x4c));
     this.btnSetToResidents.set_Name("btnSetToResidents");
     this.btnSetToResidents.set_Size(new System.Drawing.Size(0x54, 20));
     this.btnSetToResidents.set_TabIndex(20);
     this.btnSetToResidents.set_Text("бесконечно");
     this.btnSetToResidents.set_UseVisualStyleBackColor(true);
     this.btnSetToResidents.add_Click(new System.EventHandler(this.btnSetToResidents_Click));
     this.nudToResidents.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsBenefitNormsForSquare, "ToResidents", true));
     this.nudToResidents.set_Location(new System.Drawing.Point(0x6d, 0x4c));
     int[] numArray = new int[4];
     numArray[0] = 0xff;
     this.nudToResidents.set_Maximum(new decimal(numArray));
     this.nudToResidents.set_Name("nudToResidents");
     this.nudToResidents.set_Size(new System.Drawing.Size(0x9a, 20));
     this.nudToResidents.set_TabIndex(0x13);
     this.bsBenefitNormsForSquare.set_DataSource(typeof(BenefitNormsForSquare));
     this.nudFromResidents.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsBenefitNormsForSquare, "FromResidents", true));
     this.nudFromResidents.set_Location(new System.Drawing.Point(0x6d, 50));
     int[] numArray2 = new int[4];
     numArray2[0] = 0xff;
     this.nudFromResidents.set_Maximum(new decimal(numArray2));
     this.nudFromResidents.set_Name("nudFromResidents");
     this.nudFromResidents.set_Size(new System.Drawing.Size(0xf4, 20));
     this.nudFromResidents.set_TabIndex(0x12);
     this.nudSumm.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsBenefitNormsForSquare, "Value", true));
     this.nudSumm.set_DecimalPlaces(2);
     this.nudSumm.set_Location(new System.Drawing.Point(0x6d, 0x66));
     int[] numArray3 = new int[4];
     numArray3[0] = 0x6fc10000;
     numArray3[1] = 0x2386f2;
     this.nudSumm.set_Maximum(new decimal(numArray3));
     this.nudSumm.set_Name("nudSumm");
     this.nudSumm.set_Size(new System.Drawing.Size(0xf4, 20));
     this.nudSumm.set_TabIndex(0x11);
     this.btnCancel.set_Anchor(System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);
     this.btnCancel.set_Location(new System.Drawing.Point(0x116, 0x99));
     this.btnCancel.set_Name("btnCancel");
     this.btnCancel.set_Size(new System.Drawing.Size(0x4b, 0x17));
     this.btnCancel.set_TabIndex(15);
     this.btnCancel.set_Text("Отмена");
     this.btnCancel.set_UseVisualStyleBackColor(true);
     this.btnCancel.add_Click(new System.EventHandler(this.btnCancel_Click));
     this.btnYes.set_Anchor(System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);
     this.btnYes.set_Location(new System.Drawing.Point(0xc5, 0x99));
     this.btnYes.set_Name("btnYes");
     this.btnYes.set_Size(new System.Drawing.Size(0x4b, 0x17));
     this.btnYes.set_TabIndex(14);
     this.btnYes.set_UseVisualStyleBackColor(true);
     this.btnYes.add_Click(new System.EventHandler(this.btnYes_Click));
     this.dbFromDate.AttachToPeriod = false;
     this.dbFromDate.AttachToPeriodEnd = false;
     this.dbFromDate.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsBenefitNormsForSquare, "FromDate", true));
     this.dbFromDate.set_Location(new System.Drawing.Point(0x70, 6));
     this.dbFromDate.set_Mask("00/00/0000");
     this.dbFromDate.set_Name("dbFromDate");
     this.dbFromDate.set_Size(new System.Drawing.Size(100, 20));
     this.dbFromDate.set_TabIndex(0x10);
     this.selectBenefit1.set_Location(new System.Drawing.Point(0x6d, 0x80));
     this.selectBenefit1.set_Name("selectBenefit1");
     benefit.BudgetTypeId = 0;
     benefit.BudgetTypeName = null;
     benefit.CalcFeature = 0;
     benefit.CalcFeatureName = null;
     benefit.Code = null;
     benefit.Id = 0L;
     benefit.IsAddress = 0;
     benefit.IsDeleted = false;
     benefit.IsDirty = true;
     benefit.LawId = 0L;
     benefit.LawName = null;
     benefit.LongName = null;
     benefit.ObjectWithIdType = null;
     benefit.OrgId = 0L;
     benefit.OrgName = null;
     benefit.ShortName = null;
     this.selectBenefit1.set_Size(new System.Drawing.Size(0xf4, 20));
     this.selectBenefit1.set_TabIndex(0x1b);
     this.label6.set_AutoSize(true);
     this.label6.set_Location(new System.Drawing.Point(12, 0x83));
     this.label6.set_Name("label6");
     this.label6.set_Size(new System.Drawing.Size(0x2e, 13));
     this.label6.set_TabIndex(0x1c);
     this.label6.set_Text("Льгота:");
     base.set_AutoScaleDimensions(new System.Drawing.SizeF(6f, 13f));
     base.set_AutoScaleMode(System.Windows.Forms.AutoScaleMode.Font);
     base.set_ClientSize(new System.Drawing.Size(0x16d, 0xbc));
     base.Controls.Add(this.label6);
     base.Controls.Add(this.selectBenefit1);
     base.Controls.Add(this.label5);
     base.Controls.Add(this.label4);
     base.Controls.Add(this.label3);
     base.Controls.Add(this.label2);
     base.Controls.Add(this.label1);
     base.Controls.Add(this.btnSetToResidents);
     base.Controls.Add(this.nudToResidents);
     base.Controls.Add(this.nudFromResidents);
     base.Controls.Add(this.nudSumm);
     base.Controls.Add(this.dbFromDate);
     base.Controls.Add(this.btnCancel);
     base.Controls.Add(this.btnYes);
     base.set_Name("BenefitNormsForSquareAddChangeForm");
     base.set_StartPosition(System.Windows.Forms.FormStartPosition.CenterParent);
     this.set_Text("BenefitNormsForSquareAddChangeForm");
     base.add_FormClosing(new System.Windows.Forms.FormClosingEventHandler(this.BenefitNormsForElectricAddChangeForm_FormClosing));
     this.nudToResidents.EndInit();
     this.bsBenefitNormsForSquare.EndInit();
     this.nudFromResidents.EndInit();
     this.nudSumm.EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
 private void InitializeComponent()
 {
     this.components = new Container();
     FasetItem item = new FasetItem();
     Organization organization = new Organization();
     Benefit benefit = new Benefit();
     this.bsBenefitNormsForGaz = new System.Windows.Forms.BindingSource(this.components);
     this.btnCancel = new System.Windows.Forms.Button();
     this.btnYes = new System.Windows.Forms.Button();
     this.label4 = new System.Windows.Forms.Label();
     this.label1 = new System.Windows.Forms.Label();
     this.nudSumm = new System.Windows.Forms.NumericUpDown();
     this.dbFromDate = new DateBox();
     this.selectFasetData = new SelectFasetData();
     this.bsFasets = new System.Windows.Forms.BindingSource(this.components);
     this.selectFasetDataExcept = new SelectFasetData();
     this.cbSelectFaset = new System.Windows.Forms.ComboBox();
     this.cbSelectFasetExcept = new System.Windows.Forms.ComboBox();
     this.bsFasetsExcept = new System.Windows.Forms.BindingSource(this.components);
     this.label2 = new System.Windows.Forms.Label();
     this.label3 = new System.Windows.Forms.Label();
     this.selectBenefit1 = new SelectBenefit();
     this.label5 = new System.Windows.Forms.Label();
     this.bsBenefitNormsForGaz.BeginInit();
     this.nudSumm.BeginInit();
     this.bsFasets.BeginInit();
     this.bsFasetsExcept.BeginInit();
     base.SuspendLayout();
     this.bsBenefitNormsForGaz.set_DataSource(typeof(BenefitNormsForGas));
     this.btnCancel.set_Anchor(System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);
     this.btnCancel.set_Location(new System.Drawing.Point(430, 0x8e));
     this.btnCancel.set_Name("btnCancel");
     this.btnCancel.set_Size(new System.Drawing.Size(0x4b, 0x17));
     this.btnCancel.set_TabIndex(3);
     this.btnCancel.set_Text("Отмена");
     this.btnCancel.set_UseVisualStyleBackColor(true);
     this.btnCancel.add_Click(new System.EventHandler(this.btnCancel_Click));
     this.btnYes.set_Anchor(System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom);
     this.btnYes.set_Location(new System.Drawing.Point(0x15d, 0x8e));
     this.btnYes.set_Name("btnYes");
     this.btnYes.set_Size(new System.Drawing.Size(0x4b, 0x17));
     this.btnYes.set_TabIndex(2);
     this.btnYes.set_UseVisualStyleBackColor(true);
     this.btnYes.add_Click(new System.EventHandler(this.btnYes_Click));
     this.label4.set_AutoSize(true);
     this.label4.set_Location(new System.Drawing.Point(13, 90));
     this.label4.set_Name("label4");
     this.label4.set_Size(new System.Drawing.Size(0x3d, 13));
     this.label4.set_TabIndex(0x17);
     this.label4.set_Text("Норматив:");
     this.label1.set_AutoSize(true);
     this.label1.set_Location(new System.Drawing.Point(12, 9));
     this.label1.set_Name("label1");
     this.label1.set_Size(new System.Drawing.Size(0x5e, 13));
     this.label1.set_TabIndex(20);
     this.label1.set_Text("Дата норматива:");
     this.nudSumm.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsBenefitNormsForGaz, "Value", true));
     this.nudSumm.set_DecimalPlaces(2);
     this.nudSumm.set_Location(new System.Drawing.Point(0x70, 0x58));
     int[] numArray = new int[4];
     numArray[0] = 0x6fc10000;
     numArray[1] = 0x2386f2;
     this.nudSumm.set_Maximum(new decimal(numArray));
     this.nudSumm.set_Name("nudSumm");
     this.nudSumm.set_Size(new System.Drawing.Size(190, 20));
     this.nudSumm.set_TabIndex(15);
     this.dbFromDate.AttachToPeriod = false;
     this.dbFromDate.AttachToPeriodEnd = false;
     this.dbFromDate.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bsBenefitNormsForGaz, "FromDate", true));
     this.dbFromDate.set_Location(new System.Drawing.Point(0x70, 6));
     this.dbFromDate.set_Mask("00/00/0000");
     this.dbFromDate.set_Name("dbFromDate");
     this.dbFromDate.set_Size(new System.Drawing.Size(100, 20));
     this.dbFromDate.set_TabIndex(14);
     this.selectFasetData.set_FormattingEnabled(true);
     this.selectFasetData.set_Location(new System.Drawing.Point(0x134, 0x20));
     this.selectFasetData.set_Name("selectFasetData");
     this.selectFasetData.set_Size(new System.Drawing.Size(0xc2, 0x15));
     this.selectFasetData.set_Sorted(true);
     this.selectFasetData.set_TabIndex(0x18);
     this.bsFasets.set_DataSource(typeof(Faset));
     this.selectFasetDataExcept.set_FormattingEnabled(true);
     this.selectFasetDataExcept.set_Location(new System.Drawing.Point(0x134, 0x40));
     this.selectFasetDataExcept.set_Name("selectFasetDataExcept");
     this.selectFasetDataExcept.set_Size(new System.Drawing.Size(0xc2, 0x15));
     this.selectFasetDataExcept.set_Sorted(true);
     this.selectFasetDataExcept.set_TabIndex(0x19);
     this.cbSelectFaset.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsBenefitNormsForGaz, "FasetName", true));
     this.cbSelectFaset.set_DataSource(this.bsFasets);
     this.cbSelectFaset.set_DisplayMember("Name");
     this.cbSelectFaset.set_FormattingEnabled(true);
     this.cbSelectFaset.set_Location(new System.Drawing.Point(0x70, 0x20));
     this.cbSelectFaset.set_Name("cbSelectFaset");
     this.cbSelectFaset.set_Size(new System.Drawing.Size(190, 0x15));
     this.cbSelectFaset.set_TabIndex(0x1a);
     this.cbSelectFaset.set_ValueMember("Id");
     this.cbSelectFaset.add_SelectedIndexChanged(new System.EventHandler(this.cbSelectFaset_SelectedIndexChanged));
     this.cbSelectFasetExcept.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsBenefitNormsForGaz, "ExceptFasetName", true));
     this.cbSelectFasetExcept.set_DataSource(this.bsFasetsExcept);
     this.cbSelectFasetExcept.set_DisplayMember("Name");
     this.cbSelectFasetExcept.set_FormattingEnabled(true);
     this.cbSelectFasetExcept.set_Location(new System.Drawing.Point(0x70, 0x3d));
     this.cbSelectFasetExcept.set_Name("cbSelectFasetExcept");
     this.cbSelectFasetExcept.set_Size(new System.Drawing.Size(190, 0x15));
     this.cbSelectFasetExcept.set_TabIndex(0x1b);
     this.cbSelectFasetExcept.set_ValueMember("Id");
     this.cbSelectFasetExcept.add_SelectedIndexChanged(new System.EventHandler(this.cbSelectFasetExcept_SelectedIndexChanged));
     this.bsFasetsExcept.set_DataSource(typeof(Faset));
     this.label2.set_AutoSize(true);
     this.label2.set_Location(new System.Drawing.Point(13, 0x20));
     this.label2.set_Name("label2");
     this.label2.set_Size(new System.Drawing.Size(0x4c, 13));
     this.label2.set_TabIndex(0x1c);
     this.label2.set_Text("Норматив на:");
     this.label3.set_AutoSize(true);
     this.label3.set_Location(new System.Drawing.Point(12, 0x40));
     this.label3.set_Name("label3");
     this.label3.set_Size(new System.Drawing.Size(0x59, 13));
     this.label3.set_TabIndex(0x1d);
     this.label3.set_Text("При отсутствии:");
     item.FasetId = FasetsEnum.None;
     item.Id = 0;
     item.Name = "<не выбрано>";
     organization.Code = 0L;
     organization.Created = new System.DateTime(0L);
     organization.FromDate = new System.DateTime(0L);
     organization.Created = new System.DateTime(0L);
     organization.ToDate = new System.DateTime(0L);
     organization.FromDate = new System.DateTime(0L);
     organization.Id = 0L;
     organization.Inn = 0L;
     organization.IsBenefitTransferrer = false;
     organization.IsCashlessTransferrer = false;
     organization.IsDeleted = false;
     organization.IsDirty = false;
     organization.IsFlatOwner = false;
     organization.IsHouseHolder = false;
     organization.IsServiceProvider = false;
     organization.Kpp = 0L;
     organization.LongName = "<не выбрано>";
     organization.ObjectWithIdType = null;
     organization.Ogrn = 0L;
     organization.Parent = organization;
     organization.ParentId = 0L;
     organization.ShortName = "<не выбрано>";
     organization.ToDate = new System.DateTime(0L);
     this.selectBenefit1.set_Location(new System.Drawing.Point(0x70, 0x72));
     this.selectBenefit1.set_Name("selectBenefit1");
     benefit.CalcFeature = 0;
     benefit.CalcFeatureName = null;
     benefit.Code = null;
     benefit.Id = 0L;
     benefit.IsAddress = 0;
     benefit.IsDeleted = false;
     benefit.IsDirty = false;
     benefit.LongName = null;
     benefit.ObjectWithIdType = null;
     benefit.ShortName = null;
     this.selectBenefit1.set_Size(new System.Drawing.Size(390, 20));
     this.selectBenefit1.set_TabIndex(30);
     this.label5.set_AutoSize(true);
     this.label5.set_Location(new System.Drawing.Point(13, 0x77));
     this.label5.set_Name("label5");
     this.label5.set_Size(new System.Drawing.Size(0x2e, 13));
     this.label5.set_TabIndex(0x1f);
     this.label5.set_Text("Льгота:");
     base.set_AutoScaleDimensions(new System.Drawing.SizeF(6f, 13f));
     base.set_AutoScaleMode(System.Windows.Forms.AutoScaleMode.Font);
     base.set_ClientSize(new System.Drawing.Size(0x205, 0xb1));
     base.Controls.Add(this.label5);
     base.Controls.Add(this.selectBenefit1);
     base.Controls.Add(this.label3);
     base.Controls.Add(this.label2);
     base.Controls.Add(this.cbSelectFasetExcept);
     base.Controls.Add(this.cbSelectFaset);
     base.Controls.Add(this.selectFasetDataExcept);
     base.Controls.Add(this.selectFasetData);
     base.Controls.Add(this.label4);
     base.Controls.Add(this.label1);
     base.Controls.Add(this.nudSumm);
     base.Controls.Add(this.dbFromDate);
     base.Controls.Add(this.btnCancel);
     base.Controls.Add(this.btnYes);
     base.set_FormBorderStyle(System.Windows.Forms.FormBorderStyle.FixedDialog);
     base.set_MaximizeBox(false);
     base.set_MinimizeBox(false);
     base.set_Name("BenefitNormsForGasAddChangeForm");
     base.set_StartPosition(System.Windows.Forms.FormStartPosition.CenterParent);
     this.set_Text("BenefitNormsForGazAddChangeForm");
     base.add_FormClosing(new System.Windows.Forms.FormClosingEventHandler(this.BenefitNormsForGazAddChangeForm_FormClosing));
     base.add_Load(new System.EventHandler(this.BenefitNormsForGazAddChangeForm_Load));
     this.bsBenefitNormsForGaz.EndInit();
     this.nudSumm.EndInit();
     this.bsFasets.EndInit();
     this.bsFasetsExcept.EndInit();
     base.ResumeLayout(false);
     base.PerformLayout();
 }
 private void tscbBenefit_TextChanged(object sender, System.EventArgs e)
 {
     this.m_Benefits = (Benefit) this.tscbBenefit.ComboBox.get_SelectedItem();
 }
Esempio n. 7
0
 private void bOk_Click(object sender, System.EventArgs e)
 {
     this.rate = this.numNorm.Value;
     this.fromDate = this.mtbFromDate.get_MaskFull() ? System.Convert.ToDateTime(this.mtbFromDate.get_Text()) : System.DateTime.Now;
     Benefit benefit = new Benefit();
     foreach (System.Windows.Forms.DataGridViewRow row in (System.Collections.IEnumerable) this.dgvServiceNormBenefits.Rows)
     {
         if (System.Convert.ToBoolean(row.Cells.get_Item("Selected").get_Value()))
         {
             benefit = Benefit.FindById(System.Convert.ToInt64(row.Cells.get_Item("Id").get_Value()));
             this.listBenefit.Add(benefit);
         }
     }
 }
Esempio n. 8
0
 public OrgBenefitForm(Benefit benefit, BenefitHandler benefitHandler)
     : this()
 {
     this.m_Benefit = benefit;
     this.benHandler = benefitHandler;
 }
Esempio n. 9
0
 private void SelectBenefit()
 {
     Benefit benefit = this.bsBenefits.get_Current() as Benefit;
     if (benefit != null)
     {
         this.m_Benefit = benefit;
         if (this.benHandler != null)
         {
             this.benHandler((Benefit) this.bsBenefits.get_Current());
         }
         base.set_DialogResult(System.Windows.Forms.DialogResult.OK);
         base.Close();
     }
 }
Esempio n. 10
0
 private void dgvBenefits_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (this.m_IsChild)
     {
         this.m_Benefit = (this.bsBenefits.get_Current() == null) ? Benefit.Null : (this.bsBenefits.get_Current() as Benefit);
         if (this.benHandler != null)
         {
             this.benHandler(this.m_Benefit);
         }
         base.Close();
     }
 }
Esempio n. 11
0
 private void btnSave_Click(object sender, System.EventArgs e)
 {
     Law law;
     if ((this.bsLaw.get_Current() != null) && (this.bsLaw.get_Current().ToString() != "<не выбрано>"))
     {
         law = this.bsLaw.get_Current() as Law;
     }
     else
     {
         law = null;
     }
     if (((law == null) || (this.tbxShortName.get_Text() == "")) || ((this.tbxLongName.get_Text() == "") || (this.selectCalcFeature.SelectedFasetItem == FasetItem.Null)))
     {
         new BalloonWindow("Не все поля заполнены").Show(this.btnSave);
         return;
     }
     if ((this.benefit == null) || (this.benefit == Benefit.Null))
     {
         this.benefit = new Benefit();
     }
     this.benefit.ShortName = this.tbxShortName.get_Text();
     this.benefit.LongName = this.tbxLongName.get_Text();
     this.benefit.CalcFeature = this.selectCalcFeature.SelectedFasetItem.Id;
     this.benefit.Code = this.tbxCode.get_Text();
     if (this.tbxExternalCode.get_Text().Trim() != string.Empty)
     {
         try
         {
             this.benefit.ExternalCode = int.Parse(this.tbxExternalCode.get_Text());
             goto Label_0175;
         }
         catch
         {
             new BalloonWindow("Код КСЗН должен быть числом").Show(this.tbxExternalCode);
             return;
         }
     }
     this.benefit.ExternalCode = 0;
     Label_0175:
     System.DateTime time1 = this.dateBoxMonetization.Value;
     if (!(this.dateBoxMonetization.Value == System.DateTime.MinValue))
     {
         this.benefit.MonetizationDate = this.dateBoxMonetization.Value;
     }
     else if (Messages.QuestionYesNo(this, "Не введена дата монетизации льготы.\nВы уверены, что хотите продолжить?") == System.Windows.Forms.DialogResult.Yes)
     {
         this.benefit.MonetizationDate = Constants.NullDate;
     }
     else
     {
         return;
     }
     this.benefit.SaveChanges();
     BenefitLaw law2 = BenefitLaw.FindByBenefit(this.benefit) ?? new BenefitLaw();
     law2.BenefitId = this.benefit.Id;
     law2.LawId = law.Id;
     law2.SaveChanges();
     Messages.ShowMessage("Льгота сохранена!");
     base.set_DialogResult(System.Windows.Forms.DialogResult.OK);
     base.Close();
 }