private void setData(int row, int col) { if (!string.IsNullOrEmpty(dataGridViewX1.Rows[row].Cells["sum"].Value.ToString())) { int s = 1; int.TryParse(dataGridViewX1.Rows[row].Cells["sum"].Value.ToString(), out s); if (s == 0) { MessageBox.Show("数量不能是零!"); return; } } Maptool.soso.Link_Mid m = new soso.Link_Mid(); m.id = (int)dataGridViewX1.Rows[row].Cells["linkid"].Value; m.iden = Convert.ToInt32(iden_lab.Text); m.Sum = string.IsNullOrEmpty(dataGridViewX1.Rows[row].Cells["sum"].Value.ToString()) ? 1 : (int)dataGridViewX1.Rows[row].Cells["sum"].Value; m.StockType = GetUnitNo(dataGridViewX1.Rows[row].Cells["stocktypes"].Value.ToString()); m.PriceType = GetUnitNo(dataGridViewX1.Rows[row].Cells["pricetypes"].Value.ToString()); m.Updated = DateTime.Now; if (m.StockType != 1 && string.IsNullOrEmpty(dataGridViewX1.Rows[row].Cells["sum"].Value.ToString())) { MessageBox.Show("数量不能空!"); } else { if (m.Sum == 0) { m.Sum = 1; } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bll.SetData(m, col, Login.authKey); } }
private void dataGridViewX1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { //修改的是加点 if (e.ColumnIndex == dataGridViewX1.Columns["Price_Plus"].Index) { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); string ID = dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(); string CateGory = dataGridViewX1.Rows[e.RowIndex].Cells["CateGory"].Value.ToString(); Decimal Price_Plus = dataGridViewX1.Rows[e.RowIndex].Cells["Price_Plus"].Value == null ? 0 : Convert.ToDecimal(dataGridViewX1.Rows[e.RowIndex].Cells["Price_Plus"].Value); bll.SetPricePlus(ID, Price_Plus, CateGory); } //修改的是售价 if (e.ColumnIndex == dataGridViewX1.Columns["Price_Sale"].Index) { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); string ID = dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(); string CateGory = dataGridViewX1.Rows[e.RowIndex].Cells["CateGory"].Value.ToString(); Decimal Price = dataGridViewX1.Rows[e.RowIndex].Cells["Price"].Value == null ? 0 : Convert.ToDecimal(dataGridViewX1.Rows[e.RowIndex].Cells["Price"].Value); Decimal Price_Sale = dataGridViewX1.Rows[e.RowIndex].Cells["Price_Sale"].Value == null ? 0 : Convert.ToDecimal(dataGridViewX1.Rows[e.RowIndex].Cells["Price_Sale"].Value); decimal Price_Plus = Price_Sale / Price; bll.SetPricePlus(ID, Price_Plus, CateGory); } //重新绑定数据 Bind(); }
//Yj2015.0226 Add 双击通用名显示图片 --- void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridViewX1.Columns["Column1"].Index) { int goodsPackageId = 0; int goodsId = 0; if (int.TryParse(dataGridViewX1.Rows[e.RowIndex].Cells["Product_ID"].Value.ToString(), out goodsPackageId) && int.TryParse(dataGridViewX1.Rows[e.RowIndex].Cells["Goods_Id"].Value.ToString(), out goodsId)) { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); string imgUrl = bll.GetImageUrl(goodsId, goodsPackageId); string frmCaption = dataGridViewX1.Rows[e.RowIndex].Cells["Column1"].Value.ToString() + "—" + dataGridViewX1.Rows[e.RowIndex].Cells["Column2"].Value.ToString() + "—" + dataGridViewX1.Rows[e.RowIndex].Cells["Column4"].Value.ToString(); frmShowGoodsImage frmTmp = new frmShowGoodsImage(imgUrl); frmTmp.Text = frmCaption; frmTmp.Show(this); } else { MessageBox.Show("无有效的物品编号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
public void Bind() { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetConfigList(); if (li != null) { int i = 0; foreach (var item in li) { dataGridViewX1.Rows.Add(); dataGridViewX1.Rows[i].Cells["id"].Value = item.id; dataGridViewX1.Rows[i].Cells["id"].ValueType = typeof(int); dataGridViewX1.Rows[i].Cells["incName"].Value = item.incName; dataGridViewX1.Rows[i].Cells["discountRate"].Value = Math.Round(item.discountRate, 2); dataGridViewX1.Rows[i].Cells["discountRate"].ValueType = typeof(decimal); dataGridViewX1.Rows[i].Cells["cgy"].Value = item.cgy; i++; } recordCount = li.Count(); pageCount = 1; } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void buttonX1_Click(object sender, EventArgs e) { if (DialogResult.OK == MessageBox.Show("您是否确认修改?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { if (Library.Lang.DataValidator.isNULL(dataGridViewX1.Rows[0].Cells["Price_01Plus"].Value)) { dataGridViewX1.Rows[0].Cells["Price_01Plus"].ErrorText = "必填"; } if (Library.Lang.DataValidator.isNULL(dataGridViewX1.Rows[0].Cells["Price_01Plus"].Value, dataGridViewX1.Rows[0].Cells["Price_01Plus"].Value)) { return; } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); Maptool.soso.Link model = new soso.Link(); model.created = DateTime.Now; model.updated = model.created; model.id = int.Parse(dataGridViewX1.Rows[0].Cells["Product_ID"].Value.ToString()); model.iden = this.iden; model.spid = dataGridViewX1.Rows[0].Cells["Product_ID"].ToolTipText; model.t_id = this.knid; if (bll.AddLink(model, Login.authKey)) { MessageBox.Show("操作成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information); from1.Bind(); this.Close(); } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
public void Bind() { string msg = Main.Menu.First(x => x.id == iden).name.Replace("数据映射", ""); switch (BinType) { case 0: groupBox1.Text = "价格管理(" + msg + ")"; break; default: groupBox1.Text = "价格管理(" + msg + ")"; break; } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetMaptoolList(PageSize, PageIndex, order, orderField, like, whereField, sqlext, BinType, Login.authKey, this.iden); if (li != null) { //#region 货源2.0新增内容(销售单位,用于控制商城前台销售商品的可售单位(最小单位、中包装、件装)) li.Tables[0].Columns.Add("st", typeof(string)); //#endregion var dt = li.Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { //动态添加价格类型 string ID = dt.Rows[i]["ID"].ToString(); DataTable PriceTable = bll.GetPriceByID(ID); if (PriceTable != null && PriceTable.Rows.Count > 0) { foreach (DataRow dr in PriceTable.Rows) { string tempcategory = dr["category"] == null ? string.Empty : dr["category"].ToString(); decimal tempprice = dr["price_n"] == null ? 0 : Convert.ToDecimal(dr["price_n"]); //添加新列 if (!dt.Columns.Contains(tempcategory)) { dt.Columns.Add(tempcategory, typeof(string)); if (!dataGridViewX1.Columns.Contains(tempcategory)) { dataGridViewX1.Columns.Insert(13, new DataGridViewTextBoxColumn() { HeaderText = tempcategory, DataPropertyName = tempcategory, Name = tempcategory }); } } dt.Rows[i][tempcategory] = tempprice; } } } dataGridViewX1.DataSource = dt; recordCount = int.Parse(li.Tables[1].Rows[0]["recordCount"].ToString()); pageCount = int.Parse(li.Tables[1].Rows[0]["pageCount"].ToString()); paginger(); labelX1.Text = string.Format("共{0}条记录", recordCount); } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void dataGridViewX1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridViewX1.Columns[0].Index) { if (DialogResult.OK == MessageBox.Show("您是否确认映射?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); Maptool.soso.Link model = new soso.Link(); model.created = DateTime.Now; model.updated = model.created; model.id = int.Parse(dataGridViewX1.Rows[e.RowIndex].Cells["Product_ID"].Value.ToString()); model.iden = this.iden; model.t_id = this.Erp_ID; if (bll.AddLink(model, Login.authKey)) { MessageBox.Show("操作成功!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information); from1.Bind(); this.Close(); } else { MessageBox.Show("您可能已经映射过此供应商的数据!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
void dataGridViewX1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (dataGridViewX1.Columns[e.ColumnIndex].Name.ToLower() == "remark") { var TempObj = dataGridViewX1.Rows[e.RowIndex].Cells["remark"].Value; string Remark = TempObj == null ? string.Empty : TempObj.ToString(); string ERP_ID = dataGridViewX1.Rows[e.RowIndex].Cells["ERP_Id"].Value.ToString(); soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bll.SetTag_2(ERP_ID, iden, Remark, Login.authKey); } }
private void dataGridViewX1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridViewX1.Columns["Column2"].Index) { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bll.SetTag(dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(), iden, dataGridViewX1.Rows[e.RowIndex].Cells["Column2"].Value.ToString(), Login.authKey); } if (e.ColumnIndex == dataGridViewX1.Columns["remark"].Index) { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bll.SetTag_2(dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(), iden, dataGridViewX1.Rows[e.RowIndex].Cells["remark"].Value.ToString(), Login.authKey); } }
public Config(string iden) { _iden = iden; InitializeComponent(); this.ShowInTaskbar = false; dataGridViewX1.AutoGenerateColumns = false; dataGridViewX1.RowHeadersVisible = false; dataGridViewX1.DataError += new DataGridViewDataErrorEventHandler(dataGridViewX1_DataError); var model = new soso.syntoolSoapClient().GetAllConfigPriceMe(Login.authKey); if (model != null) { dataGridViewX1.DataSource = model; } }
private void Bind() { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetShopList(20, 1, false, "product_id", false, string.Empty, sqlext, 2, Login.authKey, this.iden); if (li != null && li.Tables[0].Rows.Count > 0) { var tempDT = li.Tables[0]; dataGridViewX1.DataSource = tempDT; for (int i = 0; i < tempDT.Rows.Count; i++) { if (!string.IsNullOrEmpty(tempDT.Rows[i]["image"].ToString())) { dataGridViewX1.Rows[i].DefaultCellStyle.ForeColor = Color.Red; } } } }
private void Bind() { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetCheckDataInfo(this.iden, PageSize, PageIndex, order, orderField, like, whereField, sqlext, Login.authKey); if (li != null) { li.Tables[0].Columns.Remove("row"); dataGridViewX1.DataSource = li.Tables[0]; recordCount = int.Parse(li.Tables[1].Rows[0]["recordCount"].ToString()); pageCount = int.Parse(li.Tables[1].Rows[0]["pageCount"].ToString()); paginger(); labelX1.Text = string.Format("共{0}条记录", recordCount); } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void dataGridViewX1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == dataGridViewX1.Columns["Stock"].Index) { Clipboard.SetText(dataGridViewX1.Rows[e.RowIndex].Cells["Stock"].ToolTipText.ToString()); return; } if (e.ColumnIndex == dataGridViewX1.Columns["is_default"].Index) { if (dataGridViewX1.Rows[e.RowIndex].Cells[1].Value.ToString() == "未映射") { MessageBox.Show("未映射数据不能设置固定!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bll.SetDefaultShop(iden, dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(), (bool)dataGridViewX1.Rows[e.RowIndex].Cells["is_default"].EditedFormattedValue ? "1" : "0", Login.authKey); } if (e.ColumnIndex == dataGridViewX1.Columns[0].Index) { if (dataGridViewX1.Rows[e.RowIndex].Cells[1].Value.ToString() == "未映射") { MappingSet ms = new MappingSet(); ms.Erp_ID = dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(); ms.DrugsBase_DrugName = dataGridViewX1.Rows[e.RowIndex].Cells["DrugsBase_DrugName"].Value.ToString().Trim(); ms.Goods_ConveRatio = dataGridViewX1.Rows[e.RowIndex].Cells["Goods_ConveRatio"].Value.ToString(); ms.price = 0; ms.iden = this.iden; ms.from1 = this; ms.ShowDialog(); } else { MappingEdit ms = new MappingEdit(); ms.knid = dataGridViewX1.Rows[e.RowIndex].Cells["ID"].Value.ToString(); ms.DrugsBase_DrugName = dataGridViewX1.Rows[e.RowIndex].Cells["DrugsBase_DrugName"].Value.ToString(); ms.Goods_ConveRatio = dataGridViewX1.Rows[e.RowIndex].Cells["Goods_ConveRatio"].Value.ToString(); ms.price = 0; ms.iden = this.iden; ms.from1 = this; ms.ShowDialog(); } } }
public void Bind() { soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetPriceByID(ERP_ID); if (li != null && li.Rows.Count > 0) { li.Columns.Add("Price_Sale", typeof(string)); decimal Price = 0; decimal Price_Plus = 0; foreach (DataRow item in li.Rows) { Price = item["Price"] != null?Convert.ToDecimal(item["Price"]) : 0; Price_Plus = item["Price_Plus"] != null?Convert.ToDecimal(item["Price_Plus"]) : 0; item["Price_Sale"] = Math.Round(Price * Price_Plus, 2); item["Price_Plus"] = Math.Round(Price_Plus, 2); } dataGridViewX1.DataSource = li; } }
private void buttonX1_Click_1(object sender, EventArgs e) { List <soso.Config> li = new List <soso.Config>(); foreach (DataGridViewRow item in dataGridViewX1.Rows) { if (item.Cells["id"].Value == null) { break; } soso.Config model = new soso.Config(); model.id = item.Cells["id"].Value.ToString(); model.cgy = item.Cells["cgy"].Value.ToString(); model.incName = item.Cells["incName"].Value.ToString(); model.discountRate = float.Parse(item.Cells["discountRate"].Value.ToString()); li.Add(model); } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bll.SetConfigList(li.ToArray(), Login.authKey); MessageBox.Show("操作成功!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void buttonX1_Click(object sender, EventArgs e) { var NewData = dataGridViewX1.DataSource as Maptool.soso.ConfigPriceMe[]; if (NewData != null) { //需要更新的价格类型 DataTable dt = new DataTable(); dt.Columns.Add("Price_Plus", typeof(decimal)); dt.Columns.Add("CateGory", typeof(string)); dt.TableName = "Table_PricePlus"; foreach (var item in NewData) { string Name = item.name; float Price_Plus = item.Price_Plus; if (!string.IsNullOrEmpty(Name) && Price_Plus > 0) { var dr = dt.NewRow(); dr["Price_Plus"] = Price_Plus; dr["CateGory"] = Name; dt.Rows.Add(dr); } } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); bool Result = bll.SetConfigPriceMe(Login.authKey, dt); if (Result) { MessageBox.Show("保存成功!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("保存失败!"); } this.Close(); } }
public void Bind() { string msg = Main.Menu.First(x => x.id == iden).name.Replace("数据映射", ""); switch (BinType) { case 0: groupBox1.Text = "全部数据(" + msg + ")"; break; case 1: groupBox1.Text = "未映射数据(" + msg + ")"; break; case 2: groupBox1.Text = "已映射数据(" + msg + ")"; break; } if (BinType != 1) { dataGridViewX1.Columns["Column2"].Visible = false; } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetMaptoolList(PageSize, PageIndex, order, orderField, like, whereField, sqlext, BinType, Login.authKey, this.iden); if (li != null) { var dt = li.Tables[0]; dt.Columns.Add("s", typeof(string)); for (int i = 0; i < dt.Rows.Count; i++) { if (Library.Lang.DataValidator.isNumber(dt.Rows[i]["Linkid"])) { dt.Rows[i]["s"] = "已映射"; } else { dt.Rows[i]["s"] = "未映射"; } //动态添加价格类型 string ID = dt.Rows[i]["ID"].ToString(); DataTable PriceTable = bll.GetPriceByID(ID); if (PriceTable != null && PriceTable.Rows.Count > 0) { foreach (DataRow dr in PriceTable.Rows) { string tempcategory = dr["category"] == null ? string.Empty : dr["category"].ToString(); decimal tempprice = dr["price"] == null ? 0 : Convert.ToDecimal(dr["price"]); //添加新列 if (!dt.Columns.Contains(tempcategory)) { dt.Columns.Add(tempcategory, typeof(string)); if (!dataGridViewX1.Columns.Contains(tempcategory)) { dataGridViewX1.Columns.Insert(13, new DataGridViewTextBoxColumn() { HeaderText = tempcategory, DataPropertyName = tempcategory, Name = tempcategory }); } } dt.Rows[i][tempcategory] = tempprice; } } } dataGridViewX1.DataSource = dt; recordCount = int.Parse(li.Tables[1].Rows[0]["recordCount"].ToString()); pageCount = int.Parse(li.Tables[1].Rows[0]["pageCount"].ToString()); paginger(); labelX1.Text = string.Format("共{0}条记录", recordCount); } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Bind() { string msg = "商城数据"; switch (BinType) { case 0: groupBox1.Text = "全部数据(" + msg + ")"; break; case 1: groupBox1.Text = "未映射数据(" + msg + ")"; break; case 2: groupBox1.Text = "已映射数据(" + msg + ")"; break; } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetShopList(PageSize, PageIndex, order, orderField, like, whereField, sqlext, BinType, Login.authKey, iden); if (BinType == 1) { dataGridViewX1.Columns["sup"].Visible = false; } else { dataGridViewX1.Columns["sup"].Visible = true; } if (li != null) { //取商品流向设置 DataTable lx = bll.GetLiuXiangList(Login.authKey); var dt = li.Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { //动态添加价格类型 string ID = dt.Rows[i]["spid"].ToString(); DataTable PriceTable = bll.GetPriceByID(ID); if (PriceTable != null && PriceTable.Rows.Count > 0) { foreach (DataRow dr in PriceTable.Rows) { string tempcategory = dr["category"] == null ? string.Empty : dr["category"].ToString(); decimal tempprice = dr["price_n"] == null ? 0 : Convert.ToDecimal(dr["price_n"]); //添加新列 if (!dt.Columns.Contains(tempcategory)) { dt.Columns.Add(tempcategory, typeof(string)); if (!dataGridViewX1.Columns.Contains(tempcategory)) { dataGridViewX1.Columns.Insert(13, new DataGridViewTextBoxColumn() { HeaderText = tempcategory, DataPropertyName = tempcategory, Name = tempcategory }); } } dt.Rows[i][tempcategory] = tempprice; } } } dataGridViewX1.DataSource = dt; recordCount = int.Parse(li.Tables[1].Rows[0]["recordCount"].ToString()); pageCount = int.Parse(li.Tables[1].Rows[0]["pageCount"].ToString()); paginger(); labelX1.Text = string.Format("共{0}条记录", recordCount); } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Bind() { //中药材显示的方式 //中药材显示的方式 if (Program.iden_in_zyc.Contains(iden) && !dataGridViewX1.Columns.Contains("ProductionAddress")) { dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "产地", DataPropertyName = "ProductionAddress", Name = "ProductionAddress" }); dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "片型", Name = "DrugsBase_Formulation2", }); dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "制法", Name = "ProductionMethodName", }); } soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); DataSet li = new soso.syntoolSoapClient().GetCompleteLink(this.knid, iden, Login.authKey); if (li != null) { dataGridViewX1.Rows.Clear(); for (int i = 0; i < li.Tables[0].Rows.Count; i++) { dataGridViewX1.Rows.Add(); try { if (Program.iden_in_zyc.Contains(iden)) { dataGridViewX1.Rows[i].Cells["ProductionAddress"].Value = li.Tables[0].Rows[i]["ProductionAddress"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["DrugsBase_Formulation2"].Value = li.Tables[0].Rows[i]["DrugsBase_Formulation2"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["ProductionMethodName"].Value = li.Tables[0].Rows[i]["ProductionMethodName"].ToString().Trim(); } dataGridViewX1.Rows[i].Cells["Column1"].Value = li.Tables[0].Rows[i]["DrugsBase_DrugName"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column1"].ToolTipText = "双击查看图片"; dataGridViewX1.Rows[i].Cells["Column2"].Value = li.Tables[0].Rows[i]["DrugsBase_Specification"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column3"].Value = li.Tables[0].Rows[i]["DrugsBase_Formulation"].ToString().Trim(); dataGridViewX1.Rows[i].Cells[5].Value = li.Tables[0].Rows[i]["DrugsBase_Manufacturer"].ToString().Trim(); dataGridViewX1.Rows[i].Cells[6].Value = li.Tables[0].Rows[i]["DrugsBase_ApprovalNumber"].ToString().Trim(); dataGridViewX1.Rows[i].Cells[7].Value = li.Tables[0].Rows[i]["Registration_No"].ToString().Trim(); var dr = li.Tables[0].Rows[i]; dataGridViewX1.Rows[i].Cells["Column6"].Value = string.Format("{0}{1}/{2}", dr["Goods_ConveRatio"], dr["Goods_ConveRatio_Unit"], dr["Goods_Unit"]); dataGridViewX1.Rows[i].Cells["Product_ID"].Value = li.Tables[0].Rows[i]["Product_ID"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column8"].ToolTipText = li.Tables[0].Rows[i]["Product_ID"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column7"].Value = dr["Goods_ConveRatio"].ToString(); dataGridViewX1.Rows[i].Cells["Goods_Pcs"].Value = dr["Goods_Pcs"].ToString(); dataGridViewX1.Rows[i].Cells["colGoods_Pcs_Small"].Value = dr["Goods_Pcs_Small"].ToString(); dataGridViewX1.Rows[i].Cells["Goods_Unit"].Value = dr["Goods_Unit"].ToString(); dataGridViewX1.Rows[i].Cells["Goods_Id"].Value = li.Tables[0].Rows[i]["Goods_Id"].ToString().Trim(); } catch (Exception ex) { throw ex; } } } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void Bind() { dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "产地", DataPropertyName = "ProductionAddress", Name = "ProductionAddress" }); dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "片型", Name = "DrugsBase_Formulation2", }); dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "制法", Name = "ProductionMethodName", }); dataGridViewX1.Columns.Add(new DataGridViewTextBoxColumn() { HeaderText = "等级", Name = "ProductionLevelName", }); soso.syntoolSoapClient bll = new soso.syntoolSoapClient(); var li = bll.GetListAll101(PageSize, PageIndex, order, orderField, like, whereField, whereString, sql, Login.authKey); if (li != null) { dataGridViewX1.Rows.Clear(); for (int i = 0; i < li.Tables[0].Rows.Count; i++) { dataGridViewX1.Rows.Add(); dataGridViewX1.Rows[i].Cells["ProductionAddress"].Value = li.Tables[0].Rows[i]["ProductionAddress"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["DrugsBase_Formulation2"].Value = li.Tables[0].Rows[i]["DrugsBase_Formulation2"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["ProductionMethodName"].Value = li.Tables[0].Rows[i]["ProductionMethodName"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["ProductionLevelName"].Value = li.Tables[0].Rows[i]["ProductionLevelName"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column9"].Value = li.Tables[0].Rows[i]["Product_ID"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column1"].Value = li.Tables[0].Rows[i]["DrugsBase_DrugName"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column1"].ToolTipText = "双击查看图片"; dataGridViewX1.Rows[i].Cells["Column2"].Value = li.Tables[0].Rows[i]["DrugsBase_Specification"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column3"].Value = li.Tables[0].Rows[i]["DrugsBase_Formulation"].ToString().Trim(); dataGridViewX1.Rows[i].Cells[6].Value = li.Tables[0].Rows[i]["DrugsBase_Manufacturer"].ToString().Trim(); dataGridViewX1.Rows[i].Cells[7].Value = li.Tables[0].Rows[i]["DrugsBase_ApprovalNumber"].ToString().Trim(); dataGridViewX1.Rows[i].Cells[8].Value = li.Tables[0].Rows[i]["Registration_No"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Goods_Unit"].Value = li.Tables[0].Rows[i]["Goods_Unit"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Goods_Pcs"].Value = li.Tables[0].Rows[i]["Goods_Pcs"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Goods_Id"].Value = li.Tables[0].Rows[i]["Goods_Id"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Goods_Pcs_Small"].Value = li.Tables[0].Rows[i]["Goods_Pcs_Small"].ToString().Trim(); var dr = li.Tables[0].Rows[i]; dataGridViewX1.Rows[i].Cells["Column6"].Value = string.Format("{0}{1}/{2}", dr["Goods_ConveRatio"], dr["Goods_ConveRatio_Unit"], dr["Goods_Unit"]); dataGridViewX1.Rows[i].Cells["Product_ID"].Value = li.Tables[0].Rows[i]["Product_ID"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column8"].ToolTipText = li.Tables[0].Rows[i]["Product_ID"].ToString().Trim(); dataGridViewX1.Rows[i].Cells["Column7"].Value = dr["Goods_ConveRatio"].ToString(); } recordCount = int.Parse(li.Tables[1].Rows[0]["recordCount"].ToString()); pageCount = int.Parse(li.Tables[1].Rows[0]["pageCount"].ToString()); paginger(); } else { MessageBox.Show("您的登陆状态已经失效,请关闭后重新登陆!", "操作失败", MessageBoxButtons.OK, MessageBoxIcon.Error); } }