Ejemplo n.º 1
0
        /// <summary>
        /// 创建MPS变交期的委外采购变更单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnWPOModify_Click(object sender, EventArgs e)
        {
            string        userName = Context.LoginUser;
            DataParamList dp       = new DataParamList();

            dp.Add(DataParamFactory.CreateInput("UserName", userName, DbType.String));
            dp.Add(DataParamFactory.CreateOutput("Result", DbType.String));
            DataAccessor.RunSP("sp_Auctus_UI_CreateWPOModify", dp);
            string result = dp["Result"].Value.ToString();

            if (result != "1")
            {
                throw new Exception(result);
            }
        }
        internal List <long> LoadFlowNos(string sequenceBy, int count, long UserDefineNumber, KeyFlexFieldStru fieldStru)
        {
            List <long> list   = new List <long>();
            string      spName = "Base_KFFLoadFlowNew";
            long        iD     = fieldStru.ID;

            if (!FlexFieldFlow.Finder.IsExists("KeyFlexFieldStru=@KeyFlexFieldStru and Code=@SequenceBy", new OqlParam[] { new OqlParam(fieldStru.ID), new OqlParam(sequenceBy) }))
            {
                iD = KeyGenerator.NewValue();
            }
            DataParamList dataParams = new DataParamList();

            dataParams.Add(DataParamFactory.CreateInput("SN", iD, DbType.Int64));
            dataParams.Add(DataParamFactory.CreateInput("Struc", fieldStru.ID, DbType.Int64));
            dataParams.Add(DataParamFactory.CreateInput("SequenceBy", sequenceBy, DbType.String));
            dataParams.Add(DataParamFactory.CreateInput("Count", count, DbType.Int32));
            dataParams.Add(DataParamFactory.CreateOutput("ErrorInfo", DbType.String));
            dataParams.Add(DataParamFactory.CreateInput("UserFlow", UserDefineNumber, DbType.Int64));
            return(LoadFlowBySP(spName, dataParams, fieldStru, sequenceBy, count));
        }
        /// <summary>获取当前记账期间.</summary>
        /// <returns></returns>
        public static long GetSOBAccountingPeriod()
        {
            string sql = @"SELECT A1.ID FROM dbo.Base_SOBAccountingPeriod A1
JOIN Base_SetofBooks A2 ON A1.SetofBooks=A2.ID
WHERE
A2.Org=@Org AND
A1.Year=@Year AND A1.Code=@Code";

            var parasUpdate = new DataParamList
            {
                DataParamFactory.CreateInput("Org", UFIDA.U9.Base.Context.LoginOrg.ID, System.Data.DbType.Int64),
                DataParamFactory.CreateInput("Year", DateTime.Now.Year, System.Data.DbType.Int16),
                DataParamFactory.CreateInput("Code", DateTime.Now.ToString("MM"), System.Data.DbType.String)
            };

            DataAccessor.RunSQL(DatabaseManager.GetCurrentConnection(), sql, parasUpdate, out DataSet ds);
            if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0)
            {
                return(Convert.ToInt64(ds.Tables[0].Rows[0][0]));
            }

            return(-1);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     查询服务信息
        /// </summary>
        /// <param name="bpsvTypeQuery"></param>
        /// <returns></returns>
        public ReturnMessage <List <BPSVType> > QueryBPSVType(BPSVTypeQuery bpsvTypeQuery)
        {
            if (bpsvTypeQuery == null)
            {
                throw new ArgumentException("bpsvTypeQuery is null");
            }
            if (string.IsNullOrWhiteSpace(bpsvTypeQuery.QueryStr))
            {
                throw new ArgumentException("bpsvTypeQuery.QueryStr is empty");
            }
            string[]      arrQueryStr = bpsvTypeQuery.QueryStr.Split(' ');
            StringBuilder sb          = new StringBuilder();

            sb.Append(@"SELECT B.DisplayName,
                       A.FullName,
                       C.AssemblyName,
                       C.Kind
                FROM UBF_MD_Class AS A
                    LEFT JOIN UBF_MD_Class_Trl AS B
                        ON A.Local_ID = B.Local_ID
                    LEFT JOIN UBF_MD_Component AS C
                        ON A.MD_Component_ID = C.ID
                    LEFT JOIN UBF_MD_Component_Trl AS D
                        ON C.Local_ID = D.Local_ID
                WHERE (
                          C.Kind = 'SV'
                          OR C.Kind = 'BP'
                      )
                      AND (");
            StringBuilder fullNameSb    = new StringBuilder();
            StringBuilder displayNameSb = new StringBuilder();

            fullNameSb.Append("(");
            displayNameSb.Append("(");
            bool          isFirst    = true;
            DataParamList dataParams = new DataParamList();

            for (int i = 0; i < arrQueryStr.Length; i++)
            {
                string str       = arrQueryStr[i];
                string paramName = "param" + i;
                if (string.IsNullOrWhiteSpace(str))
                {
                    continue;
                }
                if (!isFirst)
                {
                    fullNameSb.Append(" AND ");
                    displayNameSb.Append(" AND ");
                }
                fullNameSb.AppendFormat("A.FullName LIKE @{0}", paramName);
                displayNameSb.AppendFormat("B.DisplayName LIKE @{0}", paramName);
                dataParams.Add(DataParamFactory.CreateInput(paramName, string.Format("%{0}%", str), DbType.String));
                isFirst = false;
            }
            fullNameSb.Append(")");
            displayNameSb.Append(")");
            sb.Append(fullNameSb + " OR " + displayNameSb);
            sb.Append(")");
            DataSet dataSet;

            DataAccessor.RunSQL(DatabaseManager.GetCurrentConnection(), sb.ToString(), dataParams, out dataSet);
            List <BPSVType> list = new List <BPSVType>();

            if (dataSet != null && dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in dataSet.Tables[0].Rows)
                {
                    BPSVType bpsv = new BPSVType();
                    bpsv.DisplayName  = AsString(row, "DisplayName");
                    bpsv.FullName     = AsString(row, "FullName");
                    bpsv.AssemblyName = AsString(row, "AssemblyName");
                    bpsv.Kind         = AsString(row, "Kind");
                    list.Add(bpsv);
                }
            }
            ReturnMessage <List <BPSVType> > ret = new ReturnMessage <List <BPSVType> >();

            ret.Result    = list;
            ret.IsSuccess = true;
            return(ret);
        }