public ActionResult AddWork() { //獲取今天上班人員名字工號 List <CallName> CallName_Models = new List <Models.CallName>(); DateTime now = DateTime.Now; string today = now.Date.ToShortDateString(); DateTime start = Convert.ToDateTime(today.Trim() + " " + "00:00:00"); DateTime end = Convert.ToDateTime(today.Trim() + " " + "23:59:59"); var temp = attendanceService.CurrentDal.GetEntity(u => u.BU == UserBU && u.LINENAME == UserLINENAME && u.CLASS == UserCLASS && u.date1 > start && u.date1 < end && (u.state1 == "到" || u.state2 == "中途上班")).OrderBy(u => u.ID); foreach (Attendance ad in temp) { CallName cn = new CallName(); cn.ID = ad.ID; cn.NAME = ad.NAME; cn.STATE = ad.time1.ToString(); if (ad.time1 == null) { cn.STATE = "0"; } CallName_Models.Add(cn); } ViewData["CallName"] = CallName_Models; return(View()); }
public void Load(CallName name, bool append) { string path = string.Format(@"Security\Password\Templates\Calls\{0}.js", name.ToString()); string contents = JocysCom.ClassLibrary.Helper.FindResource <string>(path, GetType().Assembly); loadContents(contents, append); }
public ActionResult CallName(string id) { List <CallName> CallName_model = new List <CallName>(); //線長信息 string ID = UserID; var temp1 = staff.GetEntity(U => U.ID == ID); List <Staff> user = new List <Staff>(); foreach (Staff a in temp1) { user.Add(a); } ViewData["Users"] = user; //更改班別 //if (!string.IsNullOrEmpty(id)) { UserCLASS = id=="AM"?"白班":"晚班"; } // id有值是特殊情況 //判斷有沒有點過名 CallName_model = Common.JudgeCallName(UserBU, UserLINENAME, UserCLASS); if (CallName_model.Count() == 0) //沒點名就抓staff 表中的數據 默認全到 { //線員信息 var temp = staff.GetEntity(u => u.BU == UserBU && u.LINENAME == UserLINENAME && u.CLASS == UserCLASS); foreach (Staff s in temp) { CallName cn = new CallName(); cn.ID = s.ID; cn.NAME = s.NAME; cn.STATE = "到";//默認 CallName_model.Add(cn); } } ViewData["names"] = CallName_model; ViewData["CLASS"] = UserCLASS; return(View()); }
public ActionResult ZTBDYY() { List <CallName> CallName_Models = new List <Models.CallName>(); DateTime now = DateTime.Now; string today = now.Date.ToShortDateString(); DateTime start = Convert.ToDateTime(today.Trim() + " " + "00:00:00"); DateTime end = Convert.ToDateTime(today.Trim() + " " + "23:59:59"); var temp = attendanceService.CurrentDal.GetEntity(u => u.BU == UserBU && u.LINENAME == UserLINENAME && u.CLASS == UserCLASS && u.date1 > start && u.date1 < end && u.state2 == "中途離開"); foreach (Attendance ad in temp) { CallName cn = new CallName(); cn.ID = ad.ID; cn.NAME = ad.NAME; if (ad.state2 == null) { cn.STATE = ad.state1 == "到" ? "出勤" : "缺勤"; } else { cn.STATE = ad.reason2; } CallName_Models.Add(cn); } ViewData["CallName_Models"] = CallName_Models; return(View()); }
public Headers( int compatibilityLevel, CallName callName, SiteId siteId, Keys keys ) : this(compatibilityLevel, callName, siteId) { Keys = keys; }
/// <summary>Snippet for GetCall</summary> public void GetCallResourceNames() { // Snippet: GetCall(CallName, CallSettings) // Create client CallsClient callsClient = CallsClient.Create(); // Initialize request argument(s) CallName name = CallName.FromProjectCall("[PROJECT]", "[CALL]"); // Make the request Call response = callsClient.GetCall(name); // End snippet }
/// <summary>Snippet for GetCallAsync</summary> public async Task GetCallResourceNamesAsync() { // Snippet: GetCallAsync(CallName, CallSettings) // Additional: GetCallAsync(CallName, CancellationToken) // Create client CallsClient callsClient = await CallsClient.CreateAsync(); // Initialize request argument(s) CallName name = CallName.FromProjectCall("[PROJECT]", "[CALL]"); // Make the request Call response = await callsClient.GetCallAsync(name); // End snippet }
/// <summary>Snippet for GetCall</summary> public void GetCallRequestObject() { // Snippet: GetCall(GetCallRequest, CallSettings) // Create client CallsClient callsClient = CallsClient.Create(); // Initialize request argument(s) GetCallRequest request = new GetCallRequest { CallName = CallName.FromProjectCall("[PROJECT]", "[CALL]"), }; // Make the request Call response = callsClient.GetCall(request); // End snippet }
/// <summary>Snippet for ListRecordingsAsync</summary> public async Task ListRecordingsRequestObjectAsync() { // Snippet: ListRecordingsAsync(ListRecordingsRequest, CallSettings) // Create client RecordingsClient recordingsClient = await RecordingsClient.CreateAsync(); // Initialize request argument(s) ListRecordingsRequest request = new ListRecordingsRequest { ParentAsCallName = CallName.FromProjectCall("[PROJECT]", "[CALL]"), View = RecordingView.Unspecified, }; // Make the request PagedAsyncEnumerable <ListRecordingsResponse, Recording> response = recordingsClient.ListRecordingsAsync(request); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((Recording item) => { // Do something with each item Console.WriteLine(item); }); // Or iterate over pages (of server-defined size), performing one RPC per page await response.AsRawResponses().ForEachAsync((ListRecordingsResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Recording item in page) { // Do something with each item Console.WriteLine(item); } }); // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <Recording> singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (Recording item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
public async stt::Task CreateCallRequestObjectAsync() { moq::Mock <Calls.CallsClient> mockGrpcClient = new moq::Mock <Calls.CallsClient>(moq::MockBehavior.Strict); CreateCallRequest request = new CreateCallRequest { ParentAsProjectName = ProjectName.FromProject("[PROJECT]"), Call = new Call(), }; Call expectedResponse = new Call { CallName = CallName.FromProjectCall("[PROJECT]", "[CALL]"), To = "to03e2b601", From = "fromf8078ad9", IsPrivate = false, Labels = { { "key8a0b6e3c", "value60c16320" }, }, Transport = Call.Types.Transport.Sip, Direction = Call.Types.Direction.Incoming, ErrorCode = "error_code42bd958e", ErrorMessage = "error_messaged73952bd", Price = new gt::Money(), State = Call.Types.State.Busy, CreateTime = new wkt::Timestamp(), StartTime = new wkt::Timestamp(), RingTime = new wkt::Timestamp(), AnswerTime = new wkt::Timestamp(), EndTime = new wkt::Timestamp(), Bridged = true, OriginatingCall = "originating_call9e182b53", CreateMethod = Call.Types.CreateMethod.Api, Options = new Call.Types.ApiCallOptions(), }; mockGrpcClient.Setup(x => x.CreateCallAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Call>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CallsClient client = new CallsClientImpl(mockGrpcClient.Object, null); Call responseCallSettings = await client.CreateCallAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); Call responseCancellationToken = await client.CreateCallAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetCallAsync</summary> public async Task GetCallRequestObjectAsync() { // Snippet: GetCallAsync(GetCallRequest, CallSettings) // Additional: GetCallAsync(GetCallRequest, CancellationToken) // Create client CallsClient callsClient = await CallsClient.CreateAsync(); // Initialize request argument(s) GetCallRequest request = new GetCallRequest { CallName = CallName.FromProjectCall("[PROJECT]", "[CALL]"), }; // Make the request Call response = await callsClient.GetCallAsync(request); // End snippet }
public void GetCallResourceNames() { moq::Mock <Calls.CallsClient> mockGrpcClient = new moq::Mock <Calls.CallsClient>(moq::MockBehavior.Strict); GetCallRequest request = new GetCallRequest { CallName = CallName.FromProjectCall("[PROJECT]", "[CALL]"), }; Call expectedResponse = new Call { CallName = CallName.FromProjectCall("[PROJECT]", "[CALL]"), To = "to03e2b601", From = "fromf8078ad9", IsPrivate = false, Labels = { { "key8a0b6e3c", "value60c16320" }, }, Transport = Call.Types.Transport.Sip, Direction = Call.Types.Direction.Incoming, ErrorCode = "error_code42bd958e", ErrorMessage = "error_messaged73952bd", Price = new gt::Money(), State = Call.Types.State.Busy, CreateTime = new wkt::Timestamp(), StartTime = new wkt::Timestamp(), RingTime = new wkt::Timestamp(), AnswerTime = new wkt::Timestamp(), EndTime = new wkt::Timestamp(), Bridged = true, OriginatingCall = "originating_call9e182b53", CreateMethod = Call.Types.CreateMethod.Api, Options = new Call.Types.ApiCallOptions(), }; mockGrpcClient.Setup(x => x.GetCall(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CallsClient client = new CallsClientImpl(mockGrpcClient.Object, null); Call response = client.GetCall(request.CallName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for ListRecordings</summary> public void ListRecordingsResourceNames() { // Snippet: ListRecordings(CallName, string, int?, CallSettings) // Create client RecordingsClient recordingsClient = RecordingsClient.Create(); // Initialize request argument(s) CallName parent = CallName.FromProjectCall("[PROJECT]", "[CALL]"); // Make the request PagedEnumerable <ListRecordingsResponse, Recording> response = recordingsClient.ListRecordings(parent); // Iterate over all response items, lazily performing RPCs as required foreach (Recording item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (ListRecordingsResponse page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Recording item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <Recording> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (Recording item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
public ActionResult AddWeekWork() { List <CallName> CallName_Models = new List <Models.CallName>(); if (!Common.JudgeAddwork(UserBU, UserLINENAME, UserCLASS, "週末加班")) { //獲取今天上班人員名字工號 var temp = staff.GetEntity(u => u.BU == UserBU && u.LINENAME == UserLINENAME && u.CLASS == UserCLASS).OrderBy(u => u.ID); foreach (Staff ad in temp) { CallName cn = new CallName(); cn.ID = ad.ID; cn.NAME = ad.NAME; cn.STATE = "0"; CallName_Models.Add(cn); } ViewData["CallName"] = CallName_Models; } else { DateTime now6 = DateTime.Now.AddDays(1).Date; DateTime now7 = DateTime.Now.AddDays(2).Date; var temp6 = workOvertimeService.GetEntity(u => u.BU == UserBU && u.LINENAME == UserLINENAME && u.CLASS == UserCLASS && u.date1 == now6).OrderBy(u => u.ID); var temp7 = workOvertimeService.GetEntity(u => u.BU == UserBU && u.LINENAME == UserLINENAME && u.CLASS == UserCLASS && u.date1 == now7) .OrderBy(u => u.ID).Select(u => u.time1).ToList(); int number = 0; foreach (WorkOvertime wk in temp6) { CallName cn = new CallName(); cn.ID = wk.ID; cn.NAME = wk.NAME; cn.STATE = wk.time1.ToString(); cn.STATE1 = temp7[number].ToString(); number++; CallName_Models.Add(cn); } ViewData["CallName"] = CallName_Models; } return(View()); }
/// <summary> /// 判斷有沒有點過名 /// </summary> /// <param name="BU">部門</param> /// <param name="LINENAME">線別</param> /// <param name="CLASS">班別</param> /// <returns></returns> public List <CallName> JudgeCallName(string BU, string LINENAME, string CLASS) { List <CallName> CallName_Models = new List <CallName>(); DateTime now = DateTime.Now; string today = now.Date.ToShortDateString(); DateTime start = Convert.ToDateTime(today.Trim() + " " + "00:00:00"); DateTime end = Convert.ToDateTime(today.Trim() + " " + "23:59:59"); //string now1 = DateTime.Now.Date.ToString("yyyyMMdd"); var temp2 = attendanceService.CurrentDal.GetEntity(u => u.date1 > start && u.date1 < end && u.BU == BU && u.LINENAME == LINENAME && u.CLASS == CLASS); foreach (Attendance ad in temp2) { CallName cn = new CallName(); cn.ID = ad.ID; cn.NAME = ad.NAME; cn.STATE = ad.state1; CallName_Models.Add(cn); } return(CallName_Models); }
public Call(CallName name) { Load(name, false); }
public Headers(int compatibilityLevel, CallName callName, SiteId siteId) { CallName = callName; SiteId = siteId; CompatibilityLevel = compatibilityLevel; }
public Call(Context context, CallName callName) { Context = context; CallName = callName; StandardFields = new StandardFields(); }
public void Load(CallName name, bool append) { string path = string.Format(@"Security\Password\Templates\Calls\{0}.js", name.ToString()); string contents = Helper.FindResource<string>(GetType().Assembly, path); loadContents(contents, append); }