本文整理汇总了C#中Entities.List.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# List.ToArray方法的具体用法?C# List.ToArray怎么用?C# List.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities.List
的用法示例。
在下文中一共展示了List.ToArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllWorlds
public WorldInfo[] GetAllWorlds()
{
_db.Open();
List<WorldInfo> worlds = new List<WorldInfo>();
DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLWORLDS_STOREDPROC, System.Data.CommandType.StoredProcedure, null);
int ordinalId = reader.GetOrdinal(DbNames.WORLDINFO_ID);
int ordinalName = reader.GetOrdinal(DbNames.WORLDINFO_NAME);
int ordinalDesc = reader.GetOrdinal(DbNames.WORLDINFO_DESC);
int ordinalIP = reader.GetOrdinal(DbNames.WORLDINFO_IP);
int ordinalPort = reader.GetOrdinal(DbNames.WORLDINFO_PORT);
while (reader.Read())
{
WorldInfo world = new WorldInfo
{
WorldId = reader.GetInt32(ordinalId),
WorldName = reader.GetString(ordinalName),
WorldDesc = reader.GetString(ordinalDesc),
IPAddress = reader.GetString(ordinalIP),
Port = reader.GetInt32(ordinalPort)
};
worlds.Add(world);
}
reader.Close();
_db.Close();
return worlds.ToArray();
}
示例2: GetAllChannels
public ChannelInfo[] GetAllChannels()
{
_db.Open();
List<ChannelInfo> channels = new List<ChannelInfo>();
DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLCHANNELS_STOREDPROC, System.Data.CommandType.StoredProcedure, null);
int ordinalId = reader.GetOrdinal(DbNames.CHANNELINFO_ID);
int ordinalName = reader.GetOrdinal(DbNames.CHANNELINFO_NAME);
int ordinalDesc = reader.GetOrdinal(DbNames.CHANNELINFO_DESC);
int ordinalIP = reader.GetOrdinal(DbNames.CHANNELINFO_IP);
int ordinalPort = reader.GetOrdinal(DbNames.CHANNELINFO_PORT);
int ordinalPK = reader.GetOrdinal(DbNames.CHANNELINFO_PK);
while (reader.Read())
{
ChannelInfo channel = new ChannelInfo
{
ChannelId = reader.GetInt32(ordinalId),
ChannelName = reader.GetString(ordinalName),
ChannelDesc = reader.GetString(ordinalDesc),
IPAddress = reader.GetString(ordinalIP),
Port = reader.GetInt32(ordinalPort),
PK = reader.GetBoolean(ordinalPK)
};
channels.Add(channel);
}
reader.Close();
_db.Close();
return channels.ToArray();
}
示例3: frmQuanLyMaVach
public frmQuanLyMaVach(List<ThongTinMaVach> dsThongTinMaVach)
{
InitializeComponent();
IniForm();
//Gán dữ liệu
dgvHangHoa.DataSource = dsThongTinMaVach.ToArray();
FixDatagridview();
}
示例4: CheckDataGridCongSL
public void CheckDataGridCongSL(DataGridView dgv, string maKho)
{
if (dgv.RowCount != 0)
{
try
{
Server_Client.Client cl = new Server_Client.Client();
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
Entities.ChiTietKhoHangTheoHoaHonNhap nv = new Entities.ChiTietKhoHangTheoHoaHonNhap("Select");
clientstrem = cl.SerializeObj(this.client1, "ChiTietKho", nv);
Entities.ChiTietKhoHangTheoHoaHonNhap[] kh1 = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
kh1 = (Entities.ChiTietKhoHangTheoHoaHonNhap[])cl.DeserializeHepper1(clientstrem, kh1);
List<Entities.ChiTietKhoHangTheoHoaHonNhap> ctList = new List<Entities.ChiTietKhoHangTheoHoaHonNhap>();
for (int i = 0; i < dgv.RowCount; i++)
{
bool retVal = false;
foreach (Entities.ChiTietKhoHangTheoHoaHonNhap item in kh1)
{
if (dgv["MaHangHoa", i].Value.ToString().ToUpper().Equals(item.Mahanghoa.ToUpper()) && maKho.Equals(item.Makho))
{
retVal = true;
break;
}
}
if (!retVal)
{
Entities.ChiTietKhoHangTheoHoaHonNhap ct = new Entities.ChiTietKhoHangTheoHoaHonNhap();
ct.Hanhdong = "Insert";
ct.Mahanghoa = dgv["MaHangHoa", i].Value.ToString();
ct.Makho = maKho;
ct.Ngaynhap = DateServer.Date();
DateTime ngayHetHan = DateTime.Now;
if (dgv["NgayHetHan", i] != null)
ngayHetHan = (DateTime)dgv["NgayHetHan", i].Value;
ct.Ngayhethan = ngayHetHan;
ct.Soluong = int.Parse(dgv["SoLuong", i].Value.ToString());
ct.Ghichu = "";
ctList.Add(ct);
}
}
Server_Client.Client cl1 = new Server_Client.Client();
this.client1 = cl1.Connect(Luu.IP, Luu.Ports);
clientstrem = cl1.SerializeObj(this.client1, "ThemChiTietKhoHang", ctList.ToArray());
}
catch (Exception)
{
}
}
}
示例5: Main
private static void Main()
{
var startTime = DateTime.Now;
var settings = new Settings();
var helper = new Helper(settings);
var tasks = new List<Task<ImageDetails>>();
// Get the ID's
var imageIds = GetImageIds();
// Create the Tasks
foreach (var imageId in imageIds)
{
var task = new Task<ImageDetails>(() => AcquireImage(new ImageServiceClient(), imageId).Result);
task.Start();
tasks.Add(task);
}
// wait for the tasks
Task.WaitAll(tasks.ToArray());
// write out the files
using (var writer = helper.GetOutputWriter())
{
writer.WriteLine(Image.GetHeaderString());
foreach (var task in tasks)
{
helper.WriteImageFile(task.Result.ImageBytes, task.Result.Metadata.FileName);
writer.WriteLine(task.Result.Metadata);
}
}
Console.WriteLine("{0} images processed.", tasks.Count);
Console.WriteLine("Creating zip file.");
helper.WriteZipFile();
helper.Cleanup();
Console.WriteLine("Done.");
var elapsed = DateTime.Now - startTime;
Console.WriteLine("Elapsed time: {0}", elapsed);
#if DEBUG
Console.Write("<Enter> to quit.");
Console.ReadLine();
#endif
}
示例6: GetAmandamentTemplates
public CascadingDropDownNameValue[] GetAmandamentTemplates(string knownCategoryValues, string category, string contextKey)
{
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
List<AmandamentTemplateEntity> list = new AmandamentTemplateMapper().ListWithAdvancedFilter("", StatusEnum.Active);
foreach (AmandamentTemplateEntity entity in list)
{
CascadingDropDownNameValue cdnv;
cdnv = new CascadingDropDownNameValue(entity.Title, entity.AmandamentTemplateId.ToString());
values.Add(cdnv);
}
return values.ToArray();
}
示例7: GetBanks
public CascadingDropDownNameValue[] GetBanks(string knownCategoryValues, string category, string contextKey)
{
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
List<BankEntity> list = new BankMapper().ListWithAdvancedFilter("", StatusEnum.Active);
foreach (BankEntity ent in list)
{
CascadingDropDownNameValue cdnv;
if (ent.Title == contextKey)
{
cdnv = new CascadingDropDownNameValue(ent.Title, ent.Id.ToString(), true);
}
else
{
cdnv = new CascadingDropDownNameValue(ent.Title, ent.Id.ToString());
}
values.Add(cdnv);
}
return values.ToArray();
}
示例8: txtTimKiem_TextChanged
private void txtTimKiem_TextChanged(object sender, EventArgs e)
{
if (rdbTen.Checked == true)
{
if (ctBCXH_Search == null)
{
BCXuatHangTheoNhomHang[] tkkt = new BCXuatHangTheoNhomHang[0];
dtgvhienthi.DataSource = tkkt;
FixDatagridview();
tsslchitiet.Enabled = false;
tsslExcel.Enabled = false;
tsslPdf.Enabled = false;
tsslWord.Enabled = false;
}
else
if (ctBCXH_Search != null)
{
if (txtTimKiem.Text.Length == 0)
{
BCXuatHangTheoNhomHang[] tkkt = new BCXuatHangTheoNhomHang[0];
dtgvhienthi.DataSource = tkkt;
FixDatagridview();
tsslchitiet.Enabled = false;
tsslExcel.Enabled = false;
tsslPdf.Enabled = false;
tsslWord.Enabled = false;
}
else
{
int ctBCXH_Search_count = 0;
for (int i = 0; i < ctBCXH_Search.Length; i++)
{
int index = -1;
index = ctBCXH_Search[i].TenNhomHang.ToLower().IndexOf(txtTimKiem.Text.Trim().ToLower());
if (index >= 0)
{
ctBCXH_Search_count++;
}
}
BCXuatHangTheoNhomHang[] ctBCXH_Search1 = new BCXuatHangTheoNhomHang[ctBCXH_Search_count];
ctBCXH_Search_count = 0;
for (int i = 0; i < ctBCXH_Search.Length; i++)
{
int index = -1;
index = ctBCXH_Search[i].TenNhomHang.ToLower().IndexOf(txtTimKiem.Text.Trim().ToLower());
if (index >= 0)
{
ctBCXH_Search1[ctBCXH_Search_count] = ctBCXH_Search[i];
ctBCXH_Search_count++;
}
}
if (ctBCXH_Search_count == 0)
{
tsslchitiet.Enabled = false;
tsslExcel.Enabled = false;
tsslPdf.Enabled = false;
tsslWord.Enabled = false;
}
else
{
tsslchitiet.Enabled = true;
tsslExcel.Enabled = true;
tsslPdf.Enabled = true;
tsslWord.Enabled = true;
}
///////////////////////////////MRK FIX
List<Entities.BCXuatHangTheoNhomHang> tem0 = new List<BCXuatHangTheoNhomHang>();
double tong0 = 0;
foreach (Entities.BCXuatHangTheoNhomHang item in ctBCXH_Search1)
{
tong0 += item.TongSoLuongXuat;
tem0.Add(item);
}
Entities.BCXuatHangTheoNhomHang tem1 = new BCXuatHangTheoNhomHang();
tem1.TenNhomHang = "Tổng: ";
tem1.TongSoLuongXuat = (int)tong0;
tem0.Add(tem1);
//////////////////////////////////////
dtgvhienthi.DataSource = tem0.ToArray();
//dtgvhienthi.DataSource = ctBCXH_Search1;
FixDatagridview();
}
}
}
else
if (rdbMa.Checked == true)
{
if (ctBCXH_Search == null)
{
BCXuatHangTheoNhomHang[] tkkt = new BCXuatHangTheoNhomHang[0];
dtgvhienthi.DataSource = tkkt;
FixDatagridview();
tsslchitiet.Enabled = false;
tsslExcel.Enabled = false;
//.........这里部分代码省略.........
示例9: btnhienthi_Click
private void btnhienthi_Click(object sender, EventArgs e)
{
if (KiemTra())
{
LayNhomHang();
LayNgay();
LayHangHoa();
GoiHang();
ChiTietGoiHang();
LayHDBanHang();
LayChiTiet_HDBanHang();
LayPhieuDieuChuyenKhoNoiBo();
LayChiTiet_PhieuDieuChuyenKho();
LayPhieuXuatHuy();
LayChiTiet_XuatHuy();
LayTraLaiNCC();
LayChiTiet_TraLaiNCC();
LayChiTiet_HangHoaXuat();
ArrTongHangXuat();
///////////////////////////////MRK FIX
List<Entities.BCXuatHangTheoNhomHang> tem0 = new List<BCXuatHangTheoNhomHang>();
double tong0 = 0;
foreach (Entities.BCXuatHangTheoNhomHang item in ArrBCXH)
{
if (item == null)
{
continue;
}
tong0 += item.TongSoLuongXuat;
tem0.Add(item);
}
Entities.BCXuatHangTheoNhomHang tem1 = new BCXuatHangTheoNhomHang();
tem1.TenNhomHang = "Tổng: ";
tem1.TongSoLuongXuat = (int)tong0;
tem0.Add(tem1);
//////////////////////////////////////
//dtgvhienthi.DataSource = ArrBCXH;
dtgvhienthi.DataSource = tem0.ToArray();
FixDatagridview();
ctBCXH_Search = ArrBCXH;
if (ArrBCXH.Length > 0)
{
tsslchitiet.Enabled = true;
tsslPdf.Enabled = true;
tsslExcel.Enabled = true;
tsslWord.Enabled = true;
}
else
{
tsslchitiet.Enabled = false;
tsslPdf.Enabled = false;
tsslExcel.Enabled = false;
tsslWord.Enabled = false;
}
}
}
示例10: MonsterManager
monsterManager = new MonsterManager(conString, providerName);
}
public Map[] GetAllMaps()
{
_db.Open();
DbDataReader reader = _db.ExcecuteReader(DbNames.GETALLMAPS_STOREDPROC, System.Data.CommandType.StoredProcedure, null);
int ordinalId = reader.GetOrdinal(DbNames.MAP_ID);
int ordinalName = reader.GetOrdinal(DbNames.MAP_NAME);
int ordinalMultiplyValue = reader.GetOrdinal(DbNames.MAP_MULTIPLYVALUE);
int ordinalSpawnX = reader.GetOrdinal(DbNames.MAP_SPAWNX);
int ordinalSpawnY = reader.GetOrdinal(DbNames.MAP_SPAWNY);
List<Map> maps = new List<Map>();
while (reader.Read())
{
Map m = new Map()
{
MapID = reader.GetInt32(ordinalId),
Name = reader.GetString(ordinalName),
MultiplyValue = reader.GetInt32(ordinalMultiplyValue),
SpawnX = reader.GetInt32(ordinalSpawnX),
SpawnY = reader.GetInt32(ordinalSpawnY)
};
maps.Add(m);
}
reader.Close();
_db.Close();
foreach (Map map in maps)
{
map.Portals = portalManager.GetPortalsByMapId(map.MapID);
map.Npcs = npcManager.GetNpcsByMapId(map.MapID);
map.Monsters = monsterManager.GetMonstersByMapId(map.MapID);
if (map.MapID != 9 && map.MapID != 10 && map.MapID != 13 && map.MapID != 14) // maps we dont have maskes for yet..
map.WalkableTiles = GetWalkableTiles(map.Name);
}
return maps.ToArray();
}
public Map GetMapById(int mapId)
{
DbParameter mapIdParameter = _db.CreateParameter(DbNames.GETMAPBYID_ID_PARAMETER, mapId);
mapIdParameter.DbType = System.Data.DbType.Int32;
_db.Open();
DbDataReader reader = _db.ExcecuteReader(DbNames.GETMAPBYID_STOREDPROC, System.Data.CommandType.StoredProcedure, mapIdParameter);
int ordinalId = reader.GetOrdinal(DbNames.MAP_ID);
int ordinalName = reader.GetOrdinal(DbNames.MAP_NAME);
int ordinalMultiplyValue = reader.GetOrdinal(DbNames.MAP_MULTIPLYVALUE);
int ordinalSpawnX = reader.GetOrdinal(DbNames.MAP_SPAWNX);
int ordinalSpawnY = reader.GetOrdinal(DbNames.MAP_SPAWNY);
Map m = null;
while (reader.Read())
{
m = new Map
{
MapID = reader.GetInt32(ordinalId),
Name = reader.GetString(ordinalName),
MultiplyValue = reader.GetInt32(ordinalMultiplyValue),
SpawnX = reader.GetInt32(ordinalSpawnX),
SpawnY = reader.GetInt32(ordinalSpawnY)
};
}
reader.Close();
_db.Close();
m.Portals = portalManager.GetPortalsByMapId(mapId);
m.Npcs = npcManager.GetNpcsByMapId(mapId);
return m;
}
示例11: rdbTatCa_CheckedChanged
private void rdbTatCa_CheckedChanged(object sender, EventArgs e)
{
if (rdbTatCa.Checked == true)
{
txtTimKiem.Text = "";
if (ctBCXH_Search.Length > 0)
{
tsslchitiet.Enabled = true;
tsslPdf.Enabled = true;
tsslExcel.Enabled = true;
tsslWord.Enabled = true;
}
else
{
tsslchitiet.Enabled = false;
tsslPdf.Enabled = false;
tsslExcel.Enabled = false;
tsslWord.Enabled = false;
}
///////////////////////////////MRK FIX
List<Entities.BCXuatHangTheoNhomHang> tem0 = new List<BCXuatHangTheoNhomHang>();
double tong0 = 0;
foreach (Entities.BCXuatHangTheoNhomHang item in ctBCXH_Search)
{
tong0 += item.TongSoLuongXuat;
tem0.Add(item);
}
Entities.BCXuatHangTheoNhomHang tem1 = new BCXuatHangTheoNhomHang();
tem1.TenNhomHang = "Tổng: ";
tem1.TongSoLuongXuat = (int)tong0;
tem0.Add(tem1);
//////////////////////////////////////
dtgvhienthi.DataSource = tem0.ToArray();
//dtgvhienthi.DataSource = ctBCXH_Search;
FixDatagridview();
}
}
示例12: GetOrganizationalUnits
public CascadingDropDownNameValue[] GetOrganizationalUnits(string knownCategoryValues, string category, string contextKey)
{
List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
List<OrganizationalUnitView> list = new OrganizationalUnitMapper().List("");
foreach (OrganizationalUnitView ent in list)
{
CascadingDropDownNameValue cdnv;
if (ent.TitleAndOrganizationaUnitGroup == contextKey)
{
cdnv = new CascadingDropDownNameValue(ent.TitleAndOrganizationaUnitGroup, ent.Id.ToString(), true);
}
else
{
cdnv = new CascadingDropDownNameValue(ent.TitleAndOrganizationaUnitGroup, ent.Id.ToString());
}
values.Add(cdnv);
}
return values.ToArray();
}
示例13: frmBaoCaorpt
//true:SoQuy False: CTSoQuy
public frmBaoCaorpt(string LuaChon, Entities.SoQuy[] dulieu, string path, bool select)
{
try
{
InitializeComponent();
CongTy();
foreach (Entities.SoQuy item in dulieu)
{
item.DuDauKy = item.DuDauKy.Replace(",", "");
item.PhatSinhNo = item.PhatSinhNo.Replace(",", "");
item.PhatSinhCo = item.PhatSinhCo.Replace(",", "");
item.DuCuoiKy = item.DuCuoiKy.Replace(",", "");
}
if (select)
{
GUI.Report.rptBCSoQuy report = new GUI.Report.rptBCSoQuy();
List<Entities.BCSoQuy> dulieu1 = new List<Entities.BCSoQuy>();
foreach (Entities.SoQuy item in dulieu)
{
Entities.BCSoQuy tem = new Entities.BCSoQuy();
tem.MaTK = item.MaTK;
tem.TenTK = item.TenTK;
tem.DuDauKy = double.Parse(item.DuDauKy);
tem.PhatSinhNo = double.Parse(item.PhatSinhNo);
tem.PhatSinhCo = double.Parse(item.PhatSinhCo);
tem.DuCuoiKy = double.Parse(item.DuCuoiKy);
//tem.NgayLap = item.NgayLap;
//tem.MaPhieu = item.MaPhieu;
//tem.Ton = double.Parse(item.Ton);
dulieu1.Add(tem);
}
Entities.BCSoQuy[] view = dulieu1.ToArray();
report.SetDataSource(view);
crvReport.ReportSource = report;
report.SetParameterValue("TenCongTy", CT.TenCongTy);
report.SetParameterValue("DiaChiCongTy", CT.DiaChi);
report.SetParameterValue("DienThoai", CT.SoDienThoai);
report.SetParameterValue("Web", CT.Website);
report.SetParameterValue("Email", CT.Email);
report.SetParameterValue("FaxCongTy", CT.Fax);
report.SetParameterValue("TenBaoCao", "SỔ QUỸ");
report.SetParameterValue("NgayIn", DateServer.Date().ToString("dd/MM/yyyy"));
if (LuaChon.Equals("SoQuy_In"))
{
crvReport.Show();
}
else if (LuaChon.Equals("SoQuy_XLS"))
{
new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.Excel);
}
else if (LuaChon.Equals("SoQuy_DOC"))
{
new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.WordForWindows);
}
else if (LuaChon.Equals("SoQuy_PDF"))
{
new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.PortableDocFormat);
}
}
else
{
GUI.Report.rptBCChiTietSoQuy report = new GUI.Report.rptBCChiTietSoQuy();
List<Entities.BCSoQuy> dulieu1 = new List<Entities.BCSoQuy>();
foreach (Entities.SoQuy item in dulieu)
{
Entities.BCSoQuy tem = new Entities.BCSoQuy();
tem.MaTK = item.MaTK;
tem.TenTK = item.TenTK;
tem.DuDauKy = double.Parse(item.DuDauKy);
tem.PhatSinhNo = double.Parse(item.PhatSinhNo);
tem.PhatSinhCo = double.Parse(item.PhatSinhCo);
tem.DuCuoiKy = double.Parse(item.DuCuoiKy);
tem.NgayLap = item.NgayLap;
tem.MaPhieu = item.MaPhieu;
tem.Ton = double.Parse(item.Ton);
dulieu1.Add(tem);
}
Entities.BCSoQuy[] view = dulieu1.ToArray();
report.SetDataSource(view);
crvReport.ReportSource = report;
report.SetParameterValue("TenCongTy", CT.TenCongTy);
report.SetParameterValue("DiaChiCongTy", CT.DiaChi);
report.SetParameterValue("DienThoai", CT.SoDienThoai);
report.SetParameterValue("Web", CT.Website);
report.SetParameterValue("Email", CT.Email);
report.SetParameterValue("FaxCongTy", CT.Fax);
report.SetParameterValue("TenBaoCao", "CHI TIẾT SỔ QUỸ");
report.SetParameterValue("NgayIn", DateServer.Date().ToString("dd/MM/yyyy"));
if (LuaChon.Equals("SoQuy_In"))
{
crvReport.Show();
}
else if (LuaChon.Equals("SoQuy_XLS"))
{
new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.Excel);
}
else if (LuaChon.Equals("SoQuy_DOC"))
{
new GUI.Report.ExportCrystalReport().Export(report, path, Report.ExportCrystalReport.TypeBC.WordForWindows);
//.........这里部分代码省略.........
示例14: txtTimKiem_TextChanged
private void txtTimKiem_TextChanged(object sender, EventArgs e)
{
try
{
string Search = txtTimKiem.Text;
List<Entities.HangHoa> ketqua = new List<Entities.HangHoa>();
foreach (Entities.HangHoa item in MANG)
{
int test = -1;
if (rdbMa.Checked) //Tìm Kiếm Theo Mã
{
test = item.MaHangHoa.ToLower().IndexOf(Search.ToLower());
}
else if (rdbTen.Checked) //Tìm Kiếm Theo Tên
{
test = item.TenHangHoa.ToLower().IndexOf(Search.ToLower());
}
if (test >= 0)
{
ketqua.Add(item);
}
}
dgvQuanLyHangHoa.DataSource = ketqua.ToArray();
}
catch { }
}
示例15: CheckDataGridCongSL1
public void CheckDataGridCongSL1(DataGridView dgv, string maKho)
{
Server_Client.Client cl = new Server_Client.Client();
this.client1 = cl.Connect(Luu.IP, Luu.Ports);
Entities.ChiTietKhoHangTheoHoaHonNhap nv = new Entities.ChiTietKhoHangTheoHoaHonNhap("Select");
clientstrem = cl.SerializeObj(this.client1, "ChiTietKho", nv);
Entities.ChiTietKhoHangTheoHoaHonNhap[] kh1 = new Entities.ChiTietKhoHangTheoHoaHonNhap[1];
kh1 = (Entities.ChiTietKhoHangTheoHoaHonNhap[])cl.DeserializeHepper1(clientstrem, kh1);
List<Entities.ChiTietKhoHangTheoHoaHonNhap> ctKhoList = new List<Entities.ChiTietKhoHangTheoHoaHonNhap>();
try
{
if (dgv.RowCount != 0)
{
for (int i = 0; i < dgv.RowCount; i++)
{
foreach (Entities.ChiTietKhoHangTheoHoaHonNhap item in kh1)
{
// lay cac hang hoa da ton tai
if (dgv["MaHangHoa", i].Value.ToString().ToUpper().Equals(item.Mahanghoa.ToUpper()))
{
Entities.ChiTietKhoHangTheoHoaHonNhap ct;
ct = new Entities.ChiTietKhoHangTheoHoaHonNhap("UpdateCong", maKho, dgv["MaHangHoa", i].Value.ToString(), int.Parse(dgv["SoLuong", i].Value.ToString()));
ctKhoList.Add(ct);
break;
}
}
}
TruSLMang(ctKhoList.ToArray());
}
}
catch (Exception)
{
}
}