Exemplo n.º 1
0
        /// <summary>
        /// 获取金蝶默认科目配置信息
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <returns></returns>
        public EyouSoft.Model.ComStructure.MKisConfigInfo GetKisConfigInfo(string companyId)
        {
            var       info = new EyouSoft.Model.ComStructure.MKisConfigInfo();
            DbCommand cmd  = _db.GetSqlStringCommand(SQL_SELECT_GetSettings);

            _db.AddInParameter(cmd, "CompanyId", DbType.AnsiStringFixedLength, companyId);

            using (IDataReader rdr = DbHelper.ExecuteReader(cmd, _db))
            {
                while (rdr.Read())
                {
                    int?_key = EyouSoft.Toolkit.Utils.GetIntNullable(rdr["Key"].ToString(), null);
                    if (!_key.HasValue)
                    {
                        continue;
                    }

                    string _value = rdr["Value"].ToString();

                    switch (_key)
                    {
                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.订单收款_贷: info.Kis1000 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.订单收款_借: info.Kis1999 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.计调预付款_贷: info.Kis2000 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.计调预付款_借: info.Kis2999 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.导游备用金_贷: info.Kis3000 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.导游备用金_借: info.Kis3999 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_预付账款_借: info.Kis4000 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_预收账款_贷: info.Kis4500 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_团队借款_贷: info.Kis4501 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_现金_贷: info.Kis4999 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_主营业务收入_贷: info.Kis5000 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_团队借款_贷: info.Kis5001 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_团队预支_贷: info.Kis5002 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_团队支出_贷: info.Kis5003 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_应付账款_贷: info.Kis5004 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_现金_贷: info.Kis5005 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_主营业务成本_借: info.Kis5006 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_预收账款_借: info.Kis5007 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_现金_借: info.Kis5008 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_银行存款_借: info.Kis5009 = _value; break;

                    case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_应收帐款_借: info.Kis5999 = _value; break;

                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_主营业务收入_贷: info.Kis6000 = _value; break;
                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_团队预支_贷: info.Kis6001 = _value; break;
                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_应付账款_贷: info.Kis6002 = _value; break;
                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_团队支出_贷: info.Kis6003 = _value; break;
                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_预收账款_借: info.Kis6500 = _value; break;
                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_应收账款_借: info.Kis6501 = _value; break;
                    //case (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_主营业务成本_借: info.Kis6999 = _value; break;
                    default: break;
                    }
                }
            }

            return(info);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 设置金蝶默认科目配置信息
 /// </summary>
 /// <param name="companyId">公司编号</param>
 /// <param name="info">金蝶默认科目配置信息业务实体</param>
 /// <returns></returns>
 public bool SetKisConfigInfo(string companyId, EyouSoft.Model.ComStructure.MKisConfigInfo info)
 {
     return(dal.SetKisConfigInfo(companyId, info));
 }
Exemplo n.º 3
0
        /// <summary>
        /// 设置金蝶默认科目配置信息
        /// </summary>
        /// <param name="companyId">公司编号</param>
        /// <param name="info">金蝶默认科目配置信息业务实体</param>
        /// <returns></returns>
        public bool SetKisConfigInfo(string companyId, EyouSoft.Model.ComStructure.MKisConfigInfo info)
        {
            #region create xml
            //xml格式<item><val id="key">value</val></item>
            StringBuilder xml = new StringBuilder();
            xml.Append("<item>");
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.订单收款_贷, info.Kis1000);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.订单收款_借, info.Kis1999);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.计调预付款_贷, info.Kis2000);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.计调预付款_借, info.Kis2999);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.导游备用金_贷, info.Kis3000);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.导游备用金_借, info.Kis3999);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_预付账款_借, info.Kis4000);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_预收账款_贷, info.Kis4500);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_团队借款_贷, info.Kis4501);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.团未完导游先报账_现金_贷, info.Kis4999);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_主营业务收入_贷, info.Kis5000);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_团队借款_贷, info.Kis5001);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_团队预支_贷, info.Kis5002);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_团队支出_贷, info.Kis5003);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_应付账款_贷, info.Kis5004);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_现金_贷, info.Kis5005);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_主营业务成本_借, info.Kis5006);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_预收账款_借, info.Kis5007);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_现金_借, info.Kis5008);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_银行存款_借, info.Kis5009);
            xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.单团核算_应收帐款_借, info.Kis5999);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_主营业务收入_贷, info.Kis6000);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_团队预支_贷, info.Kis6001);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_应付账款_贷, info.Kis6002);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_团队支出_贷, info.Kis6003);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_预收账款_借, info.Kis6500);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_应收账款_借, info.Kis6501);
            //xml.AppendFormat("<val id='{0}'>{1}</val>", (int)EyouSoft.Model.EnumType.KingDee.SysConfigDefaultSubject.后期收款_主营业务成本_借, info.Kis6999);
            xml.Append("</item>");
            #endregion

            DbCommand cmd = this._db.GetStoredProcCommand(SQL_PROC_SetSettings);
            _db.AddInParameter(cmd, "@CompanyId", DbType.AnsiStringFixedLength, companyId);
            _db.AddInParameter(cmd, "@xml", DbType.Xml, xml.ToString());
            _db.AddOutParameter(cmd, "@RetCode", DbType.Int32, 4);

            int sqlExceptionCode = 0;
            try
            {
                DbHelper.RunProcedure(cmd, _db);
            }
            catch (System.Data.SqlClient.SqlException e)
            {
                sqlExceptionCode = 0 - e.Number;
            }

            if (sqlExceptionCode < 0)
            {
                return(false);
            }
            else
            {
                return(Convert.ToInt32(_db.GetParameterValue(cmd, "RetCode")) == 1);
            }
        }