/// <summary> /// 添加新用户 /// </summary> /// <returns></returns> public bool AddCustomerInfo(CustomerInfoEntity accident) { bool isok = true; AdjDBObject adjdbobject = new AdjDBObject(); try { string cmdtext = "INSERT INTO dbo.D_CustomerInfo( CustomerId ,CustomerName ,RecommendCode ,Cellphone ,Email ,HomeAddress ,CustomerType ,AccountType ,IsNewCustomer ,LastCalledAddress ,Amount ,BusinessmanId ,create_time ,create_user,ParentPhone ) VALUES(@CustomerId ,@CustomerName ,@RecommendCode ,@Cellphone, @Email, @HomeAddress, @CustomerType ,@AccountType ,@IsNewCustomer, @LastCalledAddress, @Amount ,@BusinessmanId ,@create_time, @create_user,@ParentPhone )"; adjdbobject.GetSqlStringCommand(cmdtext); adjdbobject.AddInParameter("@CustomerId", DbType.String, accident.CustomerId); adjdbobject.AddInParameter("@CustomerName", DbType.String, accident.CustomerName); adjdbobject.AddInParameter("@RecommendCode", DbType.String, accident.RecommendCode); adjdbobject.AddInParameter("@Cellphone", DbType.String, accident.Cellphone); adjdbobject.AddInParameter("@ParentPhone", DbType.String, accident.ParentPhone); adjdbobject.AddInParameter("@Email", DbType.String, ""); adjdbobject.AddInParameter("@HomeAddress", DbType.String, accident.HomeAddress); adjdbobject.AddInParameter("@CustomerType", DbType.Int32, accident.CustomerType); adjdbobject.AddInParameter("@AccountType", DbType.Int32, accident.AccountType); adjdbobject.AddInParameter("@IsNewCustomer", DbType.Int32, accident.IsNewCustomer); adjdbobject.AddInParameter("@LastCalledAddress", DbType.String, accident.LastCalledAddress); adjdbobject.AddInParameter("@Amount", DbType.Decimal, accident.Amount); adjdbobject.AddInParameter("@BusinessmanId", DbType.Int32, accident.BusinessmanId); adjdbobject.AddInParameter("@create_time", DbType.DateTime, DateTime.Now); adjdbobject.AddInParameter("@create_user", DbType.String, "ThirdPartyAPI"); adjdbobject.Execute(); } catch (Exception ex) { isok = false; } return isok; }
public bool addCoupon(string couponsCode, double couponsValue, string partyid, CustomerInfoEntity ci) { AdjDBObject adjDbObject = new AdjDBObject(); StringBuilder sb = new StringBuilder(); sb.AppendLine("insert into d_youhui"); sb.AppendLine("(BatchId,cardcode,Money,Youhuima,Type,UseState,property,usecount,Remark ,Addtime,CREATE_USER,ExpiredDate,UsePeople,UserPeopleId,UserType)"); sb.AppendLine("values"); sb.AppendLine("(@BatchId,@cardcode,@Money,@Youhuima,@Type,@UseState,@property,@usecount,@Remark ,@Addtime,@CREATE_USER,@ExpiredDate,@UsePeople,@UserPeopleId,@UserType)"); adjDbObject.GetSqlStringCommand(sb.ToString()); adjDbObject.AddInParameter("@BatchId",System.Data.DbType.Int32,0); adjDbObject.AddInParameter("@cardcode", System.Data.DbType.String, couponsCode); adjDbObject.AddInParameter("@Money", System.Data.DbType.Decimal, couponsValue); adjDbObject.AddInParameter("@Youhuima", System.Data.DbType.String, couponsCode); adjDbObject.AddInParameter("@Type", System.Data.DbType.Int32, 0); adjDbObject.AddInParameter("@UseState", System.Data.DbType.Int32, 0); adjDbObject.AddInParameter("@property", System.Data.DbType.Int32, 20); adjDbObject.AddInParameter("@usecount", System.Data.DbType.Int32, 0); adjDbObject.AddInParameter("@Remark", System.Data.DbType.String, partyid); adjDbObject.AddInParameter("@Addtime", System.Data.DbType.DateTime, DateTime.Now); adjDbObject.AddInParameter("@CREATE_USER", System.Data.DbType.String, "Third Party"); adjDbObject.AddInParameter("@ExpiredDate", System.Data.DbType.DateTime, DateTime.Now.AddYears(1)); adjDbObject.AddInParameter("@UsePeople", System.Data.DbType.String, ""); adjDbObject.AddInParameter("@UserPeopleId", System.Data.DbType.String, ci.CustomerId); adjDbObject.AddInParameter("@UserType", System.Data.DbType.String, 1); return adjDbObject.Execute() > 0; }
/// <summary> /// 添加派单 /// </summary> /// <param name="model">派单实体</param> /// <returns></returns> public bool AddDistributeOrderInfo(DistributeOrderInfoEntity model) { AdjDBObject adjDbObject = new AdjDBObject(); bool isok = true; try { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into D_DistributeOrderInfo("); strSql.Append("PartyId,DistributeUser,Cellphone,Address,SuccessTime,Ucode,lng,lat,CustomerId,CustomerName,CustomerType,DistributeOrderId,AccountType,FromCellphone,AppointmentTime,create_time,create_user,update_time,update_user,delete_flag,delete_time,delete_user,AppointOrderId,OrderId,BusinessType,OrderFrom,OrderType,Status,DistributeUserType"); strSql.Append(") values ("); strSql.Append("@PartyId,@DistributeUser,@Cellphone,@Address,@SuccessTime,@Ucode,@lng,@lat,@CustomerId,@CustomerName,@CustomerType,@DistributeOrderId,@AccountType,@FromCellphone,@AppointmentTime,GETDATE(),@create_user,@update_time,@update_user,@delete_flag,@delete_time,@delete_user,@AppointOrderId,@OrderId,@BusinessType,@OrderFrom,@OrderType,@Status,@DistributeUserType"); strSql.Append(") "); adjDbObject.GetSqlStringCommand(strSql.ToString()); adjDbObject.AddInParameter("@partyId", DbType.String, model.PartyId); adjDbObject.AddInParameter("@DistributeUser", DbType.String, model.DistributeUser); adjDbObject.AddInParameter("@Cellphone", DbType.String, model.Cellphone); adjDbObject.AddInParameter("@Address", DbType.String, model.Address); adjDbObject.AddInParameter("@SuccessTime", DbType.DateTime, model.SuccessTime); adjDbObject.AddInParameter("@Ucode", DbType.String, model.Ucode); adjDbObject.AddInParameter("@lng", DbType.Decimal, model.Lng); adjDbObject.AddInParameter("@lat", DbType.Decimal, model.Lat); adjDbObject.AddInParameter("@CustomerId", DbType.String, model.CustomerId); adjDbObject.AddInParameter("@CustomerName", DbType.String, model.CustomerName); adjDbObject.AddInParameter("@CustomerType", DbType.Int32, model.CustomerType); adjDbObject.AddInParameter("@DistributeOrderId", DbType.String, model.DistributeOrderId); adjDbObject.AddInParameter("@AccountType", DbType.Int32, model.AccountType); adjDbObject.AddInParameter("@FromCellphone", DbType.String, model.Fromcellphone); adjDbObject.AddInParameter("@AppointmentTime", DbType.DateTime, model.AppointmentTime); adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user); adjDbObject.AddInParameter("@update_time", DbType.DateTime, model.Update_time); adjDbObject.AddInParameter("@update_user", DbType.String, model.Update_user); adjDbObject.AddInParameter("@delete_flag", DbType.Boolean, model.Delete_flag); adjDbObject.AddInParameter("@delete_time", DbType.DateTime, model.Delete_time); adjDbObject.AddInParameter("@delete_user", DbType.String, model.Delete_user); adjDbObject.AddInParameter("@AppointOrderId", DbType.String, model.AppointOrderId); adjDbObject.AddInParameter("@OrderId", DbType.String, model.OrderId); adjDbObject.AddInParameter("@BusinessType", DbType.Int32, model.BusinessType); adjDbObject.AddInParameter("@OrderFrom", DbType.Int32, model.OrderFrom); adjDbObject.AddInParameter("@OrderType", DbType.Int32, model.OrderType); adjDbObject.AddInParameter("@Status", DbType.Int32, model.Status); adjDbObject.AddInParameter("@DistributeUserType", DbType.Int32, model.DistributeUserType); adjDbObject.Execute(); } catch (Exception ex) { isok = false; } return isok; }
/// <summary> /// 添加预约 /// </summary> /// <param name="model">预约实体</param> /// <returns></returns> public bool AddAppointmentOrderInfo(AppointmentOrderInfoEntity model) { AdjDBObject adjDbObject = new AdjDBObject(); bool isok = true; try { adjDbObject.GetStoredProcCommand("sp3_D_AppointmentOrderInfo_i"); adjDbObject.AddOutParameter("@Id", DbType.Int32, 4); adjDbObject.AddInParameter("@AppointOrderId", DbType.String, model.AppointOrderId); adjDbObject.AddInParameter("@OrderId", DbType.String, model.OrderId); adjDbObject.AddInParameter("@AppointOrderType", DbType.Int32, model.AppointOrderType); adjDbObject.AddInParameter("@AppointOrderState", DbType.Int32, model.AppointOrderState); adjDbObject.AddInParameter("@BusinessType", DbType.Int32, model.BusinessType); adjDbObject.AddInParameter("@AppointOrderFrom", DbType.Int32, model.AppointOrderFrom); adjDbObject.AddInParameter("@CustomerId", DbType.String, model.CustomerId); adjDbObject.AddInParameter("@CustomerName", DbType.String, model.CustomerName); adjDbObject.AddInParameter("@CustomerType", DbType.Int32, model.CustomerType); adjDbObject.AddInParameter("@AccountType", DbType.Int32, model.AccountType); adjDbObject.AddInParameter("@Cellphone", DbType.String, model.Cellphone); adjDbObject.AddInParameter("@FromCellphone", DbType.String, model.FromCellphone); adjDbObject.AddInParameter("@AppointAddress", DbType.String, model.AppointAddress); adjDbObject.AddInParameter("@AppointTimeStr", DbType.String, model.AppointTimeStr); adjDbObject.AddInParameter("@AppointTime", DbType.DateTime, model.AppointTime); //adjDbObject.AddInParameter("@EstimateEndTime", DbType.DateTime, model.EstimateEndTime); adjDbObject.AddInParameter("@IsLock", DbType.Boolean, false); adjDbObject.AddInParameter("@LockUser", DbType.String, model.LockUser); adjDbObject.AddInParameter("@partyId", DbType.Int32, model.PartyId); adjDbObject.AddInParameter("@SendOrderUser", DbType.String, model.SendOrderUser); adjDbObject.AddInParameter("@AppointOrderSign", DbType.String, model.AppointOrderSign); adjDbObject.AddInParameter("@PhoneCallTime", DbType.Int32, model.PhoneCallTime); adjDbObject.AddInParameter("@lng", DbType.Double, model.Lng); adjDbObject.AddInParameter("@lat", DbType.Double, model.Lat); adjDbObject.AddInParameter("@create_time", DbType.DateTime, model.Create_time); adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user); //adjDbObject.AddInParameter("@update_time", DbType.DateTime, model.Update_time); // adjDbObject.AddInParameter("@update_user", DbType.String, model.Update_user); //adjDbObject.AddInParameter("@delete_time", DbType.DateTime, model.Delete_time); // adjDbObject.AddInParameter("@delete_user", DbType.String, model.Delete_user); // adjDbObject.AddInParameter("@delete_flag", DbType.Boolean, model.Delete_flag); adjDbObject.Execute(); } catch (Exception ex) { isok = false; } return isok; }
/// <summary> /// 新增一条投诉记录 /// </summary> /// <param name="complain"></param> /// <returns></returns> public int addComplain(D_OrderComplaint complain) { AdjDBObject db = new AdjDBObject(); StringBuilder sb = new StringBuilder(); sb.AppendLine("insert into D_OrderComplaint "); sb.AppendLine("(OrderId ,CustomerId,CustomerName,Cellphone,Ucode,DriverName,ComplaintType,ComplaintContent,create_time,create_user,delete_flag)"); sb.AppendLine("values"); sb.AppendLine("(@OrderId ,@CustomerId,@CustomerName,@Cellphone,@Ucode,@DriverName,1,@ComplaintContent,getdate(),@create_user,0)"); db.GetSqlStringCommand(sb.ToString()); db.AddInParameter("@OrderId",System.Data.DbType.String,complain.OrderId); db.AddInParameter("@CustomerId", System.Data.DbType.String, complain.CustomerId); db.AddInParameter("@CustomerName", System.Data.DbType.String, complain.CustomerName); db.AddInParameter("@Cellphone", System.Data.DbType.String, complain.Cellphone); db.AddInParameter("@Ucode", System.Data.DbType.String, complain.Ucode); db.AddInParameter("@DriverName", System.Data.DbType.String, complain.DriverName); db.AddInParameter("@ComplaintContent", System.Data.DbType.String, complain.ComplaintContent); db.AddInParameter("@create_user", System.Data.DbType.String, complain.CreateUser); return db.Execute(); }
public bool CreateDistributeOrderStatusChangeLog(DistributeOrderStatusChangeLogEntity model) { try { AdjDBObject adjDbObject = new AdjDBObject(); string sql = "INSERT INTO D_DistributeOrderStatusChangeLog(DistributeOrderId,Status,StatusText,create_time,create_user )VALUES(@DistributeOrderId,@Status,@StatusText,getdate(),@create_user )"; adjDbObject.GetSqlStringCommand(sql); adjDbObject.AddInParameter("@DistributeOrderId", DbType.String, model.DistributeOrderId); adjDbObject.AddInParameter("@Status", DbType.Int32, model.Status); adjDbObject.AddInParameter("@StatusText", DbType.String, model.StatusText); adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user); adjDbObject.Execute(); return true; } catch (Exception) { return false; } }
public bool AddParterDyLog(T_ParterDyLog model) { AdjDBObject adjDbObject = new AdjDBObject(); bool isok = true; try { adjDbObject.GetStoredProcCommand("sp3_T_ParterDyLog_i"); adjDbObject.AddOutParameter("@id", DbType.Int32, 4); adjDbObject.AddInParameter("@sign", DbType.String, model.sign); adjDbObject.AddInParameter("@typeid", DbType.Int32, model.typeid); adjDbObject.AddInParameter("@imei", DbType.String, model.imei); adjDbObject.AddInParameter("@lat", DbType.String, model.lat); adjDbObject.AddInParameter("@lng", DbType.String, model.lng); adjDbObject.AddInParameter("@addtime", DbType.DateTime, model.addtime); adjDbObject.Execute(); } catch (Exception ex) { isok = false; } return isok; }
/// <summary> /// 创建派单明细 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool CreateDistributeOrderDetail(DistributeOrderDetailEntity model) { try { AdjDBObject adjDbObject = new AdjDBObject(); StringBuilder strSql = new StringBuilder(); strSql.Append("insert into D_DistributeOrderDetail("); strSql.Append("delete_time,delete_user,DistributeOrderId,Status,Ucode,create_time,create_user,update_time,update_user,delete_flag"); strSql.Append(") values ("); strSql.Append("NULL,NULL,@DistributeOrderId,@Status,@Ucode,GETDATE(),@create_user,NULL,NULL,NULL"); strSql.Append(") "); adjDbObject.GetSqlStringCommand(strSql.ToString()); adjDbObject.AddInParameter("@DistributeOrderId", DbType.String, model.DistributeOrderId); adjDbObject.AddInParameter("@Status", DbType.Int32, model.Status); adjDbObject.AddInParameter("@Ucode", DbType.String, model.Ucode); adjDbObject.AddInParameter("@create_user", DbType.String, model.Create_user); adjDbObject.Execute(); return true; } catch (Exception) { return false; } }
public bool UpdateOnDoService(int OnDoService, string ucode) { bool isok = false; string sql = "UPDATE dbo.D_DriverInfo SET OnDOService = @OnDOService WHERE Ucode = @Ucode"; AdjDBObject adjDbObject = new AdjDBObject(); adjDbObject.GetSqlStringCommand(sql); adjDbObject.AddInParameter("@OnDOService", DbType.Int32, OnDoService); adjDbObject.AddInParameter("@Ucode", DbType.String, ucode); int i = adjDbObject.Execute(); if (i != 0) { isok = true; } return isok; }