當前位置: 首頁>>代碼示例>>C#>>正文


C# Common.ResultModel類代碼示例

本文整理匯總了C#中NFMT.Common.ResultModel的典型用法代碼示例。如果您正苦於以下問題:C# ResultModel類的具體用法?C# ResultModel怎麽用?C# ResultModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ResultModel類屬於NFMT.Common命名空間,在下文中一共展示了ResultModel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckContractSubBusinessInvoiceApplyConfirm

        public ResultModel CheckContractSubBusinessInvoiceApplyConfirm(UserModel user, int subId)
        {
            ResultModel result = new ResultModel();

            string cmdText = "select COUNT(*) from dbo.Inv_BusinessInvoice bi inner join dbo.Invoice inv on inv.InvoiceId = bi.InvoiceId where bi.SubContractId = 1 and inv.InvoiceStatus in (@entryStatus,@readyStatus)";

            SqlParameter[] paras = new SqlParameter[3];
            paras[0] = new SqlParameter("@subId", subId);
            paras[1] = new SqlParameter("@entryStatus", (int)NFMT.Common.StatusEnum.已錄入);
            paras[1] = new SqlParameter("@readyStatus", (int)NFMT.Common.StatusEnum.已生效);

            object obj = DBUtility.SqlHelper.ExecuteScalar(this.ConnectString, CommandType.Text, cmdText, paras);
            int i = 0;
            if (obj == null || !int.TryParse(obj.ToString(), out i) || i <= 0)
            {
                result.ResultStatus = -1;
                result.Message = "檢驗業務發票失敗";
                return result;
            }
            if (i > 0)
            {
                result.ResultStatus = -1;
                result.Message = "子合約中含有未完成的業務發票,不能進行確認完成操作。";
                return result;
            }

            result.ResultStatus = 0;
            result.Message = "業務發票全部完成";

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:31,代碼來源:BusinessInvoiceDAL.cs

示例2: GetContractOutCorp

        public ResultModel GetContractOutCorp(UserModel user, int subId)
        {
            ResultModel result = new ResultModel();

            try
            {
                int readyStatus = (int)StatusEnum.已生效;

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("select corpdetail.CorpId,corpdetail.CorpName ");
                sb.Append("from dbo.Con_ContractSub sub  ");
                sb.AppendFormat("inner join dbo.Con_ContractCorporationDetail corpdetail on sub.ContractId = corpdetail.ContractId and corpdetail.DetailStatus>={0} ", readyStatus);
                sb.AppendFormat("and corpdetail.IsInnerCorp = 0 where sub.SubId = {0} order by corpdetail.IsDefaultCorp desc", subId);
                DataTable dt = NFMT.DBUtility.SqlHelper.ExecuteDataTable(this.ConnectString, sb.ToString(), null, CommandType.Text);
                if (dt != null && dt.Rows.Count > 0)
                {
                    result.Message = "獲取成功";
                    result.ResultStatus = 0;
                    result.ReturnValue = dt;
                }
                else
                {
                    result.Message = "獲取失敗";
                    result.ResultStatus = -1;
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.ResultStatus = -1;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:34,代碼來源:ContractSubDAL.cs

示例3: GetPriceConfirmStockListSelect

        public ResultModel GetPriceConfirmStockListSelect(UserModel user, int subId,System.Text.StringBuilder sb)
        {
            ResultModel result = new ResultModel();

            try
            {
                System.Data.DataTable dt = NFMT.DBUtility.SqlHelper.ExecuteDataTable(this.ConnectString, sb.ToString(), null, System.Data.CommandType.Text);
                if (dt != null && dt.Rows.Count > 0)
                {
                    result.ResultStatus = 0;
                    result.Message = "獲取成功";
                    result.ReturnValue = dt;
                }
                else
                {
                    result.ResultStatus = -1;
                    result.Message = "獲取失敗";
                }
            }
            catch (Exception e)
            {
                result.ResultStatus = -1;
                result.Message = e.Message;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:27,代碼來源:PriceConfirmDAL.cs

示例4: ChangePwd

        public ResultModel ChangePwd(UserModel user, string newPwd)
        {
            ResultModel result = new ResultModel();

            try
            {
                string sql = string.Format("update dbo.Account set PassWord = '{0}' where EmpId = {1} and AccStatus = {2}", newPwd.Trim(), user.EmpId, (int)Common.StatusEnum.已生效);
                int i = NFMT.DBUtility.SqlHelper.ExecuteNonQuery(this.ConnectString, CommandType.Text, sql, null);
                if (i > 0)
                {
                    result.ResultStatus = 0;
                    result.Message = "修改密碼成功";
                }
                else
                {
                    result.ResultStatus = -1;
                    result.Message = "修改密碼失敗";
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.ResultStatus = -1;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:27,代碼來源:AccountDAL.cs

示例5: GetCurrencyId

        public ResultModel GetCurrencyId(UserModel user, int stockId)
        {
            ResultModel result = new ResultModel();

            try
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append("select sub.SettleCurrency from St_StockLog sl  ");
                sb.Append("left join dbo.Con_ContractSub sub on sl.SubContractId = sub.SubId  ");
                sb.AppendFormat("where sl.StockId = {0}", stockId);
                object obj = NFMT.DBUtility.SqlHelper.ExecuteScalar(this.ConnectString, CommandType.Text, sb.ToString(), null);
                int i;
                if (obj != null && !string.IsNullOrEmpty(obj.ToString()) && int.TryParse(obj.ToString(), out i))
                {
                    result.Message = "獲取成功";
                    result.ResultStatus = 0;
                    result.ReturnValue = i;
                }
                else
                {
                    result.Message = "獲取失敗";
                    result.ResultStatus = -1;
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.ResultStatus = -1;
            }
            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:31,代碼來源:StockInStockDAL.cs

示例6: CheckContractSubCashInConfirm

        public ResultModel CheckContractSubCashInConfirm(UserModel user, int subId)
        {
            ResultModel result = new ResultModel();

            string cmdText = "select COUNT(*) from NFMT.dbo.Fun_CashInContract_Ref cic inner join NFMT.dbo.Fun_CashIn ci on cic.CashInId = ci.CashInId where cic.SubContractId [email protected] and ci.CashInStatus in (@entryStatus,@readyStatus)";

            SqlParameter[] paras = new SqlParameter[3];
            paras[0] = new SqlParameter("@subId", subId);
            paras[1] = new SqlParameter("@entryStatus", (int)NFMT.Common.StatusEnum.已錄入);
            paras[1] = new SqlParameter("@readyStatus", (int)NFMT.Common.StatusEnum.已生效);

            object obj = DBUtility.SqlHelper.ExecuteScalar(this.ConnectString, CommandType.Text, cmdText, paras);
            int i = 0;
            if (obj == null || !int.TryParse(obj.ToString(), out i) || i <= 0)
            {
                result.ResultStatus = -1;
                result.Message = "檢驗收款登記失敗";
                return result;
            }
            if (i > 0)
            {
                result.ResultStatus = -1;
                result.Message = "子合約中含有未完成的收款登記,不能進行確認完成操作。";
                return result;
            }

            result.ResultStatus = 0;
            result.Message = "收款登記全部完成";

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:31,代碼來源:CashInDAL.cs

示例7: BaseAudit

        public ResultModel BaseAudit(UserModel user, Model.DataSource obj, bool isPass)
        {
            ResultModel result = new ResultModel();

            try
            {
                NFMT.Common.Operate operate = NFMT.Common.Operate.CreateOperate(obj.DalName, obj.AssName);

                if (operate == null)
                {
                    result.Message = "模板不存在";
                    result.ResultStatus = -1;
                    return result;
                }

                result = operate.Get(user, obj.BaseName, obj.TableCode, obj.RowId);

                if (result.ResultStatus == 0)
                {
                    NFMT.Common.IModel model = result.ReturnValue as NFMT.Common.IModel;

                    result = operate.Audit(user, model, isPass);
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
                return result;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:33,代碼來源:DataSourceBLL.cs

示例8: GetPriceByContractId

        public ResultModel GetPriceByContractId(UserModel user, int contractId)
        {
            ResultModel result = new ResultModel();

            if (contractId < 1)
            {
                result.Message = "序號不能小於1";
                return result;
            }

            List<SqlParameter> paras = new List<SqlParameter>();
            SqlParameter para = new SqlParameter("@contractId", SqlDbType.Int, 4);
            para.Value = contractId;
            paras.Add(para);

            try
            {
                string cmdText = "select * from NFMT.dbo.Con_ContractPrice where ContractId [email protected]";
                result = Get(user, CommandType.Text, cmdText, paras.ToArray());
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }
            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:27,代碼來源:ContractPriceDAL.cs

示例9: Confirm

        public ResultModel Confirm(UserModel user, int cashInId)
        {
            ResultModel result = new ResultModel();

            try
            {
                using (System.Transactions.TransactionScope scope = new TransactionScope())
                {
                    //獲取收款登記
                    result = this.cashinDAL.Get(user, cashInId);
                    if (result.ResultStatus != 0)
                        return result;

                    Model.CashIn cashIn = result.ReturnValue as Model.CashIn;
                    if (cashIn == null || cashIn.CashInId <= 0)
                    {
                        result.ResultStatus = -1;
                        result.Message = "收款登記不存在";
                        return result;
                    }

                    result = this.cashinDAL.Confirm(user, cashIn);

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:34,代碼來源:CashInBLL.cs

示例10: GetContractDetail

        public ResultModel GetContractDetail(UserModel user, int contractId, TradeDirectionEnum tradeDirection)
        {
            ResultModel result = new ResultModel();

            try
            {
                System.Data.DataTable dt = NFMT.DBUtility.SqlHelper.ExecuteDataTable(this.ConnectString, GetSQLString(contractId, tradeDirection), null, System.Data.CommandType.Text);
                if (dt != null && dt.Rows.Count > 0)
                {
                    result.ResultStatus = 0;
                    result.Message = "獲取成功";
                    result.ReturnValue = dt;
                }
                else
                {
                    result.ResultStatus = -1;
                    result.Message = "獲取失敗";
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.ResultStatus = -1;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:27,代碼來源:ContractDAL.cs

示例11: GetCanAllotBala

        public ResultModel GetCanAllotBala(UserModel user, int cashInId, bool isUpdate, decimal alreadyAllotBala = 0)
        {
            ResultModel result = new ResultModel();

            try
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(" select ci.CashInBala - ISNULL(ref.bala,0) ");
                if (isUpdate)
                    sb.AppendFormat(" + {0} ", alreadyAllotBala);
                sb.AppendFormat(" from dbo.Fun_CashIn ci left join (select ref.CashInId,SUM(ISNULL(ref.AllotBala,0)) bala  from dbo.Fun_CashInCorp_Ref ref where ref.DetailStatus >={0}  group by ref.CashInId) ref on ci.CashInId = ref.CashInId where ci.CashInId = {1}", (int)Common.StatusEnum.已生效,cashInId);

                object obj = NFMT.DBUtility.SqlHelper.ExecuteScalar(this.ConnectString, CommandType.Text, sb.ToString(), null);
                decimal canAllotBala = 0;
                if (obj == null || string.IsNullOrEmpty(obj.ToString()) || !decimal.TryParse(obj.ToString(), out canAllotBala))
                {
                    result.ResultStatus = -1;
                    result.Message = "獲取失敗";
                }
                else
                {
                    result.ReturnValue = canAllotBala;
                    result.Message = "獲取成功";
                    result.ResultStatus = 0;
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.ResultStatus = -1;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:34,代碼來源:CashInAllotDAL.cs

示例12: CheckContractSubPayApplyConfirm

        /// <summary>
        /// 校驗子合約中付款申請是否全部確認完成
        /// </summary>
        /// <param name="user"></param>
        /// <param name="subId"></param>
        /// <returns></returns>
        public ResultModel CheckContractSubPayApplyConfirm(UserModel user, int subId)
        {
            ResultModel result = new ResultModel();

            string cmdText = "select COUNT(*) from NFMT.dbo.Fun_ContractPayApply_Ref pac inner join NFMT.dbo.Fun_PayApply pa on pa.PayApplyId = pac.PayApplyId inner join NFMT.dbo.Apply app on pa.ApplyId = app.ApplyId where pac.ContractSubId [email protected] and app.ApplyStatus in (@entryStatus,@readyStatus)";

            SqlParameter[] paras = new SqlParameter[3];
            paras[0] = new SqlParameter("@subId", subId);
            paras[1] = new SqlParameter("@entryStatus", (int)NFMT.Common.StatusEnum.已錄入);
            paras[1] = new SqlParameter("@readyStatus", (int)NFMT.Common.StatusEnum.已生效);

            object obj = DBUtility.SqlHelper.ExecuteScalar(this.ConnectString, CommandType.Text, cmdText, paras);
            int i = 0;
            if (obj == null || !int.TryParse(obj.ToString(), out i) || i <= 0)
            {
                result.ResultStatus = -1;
                result.Message = "檢驗付款申請失敗";
                return result;
            }
            if (i > 0)
            {
                result.ResultStatus = -1;
                result.Message = "子合約中含有未完成的付款申請,不能進行確認完成操作。";
                return result;
            }

            result.ResultStatus = 0;
            result.Message = "付款申請全部完成";

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:37,代碼來源:PayApplyDAL.cs

示例13: InvalidAll

        public ResultModel InvalidAll(UserModel user, int allotId)
        {
            ResultModel result = new ResultModel();

            try
            {
                string sql = string.Format("update dbo.Fun_CashInStcok_Ref set DetailStatus = {0} where AllotId = {1}", (int)Common.StatusEnum.已作廢, allotId);
                int i = NFMT.DBUtility.SqlHelper.ExecuteNonQuery(this.ConnectString, CommandType.Text, sql, null);
                if (i > 0)
                {
                    result.ResultStatus = 0;
                    result.Message = "作廢成功";
                }
                else
                {
                    result.Message = "作廢失敗";
                    result.ResultStatus = -1;
                }
            }
            catch (Exception e)
            {
                result.Message = e.Message;
                result.ResultStatus = -1;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:27,代碼來源:CashInStockDAL.cs

示例14: InsertOperateLog

        /// <summary>
        /// 添加操作記錄
        /// </summary>
        /// <param name="user">當前操作用戶</param>
        /// <param name="log">記錄實體</param>
        /// <param name="details">記錄明細列表</param>
        /// <returns></returns>
        public static ResultModel InsertOperateLog(UserModel user, OperateLogModel log, List<OperateLogDetailModel> details)
        {
            ResultModel result = new ResultModel();

            using (System.Transactions.TransactionScope scope = new System.Transactions.TransactionScope())
            {
                result = InsertOperateLog(user, log);
                if (result.ResultStatus != 0)
                    return result;

                foreach (OperateLogDetailModel m in details)
                {
                    result = InsertOperateLogDetail(user, m);
                    if (result.ResultStatus != 0)
                        return result;
                }

                scope.Complete();

                result.AffectCount = 1;
                result.Message = string.Format("操作記錄添加成功,明細共{0}條", details.Count);
                result.ResultStatus = 0;
                result.ReturnValue = 1;
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:34,代碼來源:OperateLogUtility.cs

示例15: ChangePwd

        public ResultModel ChangePwd(UserModel user, string oldPwd, string newPwd)
        {
            ResultModel result = new ResultModel();

            try
            {
                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))
                {
                    result = accountDAL.ValidatePwd(user, oldPwd);
                    if (result.ResultStatus != 0)
                        return result;

                    result = accountDAL.ChangePwd(user, newPwd);
                    if (result.ResultStatus != 0)
                        return result;

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                result.ResultStatus = -1;
                result.Message = ex.Message;
            }
            finally
            {
                if (result.ResultStatus != 0)
                    this.Log.ErrorFormat("{0} {1},序號:{2}", user.EmpName, result.Message, result.ReturnValue);
                else if (this.Log.IsInfoEnabled)
                    this.Log.InfoFormat("{0} {1},序號:{2}", user.EmpName, result.Message, result.ReturnValue);
            }

            return result;
        }
開發者ID:weiliji,項目名稱:NFMT,代碼行數:34,代碼來源:AccountBLL.cs


注:本文中的NFMT.Common.ResultModel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。