Esempio n. 1
0
 /// <summary>
 /// 初始化数据
 /// </summary>
 /// <param name="ut"></param>
 private void OnStartData(T_StockEntity ut)
 {
 EquipmentName_Input.Text = EquipmentName_Disp.Text = ut.EquipmentName.ToString();
         Model_Input.Text = Model_Disp.Text = ut.Model.ToString();
         StockNumber_Input.Text = StockNumber_Disp.Text = ut.StockNumber.ToString();
         CodeNO_Input.Text = CodeNO_Disp.Text = ut.CodeNO.ToString();
         
 }
 /// <summary>
 /// 根据ID返回 T_StockEntity实体类 单笔资料 (库存)
 /// </summary>
 /// <param name="ID">ID ID</param>
 /// <returns>返回 T_StockEntity实体类 ID为0则无记录</returns>
 public static T_StockEntity T_StockDisp(Int32 ID)
 {
     T_StockEntity fam = new T_StockEntity();
     QueryParam qp = new QueryParam();
     qp.PageIndex = 1;
     qp.PageSize = 1;
     qp.Where = string.Format(" Where {0}.{1} = {2}", "T_Stock", "ID", ID);
     int RecordCount = 0;
     List<T_StockEntity> lst = T_StockList(qp, out RecordCount);
     if (RecordCount > 0)
     {
         fam = lst[0];
     }
     return fam;
 }
 /// <summary>
 /// 新增/删除/修改 T_StockEntity (库存)
 /// </summary>
 /// <param name="fam">T_StockEntity实体类</param>
 /// <returns>-1:存储过程执行失败,-2:存在相同的主键,Insert:返回插入自动ID,Update:返回更新记录数,Delete:返回删除记录数</returns>
 public static Int32 T_StockInsertUpdateDelete(T_StockEntity fam)
 {
     return DataProvider.Instance().T_StockInsertUpdateDelete(fam);
 }
Esempio n. 4
0
        /// <summary>
        /// 将记录集转为T_StockEntity实体类 (库存)
        /// </summary>
        /// <param name="dr">记录集</param>
        /// <param name="Fileds">字段名列表</param>
        /// <returns>T_StockEntity</returns>
        protected T_StockEntity PopulateT_StockEntity(IDataReader dr, Dictionary<string, string> Fileds)
        {
            T_StockEntity nc = new T_StockEntity();

            if (Fileds.ContainsKey("ID") && !Convert.IsDBNull(dr["ID"])) nc.ID = Convert.ToInt32(dr["ID"]); // ID
            if (Fileds.ContainsKey("EquipmentName") && !Convert.IsDBNull(dr["EquipmentName"])) nc.EquipmentName = Convert.ToString(dr["EquipmentName"]).Trim(); // 器材名称
            if (Fileds.ContainsKey("Model") && !Convert.IsDBNull(dr["Model"])) nc.Model = Convert.ToString(dr["Model"]).Trim(); // 型号
            if (Fileds.ContainsKey("StockNumber") && !Convert.IsDBNull(dr["StockNumber"])) nc.StockNumber = Convert.ToInt32(dr["StockNumber"]); // 库存量
            if (Fileds.ContainsKey("CodeNO") && !Convert.IsDBNull(dr["CodeNO"])) nc.CodeNO = Convert.ToString(dr["CodeNO"]).Trim(); // 编码号
            return nc;
        }
Esempio n. 5
0
 /// <summary>
 /// 新增/删除/修改 T_StockEntity (库存)
 /// </summary>
 /// <param name="fam">T_Stock实体类</param>
 /// <returns>-1:存储过程执行失败,-2:存在相同的主键,Insert:返回插入自动ID,Update:返回更新记录数,Delete:返回删除记录数</returns>
 public abstract Int32 T_StockInsertUpdateDelete(T_StockEntity fam);
Esempio n. 6
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string Checkbox_Value = (string)Common.sink("Checkbox", MethodType.Post, 2000, 1, DataType.Str);
            string[] Checkbox_Value_Array = Checkbox_Value.Split(',');
            Int32 IDX = 0;
            for (int i = 0; i < Checkbox_Value_Array.Length; i++)
            {
                if (Int32.TryParse(Checkbox_Value_Array[i], out IDX))
                {
                    T_StockEntity et = new T_StockEntity();
                    et.DataTable_Action_ = DataTable_Action.Delete;
                    et.ID = IDX;
                    BusinessFacadeShanlitech_Location.T_StockInsertUpdateDelete(et);
                }
            }

            EventMessage.MessageBox(1, "批量删除成功", string.Format("批量删除({0})成功!", Checkbox_Value), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
        }