请教诸位个关于大量变量的写法.

seamanpc seamanpc 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
情况是这样的

namespace PosClient
{
class Store
{
public DateTime update;
public string storeid;
public string storename;
public int number;
public double unitprice;
public double totalprice;
public double income;
public string editer;
public string voucher;
public string remark;
public string vipid;
public bool apart;
public string listid;

public Store(DateTime x1,string x2,string x3,int x4,double x5,double x6,double x7,string x8,string x9,string x10,string x11,bool x12,string x13)
{
update = x1;
storeid = x2;
storename = x3;
number = x4;
unitprice = x5;
totalprice = x6;
income = x7;
editer = x8;
voucher = x9;
remark = x10;
vipid = x11;
apart = x12;
listid = x13;
if (!DataProof()) { MakeThorw(); }
}


这样关于类的声明在构造函数里赋值觉得有些乱有没更好的写法.

一个Store对应dataGridView1里的一行 dataGridView里发生了修改 就联动修改Store里的值


private void dataGridView1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
{

if (e.ColumnIndex == 1)
{
Store.storeid = "????"
}

if (e.ColumnIndex == 2)
{
Store.x= "????"
}

if (e.ColumnIndex == 3)
{
Store.x= "????"
}

}


这写法觉得有点不对吧,亲手求教希望不吝赐教.该用什么方法能更好的处理这类操作.
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
seamanpc
C# 111,130 成员 642,539 内容