Exemplo n.º 1
0
        public static string FormatAuthUrl(
            string loginUrl,
            ResponseTypes responseType,
            string clientId,
            string redirectUrl,
            DisplayTypes display = DisplayTypes.Page,
            bool immediate       = false,
            string scope         = "")
        {
            if (string.IsNullOrEmpty(loginUrl))
            {
                throw new ArgumentNullException("loginUrl");
            }
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }
            if (string.IsNullOrEmpty(redirectUrl))
            {
                throw new ArgumentNullException("redirectUrl");
            }

            var url =
                string.Format(
                    "{0}?response_type={1}&client_id={2}&redirect_uri={3}&display={4}&immediate={5}&scope={6}",
                    loginUrl,
                    responseType.ToString().ToLower(),
                    clientId,
                    redirectUrl,
                    display.ToString().ToLower(),
                    immediate,
                    scope);

            return(url);
        }
Exemplo n.º 2
0
        public static string FormatAuthUrl(
            string loginUrl,
            ResponseTypes responseType,
            string clientId,
            string redirectUrl,
            DisplayTypes display = DisplayTypes.Page,
            bool immediate = false,
            string state = "",
            string scope = "")
        {
            if (string.IsNullOrEmpty(loginUrl)) throw new ArgumentNullException("loginUrl");
            if (string.IsNullOrEmpty(clientId)) throw new ArgumentNullException("clientId");
            if (string.IsNullOrEmpty(redirectUrl)) throw new ArgumentNullException("redirectUrl");
            //TODO: check ensure that redirectUrl is a valid URI

            var url =
            string.Format(
                "{0}?response_type={1}&client_id={2}&redirect_uri={3}&display={4}&immediate={5}&state={6}&scope={7}",
                loginUrl,
                responseType.ToString().ToLower(),
                clientId,
                redirectUrl,
                display.ToString().ToLower(),
                immediate,
                state,
                scope);

            return url;
        }
        public ActionResult ExportHistory()
        {
            string                  xlsName     = string.Format("History_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss"));
            HistoryQuery            query       = HistoryQueryUtility.GetHistoryQuery(base.Request);
            int                     recordCount = 0;
            IList <VwWafer_History> list        = historyService.HistoryList(query, 0xf423f, 0, out recordCount);

            if (list != null && list.Count > 0)
            {
                foreach (VwWafer_History history in list)
                {
                    if (history.IsVendor)
                    {
                        history.DisposeText = "Confirmed";
                    }
                    else
                    {
                        history.DisposeText = WaferHelper.WaferSelectionDes(history.Dispose);
                    }
                }
            }
            string        nextUrl     = Exporthelper.GetExport <VwWafer_History>("Historys", list, "/Export/Excels/History/", "/Content/Exports/ExportHistory.xml", xlsName, 0, 0);
            ResponseTypes redirect    = ResponseTypes.Redirect;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
Exemplo n.º 4
0
        public static string FormatAuthUrl(
            string loginUrl,
            ResponseTypes responseType,
            string clientId,
            string redirectUrl,
            DisplayTypes display = DisplayTypes.Page,
            bool immediate       = false,
            string state         = "",
            string scope         = "")
        {
            if (string.IsNullOrEmpty(loginUrl))
            {
                throw new ArgumentNullException(nameof(loginUrl));
            }
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException(nameof(clientId));
            }
            if (string.IsNullOrEmpty(redirectUrl))
            {
                throw new ArgumentNullException(nameof(redirectUrl));
            }

            return
                ($"{loginUrl}?response_type={responseType.ToString().ToLower()}" +
                 $"&client_id={clientId}" +
                 $"&redirect_uri={redirectUrl}" +
                 $"&display={display.ToString().ToLower()}" +
                 $"&immediate={immediate}" +
                 $"&state={state}" +
                 $"&scope={scope}");
        }
Exemplo n.º 5
0
        public ActionResult ExportData(Lot_TransformedQuery query)
        {
            int    recordCount = 0;
            string xlsName     = string.Format("Transform_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss"));

            if (StringHelper.isNullOrEmpty(query.OrderBy))
            {
                query.OrderBy   = "CreateDate";
                query.OrderDesc = true;
            }
            if (CurrentUserInfo.Role == UserRoles.Fab || CurrentUserInfo.Role == UserRoles.FabAdmin)
            {
                query.Osat   = CurrentUserInfo.BUName;
                query.Status = (int)WaferStatus.WaitVendor;
            }
            IList <Lot_Transformed> list = service.GetAllLots(query, 0xf423f, 0, out recordCount);

            if (list != null && list.Count > 0)
            {
                foreach (Lot_Transformed lot in list)
                {
                    lot.StatusText = WaferHelper.waferStatusDes(lot.Status);
                }
            }
            string        nextUrl     = Exporthelper.GetExport <Lot_Transformed>("LOTS", list, "/Export/Excels/Transform/", "/Content/Exports/ExportTransform.xml", xlsName, 0, 0);
            ResponseTypes redirect    = ResponseTypes.Redirect;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
        public async Task <IList <EvdsCurrencyRating> > GetListByCodeAndDate(string[] currencyCodes, string operationType, DateTime startDate, DateTime?endDate = null, ResponseTypes responseType = ResponseTypes.Json)
        {
            HttpClient client             = new HttpClient();
            var        currencySerieCodes = currencyCodes.Select(m => m = StringHelper.SerieCodeGenerator(m, operationType)).ToArray();
            var        uri = Options.Host + Options.Path
                             + "series=" + string.Join("-", currencySerieCodes)
                             + "&startDate=" + startDate.ToString("dd-MM-yyyy")
                             + "&endDate=" + (endDate.HasValue ? endDate.Value.ToString("dd-MM-yyyy") : startDate.ToString("dd-MM-yyyy"))
                             + "&type=" + responseType.ToString().ToLower()
                             + "&key=" + Options.ApiKey;

            HttpResponseMessage response = await client.GetAsync(uri);

            string contentString = await response.Content.ReadAsStringAsync();

            if (string.IsNullOrEmpty(contentString))
            {
                return(new List <EvdsCurrencyRating>());
            }
            var parsedJson      = JObject.Parse(contentString);
            var serieRatingData = parsedJson.SelectToken("items").Children <JObject>();

            IList <EvdsCurrencyRating> serieRatingList = new List <EvdsCurrencyRating>();
            EvdsCurrencyRating         newSerieRating  = new EvdsCurrencyRating();

            foreach (var item in serieRatingData)
            {
                var dateValue = item.Properties().FirstOrDefault(m => m.Name == "Tarih").Value.ToString();

                foreach (var property in item.Properties())
                {
                    var regularPropertyName = property.Name.Replace("_", ".");
                    var currentCurrency     = currencySerieCodes.FirstOrDefault(m => m == regularPropertyName);
                    if (currentCurrency != null)
                    {
                        newSerieRating = new EvdsCurrencyRating();
                        newSerieRating.CurrencyCode  = currentCurrency;
                        newSerieRating.OperationType = operationType;

                        newSerieRating.Date      = DateTime.ParseExact(dateValue, "dd-MM-yyyy", CultureInfo.InvariantCulture);
                        newSerieRating.SerieCode = regularPropertyName;
                        newSerieRating.Rating    = (decimal?)property.Value;

                        serieRatingList.Add(newSerieRating);
                    }
                }
            }

            return(serieRatingList);
        }
Exemplo n.º 7
0
        public async Task <IList <EvdsCurrency> > GetList(ResponseTypes responseType = ResponseTypes.Json)
        {
            HttpClient client = new HttpClient();

            var uri = Options.Host + Options.Path
                      + "serieList/"
                      + "&key=" + Options.ApiKey
                      + "&type=" + responseType.ToString().ToLower()
                      + "&code=" + DataGroup.bie_dkdovizgn;

            HttpResponseMessage response = await client.GetAsync(uri);

            string contentString = await response.Content.ReadAsStringAsync();

            return(JsonConvert.DeserializeObject <List <EvdsCurrency> >(contentString));
        }
Exemplo n.º 8
0
        public ActionResult ExportLots(string orderBy, bool desc)
        {
            int    recordCount = 0;
            string xlsName     = string.Format("LOTS_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss"));

            if (StringHelper.isNullOrEmpty(orderBy))
            {
                orderBy = "CreateTime";
                desc    = true;
            }
            IList <LotView> tList       = LotService.GetLotViews(QueryUtility.GetQueryFromRequest(base.Request, BaseController.CurrentUserInfo.UserID), orderBy, desc, 0, 0xf423f, out recordCount);
            string          nextUrl     = Exporthelper.GetExport <LotView>("LOTS", tList, "/Export/Excels/Lots/", "/Content/Exports/ExportLots.xml", xlsName, 0, 0);
            ResponseTypes   redirect    = ResponseTypes.Redirect;
            TipTypes        information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
Exemplo n.º 9
0
        public ActionResult ExportSwbin(string lotID, string code, string defect, string qty, string failRate, string isPassed, string limited, string orderBy, bool desc = false)
        {
            int     recordCount    = 0;
            LotView lotViewByLotID = LotService.GetLotViewByLotID(lotID);

            if (StringHelper.isNullOrEmpty(orderBy))
            {
                orderBy = "Code";
            }
            desc = false;
            string        xlsName     = "LOT_" + lotViewByLotID.LotNO + "_SWBin";
            IList <SWBin> tList       = LotService.GetSWBinsBy(lotID, code, defect, qty, failRate, isPassed, limited, orderBy, desc, 0, 0x1869f, out recordCount);
            string        nextUrl     = Exporthelper.GetExport <SWBin>("SW Bin", tList, "/Export/Excels/Swbins/", "/Content/Exports/ExportSwbins.xml", xlsName, 0, 0);
            ResponseTypes redirect    = ResponseTypes.Redirect;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
Exemplo n.º 10
0
        public ActionResult ExportData()
        {
            WaferQuery query       = WaferQueryUtility.GetWaferQuery(base.Request);
            int        recordCount = 0;
            string     xlsName     = string.Format("Wafer_{0}", DateTime.Now.ToString("yyyyMMdd_hhmmss"));

            if (StringHelper.isNullOrEmpty(query.OrderBy))
            {
                query.OrderBy   = "CreateDate";
                query.OrderDesc = true;
            }
            if (CurrentUserInfo.Role == UserRoles.Fab || CurrentUserInfo.Role == UserRoles.FabAdmin)
            {
                query.Osat   = CurrentUserInfo.BUName;
                query.Status = (int)WaferStatus.WaitVendor;
            }
            IList <Wafer> list = service.GetAllWaferBy(query, 0xf423f, 0, out recordCount);

            if (list != null && list.Count > 0)
            {
                foreach (Wafer item in list)
                {
                    item.StatusText       = WaferHelper.waferStatusDes(item.Status);
                    item.PEDisposeText    = WaferHelper.WaferSelectionDes(item.PEDispose);
                    item.QADisposeText    = WaferHelper.WaferSelectionDes(item.QADispose);
                    item.SPRDDecisionText = WaferHelper.WaferSelectionDes(item.SPRDDecision);
                }
            }
            string path = "/Export/Excels/Wafer/";
            string mp   = Server.MapPath("~") + path;

            if (!Directory.Exists(mp))
            {
                Directory.CreateDirectory(mp);
            }
            string        nextUrl     = Exporthelper.GetExport <Wafer>("LOTS", list, "/Export/Excels/Wafer/", "/Content/Exports/ExportWafer.xml", xlsName, 0, 0);
            ResponseTypes redirect    = ResponseTypes.Redirect;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "导出Excel文件", redirect.ToString(), information.ToString(), nextUrl, "", "").GenerateJsonResponse());
            return(null);
        }
Exemplo n.º 11
0
        public static string FormatAuthorizeUrl(
            ResponseTypes responseType,
            string clientId,
            string redirectUrl,
            string state = "",
            string scope = "")
        {
            if (string.IsNullOrEmpty(clientId))
            {
                throw new ArgumentNullException("clientId");
            }
            if (string.IsNullOrEmpty(redirectUrl))
            {
                throw new ArgumentNullException("redirectUrl");
            }

            var url =
                string.Format(
                    "{0}?response_type={1}&client_id={2}&redirect_uri={3}",
                    _authorizeUrl,
                    responseType.ToString().ToLower(),
                    clientId,
                    redirectUrl);

            if (!string.IsNullOrEmpty(state))
            {
                url += string.Format("state={0}", state);
            }

            if (!string.IsNullOrEmpty(scope))
            {
                url += string.Format("scope={0}", scope);
            }

            return(url);
        }
        public ActionResult SaveDecision()
        {
            string code         = string.Empty;
            string message      = string.Empty;
            string str3         = string.Empty;
            int    dispose      = -1;
            Lot    lotByLotID   = LotService.GetLotByLotID(base.Request.Form["lotID"]);
            int    lastDecision = lotByLotID.LastDecision;

            switch (BaseController.CurrentUserInfo.Role)
            {
            case UserRoles.OSAT:
            case UserRoles.OSATAdmin:
            {
                string   str6      = base.Request.Form["chkConfirmedValue"];
                char[]   separator = new char[] { ',' };
                string[] strArray  = str6.Split(separator);
                if ((str6.Length <= 0) || (lotByLotID.SPRDDecision == 0xff))
                {
                    code    = "1";
                    message = "Confirm failed because the lot status changed.";
                }
                else
                {
                    NotificationService.ClearNotificationsByOSATIDAndLotID(lotByLotID.VenderID, lotByLotID.LotID);
                    foreach (string str7 in strArray)
                    {
                        if (!(str7 == "0"))
                        {
                            if (str7 == "1")
                            {
                                lotByLotID.VenderConfirmed   = true;
                                lotByLotID.VenderConfirmTime = DateTime.Now;
                            }
                            else if (str7 == "2")
                            {
                                lotByLotID.VenderConfirmed   = true;
                                lotByLotID.VenderConfirmTime = DateTime.Now;
                                str3 = "Confirm Rescreen";
                            }
                            else if (str7 == "3")
                            {
                                lotByLotID.VenderConfirmed   = true;
                                lotByLotID.VenderConfirmTime = DateTime.Now;
                                str3 = "Confirm Scrap";
                            }
                            else if (str7 == "5")
                            {
                                lotByLotID.OtherBinDisposeConfirmed   = true;
                                lotByLotID.OtherBinDisposeConfirmTime = DateTime.Now;
                            }
                        }
                        else
                        {
                            lotByLotID.VenderConfirmed   = true;
                            lotByLotID.VenderConfirmTime = DateTime.Now;
                            str3 = "Confirm Release";
                        }
                    }
                    if (str6.Contains("1") && str6.Contains("5"))
                    {
                        str3 = "Confirm Bin1 Release and Other Bin Dispose";
                    }
                    if (str6.Contains("1") && !str6.Contains("5"))
                    {
                        str3 = "Confirm Bin1 Release";
                    }
                    if (!str6.Contains("1") && str6.Contains("5"))
                    {
                        str3 = "Confirm Other Bin Dispose";
                    }
                    LotService.UpdateLot(lotByLotID);
                    lotByLotID = LotService.GetLotByLotID(lotByLotID.LotID);
                    if (lotByLotID.Status == "END")
                    {
                        lotByLotID.SDStates = 0xff;
                        LotService.UpdateLot(lotByLotID);
                    }
                }
                //base.Session.Contents["User"] = UserService.GetOSATUserByHashedCID(BaseController.CurrentUserInfo.UserID);
                goto Label_0431;
            }

            case UserRoles.PE:
            case UserRoles.PEAdmin:
                lotByLotID.PEDisposeTime = DateTime.Now;
                dispose = Convert.ToInt32(base.Request.Form["PEDispose"]);
                lotByLotID.SetPEDispose(dispose);
                NotificationService.ClearNotificationsByRoleAndLotID(BaseController.CurrentUserInfo.Role, lotByLotID.LotID, NotificationTypes.LotDispose);
                switch (dispose)
                {
                case 1:
                    if (!lotByLotID.OtherBinDispose)
                    {
                        NotificationService.CreateOtherBinDisposeNotificationToSomebody(lotByLotID.LotID, BaseController.CurrentUserInfo.UserID);
                    }
                    goto Label_0114;

                case 2:
                case 3:
                    NotificationService.ClearNotificationsByRoleAndLotID(UserRoles.PE, lotByLotID.LotID, NotificationTypes.OtherBinDispose);
                    goto Label_0114;

                case 4:
                    //不需要给自己发邮件
                    //NotificationService.CreateDisposeNotification(lotByLotID, "", BaseController.CurrentUserInfo);
                    goto Label_0114;
                }
                break;

            case UserRoles.QA:
            case UserRoles.QAAdmin:
                dispose = Convert.ToInt32(base.Request.Form["QADispose"]);
                lotByLotID.QADisposeTime = DateTime.Now;
                lotByLotID.SetQADispose(dispose);
                NotificationService.ClearNotificationsByRoleAndLotID(BaseController.CurrentUserInfo.Role, lotByLotID.LotID, NotificationTypes.LotDispose);
                switch (dispose)
                {
                case 1:
                    if (!lotByLotID.OtherBinDispose)
                    {
                        NotificationService.CreateOtherBinDisposeNotificationsToPEs(lotByLotID.LotID);
                    }
                    break;

                case 2:
                case 3:
                    NotificationService.ClearNotificationsByRoleAndLotID(UserRoles.PE, lotByLotID.LotID, NotificationTypes.OtherBinDispose);
                    break;

                case 4:
                    //不需要给自己发邮件
                    //NotificationService.CreateDisposeNotification(lotByLotID, "", BaseController.CurrentUserInfo);
                    break;
                }
                //base.Session.Contents["User"] = UserService.GetUserByID(BaseController.CurrentUserInfo.UserID);
                code    = "0";
                message = "Save decision successed.";
                goto Label_0431;

            default:
                goto Label_0431;
            }
Label_0114:
            //base.Session.Contents["User"] = UserService.GetUserByID(BaseController.CurrentUserInfo.UserID);
            code    = "0";
            message = "Save decision successed.";
Label_0431:
            LotService.UpdateLot(lotByLotID);
            string commentText  = base.Request.Form["txtComment"];
            string commentID    = base.Request.Form["hidNewCommentID"];
            bool   internalOnly = base.Request.Form["chkInternal"] != null;

            if (internalOnly && (dispose != -1))
            {
                Comment comment  = LotService.GenerateComment(lotByLotID.LotID, dispose, commentID, commentText, internalOnly, BaseController.CurrentUserInfo);
                Comment comment2 = LotService.GenerateComment(lotByLotID.LotID, dispose, Guid.NewGuid().ToString(), "", false, BaseController.CurrentUserInfo);
                if (!StringHelper.isNullOrEmpty(str3))
                {
                    comment.CommentText  = str3 + "<br/>" + comment.CommentText;
                    comment2.CommentText = str3;
                }
                LotService.AddDisposeComment(comment);
                LotService.AddDisposeComment(comment2);
            }
            else
            {
                Comment comment3 = LotService.GenerateComment(lotByLotID.LotID, dispose, commentID, commentText, internalOnly, BaseController.CurrentUserInfo);
                if (!StringHelper.isNullOrEmpty(str3))
                {
                    comment3.CommentText = str3 + "<br/>" + comment3.CommentText;
                }
                LotService.AddDisposeComment(comment3);
            }
            ResponseTypes tip         = ResponseTypes.Tip;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse(code, message, tip.ToString(), information.ToString(), "", "", lotByLotID.Status).GenerateJsonResponse());
            return(null);
        }
        public ActionResult doOtherBinDispose()
        {
            string lotID = base.Request.Form["lotIDForOtherBinDispose"];
            string otherBinDisposeCommentID = base.Request.Form["hidOtherBinDisposeCommentID"];
            string str3         = base.Request.Form["txtOtherBinDisposeComment"];
            int    newPEDispose = Convert.ToInt32(base.Request.Form["hidPEDispose"]);

            if (StringHelper.isNullOrEmpty(str3))
            {
                str3 = "Other Bin dispose.";
            }
            Lot lot = LotService.doOtherBinDispose(lotID, newPEDispose, otherBinDisposeCommentID, str3, BaseController.CurrentUserInfo);

            NotificationService.ClearNotificationsByRoleAndLotID(UserRoles.PE, lotID, NotificationTypes.LotDispose);
            NotificationService.ClearNotificationsByRoleAndLotID(UserRoles.PE, lotID, NotificationTypes.OtherBinDispose);
            if (lot.VenderConfirmed)
            {
                NotificationService.CreateOSATConfirmNotificationsWhileLotChanged(lot.VenderID, lot, "OTHERBINDISPOSE");
            }
            ResponseTypes tip         = ResponseTypes.Tip;
            TipTypes      information = TipTypes.Information;

            base.Response.Write(new HandlerResponse("0", "doOtherBinDisposeSuccessed", tip.ToString(), information.ToString(), "", "", lot.Status).GenerateJsonResponse());
            return(null);
        }