コード例 #1
0
ファイル: PrepaidMaintOps.cs プロジェクト: dandytv/FleetOps
        public async Task <MsgRetriever> WebReloadAllocationMaint(DeliveryAdvice _Delivery, string Func)
        {
            var objDataEngine = new FleetDataEngine(AccessMode.CustomerService, DBType.Maint);

            objDataEngine.InitiateConnection();
            SqlParameter[] Parameters = new SqlParameter[13];
            Parameters[0]            = new SqlParameter("@IssNo", GetIssNo);
            Parameters[1]            = Func.ToLower() == "n" ? new SqlParameter("@TxnId", DBNull.Value) : new SqlParameter("@TxnId", ConvertIntToDb(_Delivery.TxnId));
            Parameters[2]            = new SqlParameter("@ParentTxnId", ConvertIntToDb(_Delivery.ParentTxnId));
            Parameters[3]            = String.IsNullOrEmpty(_Delivery.DocNo) ? new SqlParameter("@DocNo", DBNull.Value) : new SqlParameter("@DocNo", _Delivery.DocNo);
            Parameters[4]            = new SqlParameter("@AcctNo", _Delivery.AcctNo);
            Parameters[5]            = new SqlParameter("@TxnDate", ConvertDatetimeDB(_Delivery.TxnDate));
            Parameters[6]            = new SqlParameter("@TxnAmt", ConvertDecimalToDb(_Delivery.TxnAmt));
            Parameters[7]            = String.IsNullOrEmpty(_Delivery.EffDateFrom) ? new SqlParameter("@EffDateFrom", DBNull.Value) : new SqlParameter("@EffDateFrom", ConvertDatetimeDB(_Delivery.EffDateFrom));
            Parameters[8]            = string.IsNullOrEmpty(_Delivery.Remarks) ? new SqlParameter("@Remarks", DBNull.Value) : new SqlParameter("@Remarks", _Delivery.Remarks);
            Parameters[9]            = String.IsNullOrEmpty(_Delivery.SelectedStatus) ? new SqlParameter("@Sts", DBNull.Value) : new SqlParameter("@Sts", _Delivery.SelectedStatus);
            Parameters[10]           = new SqlParameter("@UserId", this.GetUserId);
            Parameters[11]           = new SqlParameter("@Func", Func);
            Parameters[12]           = new SqlParameter("@RETURN_VALUE", SqlDbType.BigInt);
            Parameters[12].Direction = ParameterDirection.ReturnValue;
            var Cmd    = objDataEngine.ExecuteWithReturnValue("[WebReloadAllocationMaint]", CommandType.StoredProcedure, Parameters);
            var Result = Convert.ToInt32(Cmd.Parameters["@RETURN_VALUE"].Value);
            var Descp  = GetMessageCode(Result);

            objDataEngine.CloseConnection();
            return(await Descp);
        }
コード例 #2
0
ファイル: PrepaidMaintOps.cs プロジェクト: dandytv/FleetOps
        public DeliveryAdvice WebReloadAllocationSelect(int TxnId, string AcctNo)
        {
            var objDataEngine = new FleetDataEngine(AccessMode.CustomerService, DBType.Maint);

            objDataEngine.InitiateConnection();
            SqlParameter[] Parameters = new SqlParameter[2];
            Parameters[0] = new SqlParameter("@IssNo", GetIssNo);
            Parameters[1] = new SqlParameter("@TxnId", TxnId);
            var Reader = objDataEngine.ExecuteCommand("WebReloadAllocationSelect", CommandType.StoredProcedure, Parameters);

            while (Reader.Read())
            {
                var _DeliveryAdvice = new DeliveryAdvice
                {
                    DocNo          = Convert.ToString(Reader["DocNo"]),
                    AcctNo         = Convert.ToInt64(Reader["AcctNo"]),
                    Remarks        = Convert.ToString(Reader["Remarks"]),
                    TxnDate        = DateConverter(Reader["TxnDate"]),
                    EffDateFrom    = DateConverter(Reader["EffDateFrom"]),
                    SelectedStatus = Convert.ToString(Reader["Sts"]),
                    TxnAmt         = ConverterDecimal(Reader["DAAmt"]),
                    TxnId          = ConvertInt(Reader["TxnId"]),
                    ParentTxnId    = Convert.ToString(Reader["ParentTxnId"]),
                    CreatedBy      = Convert.ToString(Reader["CreatedBy"]),
                    CreationDate   = DateConverter(Reader["CreationDate"]),
                    UserId         = Convert.ToString(Reader["UserId"])
                };
                return(_DeliveryAdvice);
            }
            return(new DeliveryAdvice());
        }