old_flsystem/FLSystem/Forms/RatioCustomGroupForm.cs

73 lines
2.0 KiB
C#
Raw Normal View History

2022-09-20 03:10:29 +00:00
using Api.Framework.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using UI.Framework.Forms;
namespace FLSystem.Forms
{
public partial class RatioCustomGroupForm : BaseForm
{
public fl_ratio_info_custom_group group = null;
private List<fl_ratio_info_custom_group> groups = null;
public RatioCustomGroupForm(List<fl_ratio_info_custom_group> groups)
{
InitializeComponent();
this.groups = groups;
}
private void RatioCustomGroupForm_Load(object sender, EventArgs e)
{
try
{
if (groups != null && groups.Count != null)
{
label6.Visible = false;
gridControl2.DataSource = groups;
}
else
{
this.label6.Visible = true;
this.label6.Text = "当前没有分组,请先设置独立分出比例";
}
}
catch (Exception ex)
{
this.label6.Visible = true;
this.label6.Text = ex.Message;
}
}
private void simpleButton2_Click(object sender, EventArgs e)
{
try
{
var select = this.gridView2.GetSelectedRows();
if (select.Length == 0) ShowError("您当前没有选中任何一行!");
else
{
group = this.gridView2.GetRow(select[0]) as fl_ratio_info_custom_group;
this.Close();
}
}
catch (Exception ex)
{
ShowError(ex);
}
}
private void simpleButton3_Click(object sender, EventArgs e)
{
groups = null;
this.Close();
}
}
}