/// <summary> /// 加载Grid数据 /// </summary> /// <param name="typeKey">商品类型</param> /// <param name="wName">商品名称</param> /// <param name="wStock">商品库存</param> /// <param name="wPriceTrend">商品</param> /// <param name="wAttach"></param> private void RefreshGrid(string typeKey, string wName, string wStock, string wPriceTrend, string wAttach) { if (!string.IsNullOrEmpty(typeKey)) { List <ProductInfo> rtnList = DBHelper.GetInstance().WareGetAll(typeKey, wName, wStock, wPriceTrend, wAttach); PubClass.GetInstance().CurWares = rtnList; _productView.RefreshGrid(rtnList); } }
/// <summary> /// 加载Grid数据 /// </summary> private void RefreshGrid(string typeKey) { if (!string.IsNullOrEmpty(typeKey)) { List <ProductInfo> rtnList = DBHelper.GetInstance().WareGetAll(typeKey); PubClass.GetInstance().CurWares = rtnList; _productView.RefreshGrid(rtnList); txtWareCount.Caption = string.Format("商品数量:{0}", rtnList != null ? rtnList.Count : 0); } }
/// <summary> /// 根据查询结果显示商品 /// </summary> /// <param name="index"></param> private void ShowMyProduct(int index) { ProductInfo tmpProduct = PubClass.GetInstance().CurWares[index]; _myProduct = DBHelper.GetInstance().WareGetOne(tmpProduct.ProductID); if (_myProduct != null) { InitUiControlsData(); } else { MessageBox.Show("提取商品信息失败,请与杀京东开发商WolfStudio工作室联系!", "系统提示"); } }
/// <summary> /// 加载Grid数据 /// </summary> private void RefreshGrid() { List <ProductInfo> rtnList = DBHelper.GetInstance().WareGetAll(); if (rtnList != null && rtnList.Count > 0) { PubClass.GetInstance().CurWares = rtnList; txtWareCount.Caption = string.Format("商品数量:{0}", rtnList.Count); _productView.RefreshGrid(rtnList); } else { PubClass.GetInstance().CurWares = null; txtWareCount.Caption = string.Format("商品数量:{0}", 0); } }
/// <summary> /// 上一个商品 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnTop_Click(object sender, EventArgs e) { if (_myProduct != null && PubClass.GetInstance().CurWares != null && PubClass.GetInstance().CurWares.Count > 0) { int index = PubClass.GetInstance().CurWares.FindIndex(t => t.ProductID == _myProduct.ProductID); if (index >= 0) { index--; if (index < 0) { index = PubClass.GetInstance().CurWares.Count - 1; } ShowMyProduct(index); } } else { if (!string.IsNullOrEmpty(txtID.Text)) { _myProduct = DBHelper.GetInstance().WareGetOne(txtID.Text); } } }
public static PubClass GetInstance() { return _instance ?? (_instance = new PubClass()); }
private void ShowParams() { PubClass.GetInstance().GetSysParams(); }
private void btnSave_Click(object sender, EventArgs e) { if (cmb1.EditValue == null || cmb2.EditValue == null || cmb3.EditValue == null) { MessageBox.Show("配送区域不能为空!", "系统提示"); return; } SysParams.UserName = txtUserName.Text; SysParams.UserPass = string.IsNullOrEmpty(txtUserPass.Text) ? "123456" : PassWordHelper.GetInstance().DesStr(txtUserPass.Text, "isarahan", "wolfstud"); SysParams.JDUserName = txtJDUserName.Text; SysParams.JDUserPass = string.IsNullOrEmpty(txtJDUserPass.Text) ? "123456" : PassWordHelper.GetInstance().DesStr(txtJDUserPass.Text, "isarahan", "wolfstud"); SysParams.AllowAutoGetWebUrl = chkAllowAutoGetWebUrl.Checked; SysParams.AllowAutoGetFocusWare = chkAllowAutoGetFocusWare.Checked; SysParams.AutoGetFocusTime = cmbFocusTime.Text; SysParams.AllowAutoGC = true; #region Gather Params SysParams.GatherJDWare = chkGatherJD.Checked; SysParams.GatherQJWare = chkGatherQJ.Checked; SysParams.Gather3Ware = chkGather3.Checked; SysParams.GetWareBaseInfo = chkWareBaseInfo.Checked; SysParams.GetWarePrice = chkWarePrice.Checked; SysParams.GetWareStock = chkWareStock.Checked; SysParams.GetWarePostMessage = chkWarePostMessage.Checked; SysParams.GetWareCoupon = chkWareCopon.Checked; SysParams.GetWarePicture = chkWarePicture.Checked; #endregion Gather Params #region Monitor Params SysParams.AllowAutoUpdateWareInfo = chkAllowAutoUpdateWareinfo.Checked; SysParams.AutoUpdateTime = cmbUpdateTime.Text; SysParams.AllowGetPrice = chkAllowGetPrice.Checked; SysParams.AllowGetMobilePrice = chkAllowGetAPPPrice.Checked; SysParams.AllowGetQQPrice = chkAllowGetQQPrice.Checked; SysParams.AllowGetWXPrice = chkAllowGetWXPrice.Checked; SysParams.AllowGetStock = chkAllowGetStock.Checked; SysParams.AllowGetCoupon = chkAllowGetCoupon.Checked; SysParams.AllowGetPostMessage = chkAllowGetPostMessage.Checked; SysParams.AllowGetPromo = chkAllowGetPromo.Checked; #endregion Monitor Params SysParams.Level1Area = cmb1.Text; SysParams.Level2Area = cmb2.Text; SysParams.Level3Area = cmb3.Text; int id1 = (int)cmb1.EditValue; int id2 = (int)cmb2.EditValue; int id3 = (int)cmb3.EditValue; SysParams.DispathArea = string.Format("{0}_{1}_{2}_0", id1, id2, id3); SysParams.AllowRunAtSystemStart = chkAllowRunAtSystemStart.Checked; SysParams.AllowLoginVerify = chkAllowLoginVerify.Checked; SysParams.CheckNetState = chkCheckNetState.Checked; SysParams.AllowAutoUpdateVersion = chkAllowAutoUpdateVersion.Checked; PubClass.GetInstance().AssemblyParams(); this.FindForm().Close(); }
private void InitSysparams() { PubClass.GetInstance().GetSysParams(); RefreshStatubar(); }
public static PubClass GetInstance() { return(_instance ?? (_instance = new PubClass())); }