| | |
| | | using CY.Model; |
| | | using CY.Infrastructure.Query; |
| | | using System.Transactions; |
| | | using CY.Model.Inquiry; |
| | | using CY.Infrastructure.Common; |
| | | |
| | | namespace CY.SQLDAL |
| | | { |
| | |
| | | { |
| | | unitPricePar = new SqlParameter("@UnitPrice", DBNull.Value); |
| | | } |
| | | SqlParameter DeliveryTime = null; |
| | | if (trueModel.DeliveryTime.HasValue) |
| | | { |
| | | DeliveryTime = new SqlParameter("@DeliveryTime", trueModel.DeliveryTime); |
| | | } |
| | | else |
| | | { |
| | | DeliveryTime = new SqlParameter("@DeliveryTime", DBNull.Value); |
| | | } |
| | | IList<SqlParameter> sqlParms = new List<SqlParameter>() |
| | | { |
| | | new SqlParameter(){ ParameterName ="@Keyid", SqlDbType=System.Data.SqlDbType.Int, DbType=System.Data.DbType.Int32, Direction=ParameterDirection.Output}, |
| | |
| | | new SqlParameter("@OrderTypeId",trueModel.OrderTypeId), |
| | | new SqlParameter("@PrintTypeId",trueModel.PrintTypeId), |
| | | new SqlParameter("@DocumentName",trueModel.DocumentName), |
| | | new SqlParameter("@DeliveryTime",trueModel.DeliveryTime), |
| | | DeliveryTime,//new SqlParameter("@DeliveryTime",trueModel.DeliveryTime), |
| | | new SqlParameter("@SellerId",trueModel.SellerId), |
| | | new SqlParameter("@BuyerId",trueModel.BuyerId), |
| | | new SqlParameter("@SellerName",trueModel.SellerName){SqlDbType=SqlDbType.VarChar,Size=200}, |
| | |
| | | { |
| | | unitPricePar = new SqlParameter("@UnitPrice", DBNull.Value); |
| | | } |
| | | SqlParameter DeliveryTime = null; |
| | | if (trueModel.DeliveryTime.HasValue) |
| | | { |
| | | DeliveryTime = new SqlParameter("@DeliveryTime", trueModel.DeliveryTime); |
| | | } |
| | | else |
| | | { |
| | | DeliveryTime = new SqlParameter("@DeliveryTime", DBNull.Value); |
| | | } |
| | | |
| | | |
| | | IList<SqlParameter> sqlParms = new List<SqlParameter>() |
| | | { |
| | |
| | | new SqlParameter("@SellerId",trueModel.SellerId), |
| | | new SqlParameter("@SellerName",trueModel.SellerName), |
| | | new SqlParameter("@DocumentName",trueModel.DocumentName), |
| | | new SqlParameter("@DeliveryTime",trueModel.DeliveryTime), |
| | | unitPricePar, |
| | | DeliveryTime,//new SqlParameter("@DeliveryTime",trueModel.DeliveryTime), |
| | | unitPricePar, |
| | | new SqlParameter("@SumPrice",trueModel.SumPrice), |
| | | new SqlParameter("@PayState",trueModel.PayState), |
| | | new SqlParameter("@Operator",trueModel.Operator), |
| | |
| | | else |
| | | { |
| | | } |
| | | StringBuilder ssss = new StringBuilder(); |
| | | if (int.Parse(searchParam[18].ToString()) > 0) |
| | | { |
| | | var oA_Staffs = _dataBase.SelectModel<OA_Staff>(" * ", " [OA_Staff] ", "[Keyid]='" + searchParam[20] + "'").FirstOrDefault(); |
| | | |
| | | |
| | | if (!string.IsNullOrEmpty(oA_Staffs.ManageCountry)) |
| | | { |
| | | var sys_CitySites = _dataBase.SelectModel<Sys_CitySite>(" * ", " [Sys_CitySite] ").ToList(); |
| | | |
| | | |
| | | |
| | | var ManageCity = oA_Staffs.ManageCity.Split(',').Where(x => x != "").ToArray(); |
| | | |
| | | |
| | | var ManageCountry = (oA_Staffs.ManageCountry + "," + oA_Staffs.ManageCountry1).Split(',').Where(x => x != "").ToArray(); |
| | | |
| | | int[] intManageCity = new int[ManageCity.Length]; |
| | | for (int i = 0; i < ManageCity.Length; i++) |
| | | { |
| | | intManageCity[i] = int.Parse(ManageCity[i]); |
| | | } |
| | | |
| | | int[] intManageCountry = new int[ManageCountry.Length]; |
| | | for (int i = 0; i < ManageCountry.Length; i++) |
| | | { |
| | | intManageCountry[i] = int.Parse(ManageCountry[i]); |
| | | } |
| | | var city = sys_CitySites.Where(x => intManageCity.Contains(x.Keyid)).ToList(); |
| | | var country = sys_CitySites.Where(x => intManageCountry.Contains(x.Keyid)).ToList(); |
| | | |
| | | StringBuilder citystring = new StringBuilder(); |
| | | for (int i = 0; i < city.Count; i++) |
| | | { |
| | | if (i == city.Count - 1) |
| | | { |
| | | citystring.Append("'" + city[i].Name.ToString() + "'"); |
| | | } |
| | | else |
| | | { |
| | | citystring.Append("'" + city[i].Name.ToString() + "',"); |
| | | } |
| | | |
| | | } |
| | | |
| | | StringBuilder countrystring = new StringBuilder(); |
| | | for (int i = 0; i < country.Count; i++) |
| | | { |
| | | if (i == country.Count - 1) |
| | | { |
| | | countrystring.Append("'" + country[i].Name.ToString() + "'"); |
| | | } |
| | | else |
| | | { |
| | | countrystring.Append("'" + country[i].Name.ToString() + "',"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | var resultsss = _dataBase.SelectModel<OA_CorporateClients>(" axz.* ", " [OA_CorporateClients] axz join [OA_CustomerCommunications] bxz on axz.Keyid=bxz.Keyid ", " axz.FirmId ='" + searchParam[1] + "'and ( ( bxz.City in ( " + citystring.ToString() + ") and bxz.County in ( " + countrystring.ToString() + " ) )or axz.AccountManagerId='" + searchParam[20] + "' or axz.BusinessManagerId='" + searchParam[20] + "')").Select(x => x.Keyid).ToList(); |
| | | //return null == result || result.Count < 1 ? null : result[0]; |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < resultsss.Count; i++) |
| | | { |
| | | if (i == resultsss.Count - 1) |
| | | { |
| | | ssss.Append("'" + resultsss[i].ToString() + "'"); |
| | | } |
| | | else |
| | | { |
| | | ssss.Append("'" + resultsss[i].ToString() + "',"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | var resultsss = _dataBase.SelectModel<OA_CorporateClients>(" axz.* ", " [OA_CorporateClients] axz join [OA_CustomerCommunications] bxz on axz.Keyid=bxz.Keyid ", " axz.FirmId ='" + searchParam[1] + "'and ( axz.AccountManagerId='" + searchParam[20] + "' or axz.BusinessManagerId='" + searchParam[20] + "')").Select(x => x.Keyid).ToList(); |
| | | //return null == result || result.Count < 1 ? null : result[0]; |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < resultsss.Count; i++) |
| | | { |
| | | if (i == resultsss.Count - 1) |
| | | { |
| | | ssss.Append("'" + resultsss[i].ToString() + "'"); |
| | | } |
| | | else |
| | | { |
| | | ssss.Append("'" + resultsss[i].ToString() + "',"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(ssss.ToString())) |
| | | { |
| | | ssss.Append("'4354654657568345429890'"); |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | | var resultsss = _dataBase.SelectModel<OA_CorporateClients>(" axz.* ", " [OA_CorporateClients] axz ", " axz.FirmId ='" + searchParam[1] + "' ").Select(x => x.Keyid).ToList(); |
| | | //return null == result || result.Count < 1 ? null : result[0]; |
| | | |
| | | |
| | | |
| | | for (int i = 0; i < resultsss.Count; i++) |
| | | { |
| | | if (i == resultsss.Count - 1) |
| | | { |
| | | ssss.Append("'" + resultsss[i].ToString() + "'"); |
| | | } |
| | | else |
| | | { |
| | | ssss.Append("'" + resultsss[i].ToString() + "',"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | IList<SqlParameter> sqlParms = new List<SqlParameter>() |
| | | { |
| | |
| | | Direction = ParameterDirection.Output |
| | | }); |
| | | |
| | | sqlParms.Add(new SqlParameter() |
| | | { |
| | | ParameterName = "@CorporateClientsId", |
| | | SqlDbType = SqlDbType.VarChar, |
| | | Size=int.MaxValue, |
| | | Value = ssss.ToString() |
| | | }); |
| | | |
| | | IList<EC_OrderBasic> result = null; |
| | | //执行分页存储 |
| | | using (IDataReader reader = _dataBase.QueryDataReader("sp_EC_OrderBasic_Search_Seller", CommandType.StoredProcedure, sqlParms.ToArray())) |
| | | using (IDataReader reader = _dataBase.QueryDataReader("sp_EC_OrderBasic_Search_Seller_Ceshi", CommandType.StoredProcedure, sqlParms.ToArray())) |
| | | { |
| | | result = _dataBase.ReadDataToModel<EC_OrderBasic>(reader); |
| | | } |
| | | if (result != null && result.Count > 0) |
| | | { |
| | | _eC_OrderPrintParameterDAL = new EC_OrderPrintParameterDAL(_dataBase); |
| | | foreach (EC_OrderBasic ob in result) |
| | | { |
| | | if (IsComplainant(ob.Keyid.Value)) |
| | | { |
| | | ob.IsComplainant = true; |
| | | } |
| | | |
| | | EC_OrderPrintParameter _eC_OrderPrintParameter = _eC_OrderPrintParameterDAL.GetModel(ob.Keyid.Value); |
| | | InquiryCommonModel _inquiryCommonModel = null; |
| | | if (null == _eC_OrderPrintParameter) |
| | | { |
| | | _inquiryCommonModel = new InquiryCommonModel(); |
| | | } |
| | | else |
| | | { |
| | | _inquiryCommonModel = SerializationHelper.DeSerialize(typeof(InquiryCommonModel), _eC_OrderPrintParameter.PrintParameter) as InquiryCommonModel; |
| | | } |
| | | |
| | | ob.PrintSizeName = _inquiryCommonModel.PrintSizeName; |
| | | } |
| | | } |
| | | /*获取页数与返回数据条数*/ |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 锁单订单 |
| | | /// </summary> |
| | | /// <param name="orderId">订单编号</param> |
| | | /// <param name="operater">操作人</param> |
| | | /// <returns></returns> |
| | | public bool SuodingOrder(int orderId, string operater) |
| | | { |
| | | if (0 >= orderId || 0 >= orderId) |
| | | { |
| | | return false; |
| | | } |
| | | else |
| | | { |
| | | } |
| | | |
| | | IList<SqlParameter> sqlParms = new List<SqlParameter>() |
| | | { |
| | | |
| | | new SqlParameter("@SuodanState",true), |
| | | new SqlParameter("@SuodanTime",DateTime.Now), |
| | | new SqlParameter("@SuodanOperator",operater), |
| | | new SqlParameter("@Keyid",orderId), |
| | | }; |
| | | IList<SqlParameter> sqlParms1 = new List<SqlParameter>() |
| | | { |
| | | new SqlParameter("@Keyid",orderId), |
| | | }; |
| | | try |
| | | { |
| | | string sql = "Update EC_OrderBasic Set [SuodanState]=@SuodanState,[SuodanTime]=@SuodanTime,[SuodanOperator]=@SuodanOperator where [Keyid] =@Keyid "; |
| | | _dataBase.ExecuteSql(sql, sqlParms.ToArray<SqlParameter>()); |
| | | |
| | | string sql1 = "Update CoreCmsPlanOrder Set [status]=2 where [orderkeyid] =@Keyid "; |
| | | _dataBase.ExecuteSql(sql1, sqlParms1.ToArray<SqlParameter>()); |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 批量受理订单 |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | return null == result || result.Count == 0 ? null : result[0]; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 根据订单编号获取订单 |
| | | /// </summary> |
| | | /// <param name="orderIds">订单编号</param> |
| | | /// <returns></returns> |
| | | public IEnumerable<EC_OrderBasic> GetOrderByIds(string orderIds) |
| | | { |
| | | //return _eC_OrderBasicDAL.SelectModelById(orderId); |
| | | IList<EC_OrderBasic> result = _dataBase.SelectModel<EC_OrderBasic>(" ob.*,ts.OnlineMoney,ts.LineMoney,ts.UsedCredit,ts.PayedMoney ", "EC_OrderBasic as ob Inner Join Pay_TradingSingle as ts On ( ob.Keyid = ts.OrderId ) ", string.Format(" ob.Keyid in ({0})", orderIds)); |
| | | return null == result || result.Count < 1 ? null : result; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// 修改打印状态 |
| | | /// </summary> |
| | | /// <param name="orderId"></param> |
| | | public void UpdatePrintfengqianState(int orderId) |
| | | { |
| | | try |
| | | { |
| | | string sqlStr = string.Empty; |
| | | sqlStr = "UPDATE EC_OrderExtend SET IsPrintfengqian='true' WHERE Keyid=@orderId"; |
| | | SqlParameter par = new SqlParameter("@orderId", orderId); |
| | | _dataBase.ExecuteSql(sqlStr, par); |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改打印状态 |
| | | /// </summary> |
| | | /// <param name="orderId"></param> |
| | | public void UpdatePrintBiaoqianState(int orderId) |
| | | { |
| | | try |