Ejemplo n.º 1
0
        /// <summary>
        /// 保存(传入事务处理)
        /// </summary>
        /// <param name="p_BE">要新增的实体</param>
        /// <param name="sqlTrans">事务类</param>
        public void RSave(BaseEntity p_BEMain, ArrayList p_BEDts, IDBTransAccess sqlTrans)
        {
            try
            {
                Vendor entityVendor = (Vendor)p_BEMain;
                string sql          = "";

                sql = "DELETE FROM Data_VendorTypeDts WHERE VendorID=" + SysString.ToDBString(entityVendor.VendorID);
                sqlTrans.ExecuteNonQuery(sql);

                for (int i = 0; i < p_BEDts.Count; i++)
                {
                    VendorTypeDts entity = (VendorTypeDts)p_BEDts[i];
                    sql = "INSERT INTO Data_VendorTypeDts(VendorID,VendorTypeID) VALUES(" + SysString.ToDBString(entityVendor.VendorID) + "," + entity.VendorTypeID + ")";
                    sqlTrans.ExecuteNonQuery(sql);
                }
            }
            catch (BaseException)
            {
                throw;
            }
            catch (Exception E)
            {
                throw new BaseException(E.Message);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得公司类型
        /// </summary>
        /// <returns></returns>
        private ArrayList GetEntityDtsVendorType(DevExpress.XtraEditors.CheckedListBoxControl p_CheckList)
        {
            ArrayList al = new ArrayList();

            for (int i = 0; i < p_CheckList.ItemCount; i++)
            {
                if (p_CheckList.GetItemCheckState(i) == CheckState.Checked)
                {
                    VendorTypeDts entity = new VendorTypeDts();
                    entity.VendorID     = txtVendorID.Text.Trim();
                    entity.VendorTypeID = SysConvert.ToInt32(p_CheckList.GetItemValue(i));
                    al.Add(entity);
                }
            }
            return(al);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 检查将要操作的数据是否符合业务规则
 /// </summary>
 /// <param name="p_BE"></param>
 private void CheckCorrect(BaseEntity p_BE)
 {
     VendorTypeDts entity = (VendorTypeDts)p_BE;
 }