|
@@ -16,7 +16,6 @@ using Unibase.Platform.Apps.Managers;
|
16
|
16
|
using Unibase.Platform.Data;
|
17
|
17
|
using Unibase.Platform.Forms.Providers;
|
18
|
18
|
using Unibase.Platform.Keys;
|
19
|
|
-using Unibase.Platform.Tenants.Localization;
|
20
|
19
|
|
21
|
20
|
namespace Bizgaze.CRM.Visitors.ActionProviders
|
22
|
21
|
{
|
|
@@ -69,9 +68,6 @@ namespace Bizgaze.CRM.Visitors.ActionProviders
|
69
|
68
|
var visitorManager = Unibase.Dependency.DependencyConfig.Resolve<Bizgaze.CRM.Visitors.Managers.IVisitorManager>();
|
70
|
69
|
var dictObj = obj as IDictionary<string, dynamic>;
|
71
|
70
|
var MobileNumber = dictObj["mobilenumber"].ToString();
|
72
|
|
- var employeeId = Convert.ChangeType(dictObj["employeeid"].ToString(), typeof(long));
|
73
|
|
- var cityId = Convert.ChangeType(dictObj["cityid"].ToString(), typeof(long));
|
74
|
|
- var purposeofvisit = Convert.ChangeType(dictObj["purposeofvisit"].ToString(), typeof(long));
|
75
|
71
|
long visitorid = 0;
|
76
|
72
|
var visitorsinfo = await visitorManager.VisitorsbyMobileNumberAsync(srequest, MobileNumber);
|
77
|
73
|
Int32 refstatusid = 0;
|
|
@@ -124,15 +120,15 @@ namespace Bizgaze.CRM.Visitors.ActionProviders
|
124
|
120
|
visitor.Add("contactid", contactid);
|
125
|
121
|
visitor.Add("code", visitorsinfo.Result.Code);
|
126
|
122
|
visitor.Add("agreement", true);
|
127
|
|
- visitor.Add("employeeid", employeeId);
|
|
123
|
+ visitor.Add("employeeid", visitorsinfo.Result.EmployeeId);
|
128
|
124
|
visitor.Add("seriesid", visitorsinfo.Result.SeriesId);
|
129
|
125
|
visitor.Add("stageid", visitorsinfo.Result.StageId);
|
130
|
126
|
visitor.Add("tenantid", visitorsinfo.Result.TenantId);
|
131
|
127
|
visitor.Add("installedappid", visitorsinfo.Result.Installedappid);
|
132
|
128
|
visitor.Add("fullname", visitorsinfo.Result.FullName);
|
133
|
129
|
visitor.Add("futureinvitation", visitorsinfo.Result.FutureInvitation);
|
134
|
|
- visitor.Add("cityid", cityId);
|
135
|
|
- visitor.Add("purposeofvisit", purposeofvisit);
|
|
130
|
+ visitor.Add("comingfrom", visitorsinfo.Result.ComingFrom);
|
|
131
|
+ visitor.Add("purposeofvisit", visitorsinfo.Result.PurposeOfVisit);
|
136
|
132
|
visitor.Add("title", visitorsinfo.Result.Title);
|
137
|
133
|
visitor.Add("visitortype", visitorsinfo.Result.VisitorType);
|
138
|
134
|
var response = await _repository.SaveAsync(request, vistoroptions, visitor);
|
|
@@ -176,31 +172,22 @@ namespace Bizgaze.CRM.Visitors.ActionProviders
|
176
|
172
|
var installedAppId = visitorsinfo.Result.Installedappid;
|
177
|
173
|
var stage = await stageManager.GetStageByStageStatusAsync(srequest, installedAppId, stageStatusName);
|
178
|
174
|
var NewStageId = stage.Result.StageId;
|
179
|
|
- DateTime date = DateTime.Now;
|
180
|
|
- var updateDate = new Dictionary<string, object>();
|
181
|
|
- // //updateDate.Add("employeeid", employeeId);
|
182
|
|
- // //updateDate.Add("cityid", cityId);
|
183
|
|
- //// updateDate.Add("typeofvisitor", 1);
|
184
|
|
- // updateDate.Add("stageid", NewStageId);
|
185
|
|
- // updateDate.Add("checkindate", date);
|
186
|
|
- // updateDate.Add("lastupdateddate", date);
|
187
|
|
- //// updateDate.Add("purposeofvisit", purposeofvisit);
|
188
|
|
- // var updateQry = new Update("bizgazecrm_visitors").Values(updateDate).Where(Exp.Eq("visitorid", visitorid));
|
189
|
|
- // var ds = await _repository.ExecuteAsync(request, updateQry);
|
190
|
|
- var UpdateStage = new Update("bizgazecrm_visitors").Value("stageid", NewStageId).Value("lastupdateddate", date).Where(Exp.Eq("code", code));
|
|
175
|
+ DateTime date = DateTime.UtcNow;
|
|
176
|
+ var UpdateStage = new Update("bizgazecrm_visitors").Value("employeeid", visitorsinfo.Result.EmployeeId).Value("stageid", NewStageId).Value("lastupdateddate", date).Where(Exp.Eq("code", code));
|
191
|
177
|
await _repository.ExecuteAsync(request, UpdateStage);
|
192
|
178
|
}
|
193
|
179
|
else
|
194
|
180
|
{
|
195
|
181
|
return ActionResponse<FormActionResponse>.CreateErrorResponse("1", "visitor Not Found");
|
196
|
182
|
}
|
|
183
|
+ returnresponse = new FormActionResponse();
|
|
184
|
+ returnresponse.Obj = dictObj as ExpandoObject;
|
197
|
185
|
returnresponse.PkValue = defaultPKValue;
|
198
|
186
|
return ActionResponse<FormActionResponse>.CreateSuccessResponse("success", returnresponse);
|
199
|
187
|
|
200
|
|
- //returnresponse = new FormActionResponse();
|
201
|
|
- //returnresponse.Obj = dictObj as ExpandoObject;
|
202
|
|
- //returnresponse.PkValue = defaultPKValue;
|
203
|
|
- //return ActionResponse<FormActionResponse>.CreateSuccessResponse("success", returnresponse);
|
|
188
|
+
|
|
189
|
+ // returnresponse.PkValue = defaultPKValue;
|
|
190
|
+ // return ActionResponse<FormActionResponse>.CreateSuccessResponse("success", returnresponse);
|
204
|
191
|
}
|
205
|
192
|
public List<UniqueKey> AppliedApps
|
206
|
193
|
{
|
|
@@ -214,4 +201,3 @@ namespace Bizgaze.CRM.Visitors.ActionProviders
|
214
|
201
|
|
215
|
202
|
}
|
216
|
203
|
}
|
217
|
|
-
|