Exemplo n.º 1
0
 public string GetTypeName(string id)
 {
     if (int.Parse(id) > 0)
     {
         tm_GoodsType objType = Core.Container.Instance.Resolve <IServiceGoodsType>().GetEntity(int.Parse(id));
         return(objType.TypeName);
     }
     return("");
 }
Exemplo n.º 2
0
        private void SetSelectedCalcEnableStatus(bool enabled)
        {
            string isUsed = enabled ? "1" : "0";
            // 从每个选中的行中获取ID(在Grid1中定义的DataKeyNames)
            List <int> ids = GetSelectedDataKeyIDs(Grid2);

            // 执行数据库操作
            foreach (int ID in ids)
            {
                tm_GoodsType entity = Core.Container.Instance.Resolve <IServiceGoodsType>().GetEntity(ID);
                entity.IsCalc = int.Parse(isUsed);
                Core.Container.Instance.Resolve <IServiceGoodsType>().Update(entity);
            }
            // 重新绑定表格
            BindGrid2();
        }
Exemplo n.º 3
0
        public void Bind()
        {
            if (InfoID > 0)
            {
                tm_GoodsType objInfo = Core.Container.Instance.Resolve <IServiceGoodsType>().GetEntity(InfoID);

                if (objInfo == null)
                {
                    // 参数错误,首先弹出Alert对话框然后关闭弹出窗口
                    Alert.Show("参数错误!", String.Empty, ActiveWindow.GetHideReference());
                    return;
                }

                ddlPType.SelectedValue   = objInfo.ParentID.ToString();
                tbxName.Text             = objInfo.TypeName;
                txtCode.Text             = objInfo.Typecode;
                tbxRemark.Text           = objInfo.Remark;
                ddlIsUsed.SelectedValue  = objInfo.IsUsed.ToString();
                rbtnIsCalc.SelectedValue = objInfo.IsCalc.ToString();
            }
        }
Exemplo n.º 4
0
        private void SaveItem()
        {
            tm_GoodsType objInfo = new tm_GoodsType();

            if (InfoID > 0)
            {
                objInfo = Core.Container.Instance.Resolve <IServiceGoodsType>().GetEntity(InfoID);
            }
            objInfo.TypeName = tbxName.Text.Trim();
            objInfo.IsUsed   = int.Parse(ddlIsUsed.SelectedValue);
            objInfo.IsCalc   = int.Parse(rbtnIsCalc.SelectedValue);
            objInfo.ParentID = int.Parse(ddlPType.SelectedValue);
            objInfo.Remark   = tbxRemark.Text;
            objInfo.Typecode = txtCode.Text.Trim();

            if (InfoID > 0)
            {
                Core.Container.Instance.Resolve <IServiceGoodsType>().Update(objInfo);
            }
            else
            {
                Core.Container.Instance.Resolve <IServiceGoodsType>().Create(objInfo);
            }
        }
Exemplo n.º 5
0
        //获取分类名称
        public string GetType(string typeID)
        {
            tm_GoodsType objType = Core.Container.Instance.Resolve <IServiceGoodsType>().GetEntity(int.Parse(typeID));

            return(objType != null ? objType.TypeName : "");
        }