Esempio n. 1
0
 //[Authorize]
 public ActionResult QCReport(QccasttModels _qccastt)
 {
     //if ((cm.Vin == null) || (cm.Vin == ""))
     //{
     //    cm.Vin = "NAS";
     //}
     //_qccastt.SelectedItemIds = new[] { 2, 3 };
     //_qccastt.SelectedItemIds2 = new[] { 2, 3 };
     _qccastt.Vin          = "NAS411100G1205277";
     _qccastt.Lstshop      = QccasttUtility.GetShop().Cast <Pcshopt>().ToList();
     _qccastt.LstArea      = QccasttUtility.GetArea("").Cast <Area>().ToList();
     _qccastt.LstCarGroup  = CarUtility.GetBaseCarGroupList().Cast <CarGroup>().ToList();
     _qccastt.LstBodyModel = CarUtility.GetBaseBodyModelList().Cast <BodyModel>().ToList();
     _qccastt.LstStrength  = QccasttUtility.GetBaseStrength().Cast <Strength>().ToList();
     _qccastt.LstBodyStyle = CarUtility.GetBodyStyle("", "").Cast <BodyStyle>().ToList();
     _qccastt.LstShift     = new List <Shift>();
     _qccastt.LstShift.Add(new Shift {
         ShiftName = "A"
     });
     _qccastt.LstShift.Add(new Shift {
         ShiftName = "B"
     });
     _qccastt.LstShift.Add(new Shift {
         ShiftName = "C"
     });
     return(View(_qccastt));
 }
Esempio n. 2
0
 public List <Defect> GetDefects([FromBody] User _User)
 {
     try
     {
         if (!string.IsNullOrEmpty(_User.USERNAME) && _User.USERNAME != "0" && !string.IsNullOrEmpty(_User.PSW) && _User.PSW != "0")
         {
             bool Login = Authentication.FindUser(_User.USERNAME, _User.PSW);
             if (Login)
             {
                 //LogManager.MethodCallLog("GetSaipaCitroenPDIData _ RequestByUser: "******" _RequestVin: " + _User.Vin);
                 return(QccasttUtility.GetBaseDefectList());
             }
             else
             {
                 //LogManager.MethodCallLog("GetSaipaCitroenPDIData _ RequestByUser: "******"_ AuthenticationFail");
                 return(null);
             }
         }
         else
         {
             return(null); // "Check Your Parameters";
         }
     }
     catch
     {
         return(null);// "Error Occurrence";
     }
 }
Esempio n. 3
0
        public ResultMsg MultiDefectRepair([FromBody] ResultMsg rms)
        {
            LogManager.SetCommonLog("Method Call");
            //object lstQ = rms.lstQccastt;
            List <Qccastt> lstQ = new List <Qccastt>((IEnumerable <Qccastt>)rms.lstQccastt);

            return(QccasttUtility.QCCASTT_MultiDefectRepair(lstQ));
        }
Esempio n. 4
0
        public ResultMsg MultiDefectRepair2([FromBody] Qccastt qccastt)
        {
            LogManager.SetCommonLog("Method Call");
            List <Qccastt> q = new List <Qccastt>();

            q.Add(qccastt);
            return(QccasttUtility.QCCASTT_MultiDefectRepair(q));
        }
Esempio n. 5
0
        public ActionResult GetJCarDef(string _Vin)
        {
            Qccastt q = new Qccastt();

            q.Vin = _Vin;
            List <QccasttLight> lstQccasttLight = QccasttUtility.GetCarDefectLight(_Vin);

            //SelectList list = CommonUtility.ToSelectList(QccasttUtility.GetCarDefect(q,).Tables[0], "Bdstlcode", "AliasName", false);
            return(Json(lstQccasttLight, JsonRequestBehavior.AllowGet));
        }
Esempio n. 6
0
        public List <Qccastt> tstCarDefect()
        {
            Qccastt q = new Qccastt();

            //q.Vin = "NAS411100G1205277";
            q.deletedby  = -1;
            q.DateType   = "M";
            q.ActAreaSrl = 94;
            q.ActBy      = 4314;
            return(QccasttUtility.GetCarDefect(q));
        }
Esempio n. 7
0
        public ResultMsg CarSendtest()
        {
            CarSend carsend = new CarSend();

            carsend.UserId      = 1000861;
            carsend.Vin         = "NAS411100G1205277";
            carsend.QCUsertSrl  = 4314;
            carsend.FromAreaSrl = 461;
            carsend.ToAreaSrl   = 94;
            return(QccasttUtility.InsertQcqctrt(carsend));
        }
Esempio n. 8
0
 public QCUsert GetUsertst()
 {
     try
     {
         return(QccasttUtility.GetQCUserT("4314"));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Esempio n. 9
0
        public ActionResult GetArea(string[] QCAreatSrls)
        {
            string Srls = "";

            if (QCAreatSrls != null)
            {
                Srls = string.Join(",", QCAreatSrls);
            }
            SelectList list = CommonUtility.ToSelectList(QccasttUtility.GetdsArea(Srls).Tables[0], "SRL", "AREADESC", false);

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Esempio n. 10
0
        public ActionResult FromLoadFileReport()
        {
            var       formValues = StiMvcViewer.GetFormValues(this.HttpContext);
            CarModels cm         = new CarModels();

            if (formValues.Count != 0)
            {
                cm.Vin = formValues.GetValues("vin").GetValue(0).ToString();
            }
            else
            {
                cm.Vin = "NAS0";
            }
            try
            {
                Qccastt qccastt = new Qccastt();
                qccastt.Vin = cm.GetVin();
                DataSet dsCardInfo = new DataSet();
                if (!string.IsNullOrEmpty(cm.Vin))
                {
                    Object[] obj = null;
                    dsCardInfo = QccasttUtility.GetCarDefect(qccastt, out obj);
                    dsCardInfo.Tables[0].TableName = "CarDefects";
                }

                StiReport report = new StiReport();
                report.Load(Server.MapPath("/Content/ReportsFile/QCCard2.mrt"));
                StiText stitxtVin = (StiText)report.GetComponentByName("txtVin");
                stitxtVin.Text = cm.GetVin();
                // BCVin
                StiBarCode stiBCVin = (StiBarCode)report.GetComponentByName("BCVin");
                stiBCVin.Code = new StiBarCodeExpression(cm.GetVin());

                //report.RegBusinessObject("driverReport", dsCardInfo.Tables[0]);
                //int i = dsCardInfo.Tables[0].Rows.Count;
                //report.Compile();

                report.RegData(dsCardInfo);
                return(StiMvcViewer.GetReportSnapshotResult(HttpContext, report));
            }
            catch (Exception ex)
            {
                // lblVinMessage.Text = "خطا در دریافت اطلاعات";
                return(View());
            }
        }
Esempio n. 11
0
        public List <Module> GetBaseModuleList()
        {
            List <Module> lstM = new List <Module>();

            try
            {
                lstM = QccasttUtility.GetBaseModuleList();
                return(lstM);
            }
            catch (Exception e)
            {
                Module m = new Module();
                m.ModuleName = e.Message + "__" + e.InnerException.Message.ToString();
                m.ModuleCode = 0;
                m.Srl        = 0;
                lstM.Add(m);
                return(lstM);
            }
        }
Esempio n. 12
0
 public List <Defect> GetBaseDefectList()
 {
     return(QccasttUtility.GetBaseDefectList());
 }
Esempio n. 13
0
 public List <Area> GetUserAreaPermision([FromBody] User user)
 {
     return(QccasttUtility.GetGetUserAreaPermision(user));
 }
Esempio n. 14
0
 public ResultMsg CarSend([FromBody] CarSend carsend)
 {
     return(QccasttUtility.InsertQcqctrt(carsend));
 }
Esempio n. 15
0
 public List <Summary> UserSammary2()
 {
     return(QccasttUtility.GetUserSammary(1483, 6017, 0, "D"));
 }
Esempio n. 16
0
 public List <Summary> UserSammary([FromBody] Qccastt qccastt)
 {
     return(QccasttUtility.GetUserSammary(qccastt.ActAreaSrl, qccastt.ActAreaSrl, 0, qccastt.RepairedByDesc));
 }
Esempio n. 17
0
 public List <Strength> GetBaseStrengthList()
 {
     return(QccasttUtility.GetBaseStrengthList());
 }
Esempio n. 18
0
 public List <Qccastt> CarDefect([FromBody] Qccastt qccastt)
 {
     return(QccasttUtility.GetCarDefect(qccastt));
 }
Esempio n. 19
0
 public ResultMsg DefectDetect([FromBody] Qccastt qccastt)
 {
     return(QccasttUtility.QCCASTT_DefectDetect(qccastt));
 }
Esempio n. 20
0
 public ResultMsg DeleteQccastt([FromBody] Qccastt qccastt)
 {
     return(QccasttUtility.Delete_QCCASTT(qccastt));
 }
Esempio n. 21
0
 public List <Qcdsart> GetQcdsart()
 {
     return(QccasttUtility.GetQcdsart());
 }
Esempio n. 22
0
 public List <Area> GetArea()
 {
     return(QccasttUtility.GetBaseAreaList());
 }
Esempio n. 23
0
 public static Car GetCarInfo(Car car)
 {
     try
     {
         if ((car != null)) // && (U.Macaddress == "48:13:7e:11:d7:1f"))
         {
             //Value cannot be null.
             car.ValidFormat    = CheckFormatVin(car.Vin);
             car.VinWithoutChar = GetVinWithoutChar(car.Vin);
             if (car.ValidFormat)
             {
                 List <Car> carinfo     = new List <Car>();
                 string     commandtext = string.Format(@"select c.vin,c.engineno,c.prodno,c.joinerydate,c.bdmdlcode,c.bdstlcode,c.bdstlaliasname ,c.fitypecode,c.finqccode,c.clrcode, (select q.toareasrl from qcqctrt q where vin =c.vin and passed=0) as CurAreaSrl,
                                                     c.JoinaryTeamDesc,c.nasvin,c.shopcode,c.shopname,c.joinaryteam,c.assmteamwork,c.assemblytypecode,c.gearboxtypecode,c.forexport,c.grpcode,c.bdmdlaliasname,
                                                     c.grpname,c.comanyname as companyname,c.companycode,c.fitypename,c.clralias,c.gearboxtypedesc,c.prodenddate,substr(c.prodenddate_fa,0,16) as prodenddate_fa,substr(c.joinerydate_fa,0,16) as joinerydate_fa,substr(c.bodyshopproddate,0,16)as bodyshopproddate,substr(c.paintshopproddate,0,16) as paintshopproddate,substr(asmshopproddate,0,16) as asmshopproddate,
                                                     (select distinct (s.shopcode) from pt.cartrace ct join pt.station s on ct.stncode = s.stncode where ct.vin = c.vin and ct.passed=0) as PTCurrentShopCode,
                                                     {1} as ActAreaSrl,{2} as ActBy,
                                                     (select count(srl) from qccastt t where t.qcareat_srl ={1} and t.vin = c.vin and t.isdefected=1 and t.inuse=1 and t.deletedby is null and t.recordowner=1 ) CurrentAreaDefCount,
                                                     TO_char(p.createddate,'YYYY/MM/DD HH24:MI:SS','nls_calendar=persian') as ProCreatedDateFa,
                                                     u.fname ||' '|| u.lname as ProCreatedByDesc,decode(p.LocIsValid,null,-1,p.LocIsValid) as LocIsValid
                                                     from qccariddt c left join qcprot p on c.vin = p.vin left join qcusert u on p.createdby = u.srl
                                                     where c.vin ='{0}' "
                                                        , car.VinWithoutChar, car.ActAreaSrl, car.ActBy);
                 //
                 carinfo = DBHelper.GetDBObjectByObj2_OnLive(new Car(), null, commandtext, "inspector").Cast <Car>().ToList();
                 if (carinfo.Count == 1)
                 {
                     carinfo[0].ValidFormat    = car.ValidFormat;
                     carinfo[0].Vin            = car.Vin;
                     carinfo[0].VinWithoutChar = car.VinWithoutChar;
                     Qccastt q = new Qccastt();
                     q.Vin                         = car.Vin;
                     q.ActAreaSrl                  = car.ActAreaSrl;
                     q.ActBy                       = car.ActBy;
                     q.VinWithoutChar              = car.VinWithoutChar;
                     carinfo[0].lstQcqctrt         = QccasttUtility.GetCarTrace(q);
                     carinfo[0].lstQccastt         = QccasttUtility.GetCarDefect(q);
                     carinfo[0].LastStopTime       = QccasttUtility.GetLastStopTime(car.VinWithoutChar);
                     carinfo[0].CurAreaDefectCount = QccasttUtility.GettCurrentAreaDefectCoun(car.VinWithoutChar, car.ActAreaSrl.ToString());
                     //---
                     return(carinfo[0]);
                 }
                 else
                 {
                     car.msg = "car not found" + commandtext;
                     return(car);
                 }
             }
             else
             {
                 car.msg = "vin is not valid format";
                 return(car);
             }
         }
         else
         {
             car.msg = "Car Is Null";
             return(car);
         }
     }
     catch (Exception ex)
     {
         car.msg = ex.Message.ToString();
         //string message = string.Format("Time: {0}", DateTime.Now.ToString("dd/MM/yyyy hh:mm:ss tt"));
         //message += Environment.NewLine;
         //message += "-----------------------------------------------------------";
         //message += Environment.NewLine;
         //message += string.Format("Message: {0}", ex.Message);
         //message += Environment.NewLine;
         //message += string.Format("StackTrace: {0}", ex.StackTrace);
         //message += Environment.NewLine;
         //message += string.Format("Source: {0}", ex.Source);
         //message += Environment.NewLine;
         //message += string.Format("TargetSite: {0}", ex.TargetSite.ToString());
         //message += Environment.NewLine;
         //message += "-----------------------------------------------------------";
         //message += Environment.NewLine;
         //string path = @"C:/ErrorLog/ErrorLog.txt";
         //StreamWriter writer = new StreamWriter(path, true);
         //writer.WriteLine(message);
         //writer.Close();
         return(car);
     }
 }
Esempio n. 24
0
 public List <BodyModel> GetBodyModel()
 {
     return(QccasttUtility.GetBaseBodyModelList());
 }
Esempio n. 25
0
 public List <CarGroup> GetCarGroup()
 {
     return(QccasttUtility.GetBaseCarGroupList());
 }
Esempio n. 26
0
 public List <Qcdfctt> GetAreaCheckList([FromBody] Area _area)
 {
     return(QccasttUtility.GetAreaCheckList(_area));
 }
Esempio n. 27
0
 public List <SaleStatus> GetSaleStatus()
 {
     return(QccasttUtility.GetBaseSaleStatusList());
 }
Esempio n. 28
0
 public List <Shop> GetShop()
 {
     return(QccasttUtility.GetBaseShopList());
 }
        public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
        {
            var identity = new ClaimsIdentity(context.Options.AuthenticationType);

            // authenticat from database
            string[] strScope          = context.Scope[0].ToString().Split(',');
            string   strSecondPassword = strScope[0];
            string   strAreaCode       = strScope[1];
            int      intClientVersion  = Convert.ToInt32(strScope[2].Replace(".", ""));
            string   LoginFromAppName  = strScope[3];
            User     FoundUser         = QccasttUtility.FindUser(context.UserName, context.Password, strSecondPassword, strAreaCode, "");

            FoundUser.ClientVersion = strScope[2].ToString();
            if (FoundUser != null)
            {
                string QCAreatSrl      = FoundUser.QCAREATSRL.ToString();
                string ValidQCAreaCode = FoundUser.AREACODE.ToString();
                if (!string.IsNullOrEmpty(ValidQCAreaCode))
                {
                    if (!string.IsNullOrEmpty(QCAreatSrl))
                    {
                        identity.AddClaim(new Claim("UserName", context.UserName));
                        identity.AddClaim(new Claim("UserId", FoundUser.USERID.ToString()));
                        identity.AddClaim(new Claim("FName", FoundUser.FNAME));
                        identity.AddClaim(new Claim("LName", FoundUser.LNAME));
                        identity.AddClaim(new Claim("srl", FoundUser.SRL.ToString()));
                        identity.AddClaim(new Claim("QCAreatSrl", FoundUser.QCAREATSRL.ToString()));
                        identity.AddClaim(new Claim("AreaCode", FoundUser.AREACODE.ToString()));
                        identity.AddClaim(new Claim("AreaDesc", FoundUser.AREADESC.ToString()));
                        identity.AddClaim(new Claim("CheckDest", FoundUser.CHECKDEST.ToString()));
                        identity.AddClaim(new Claim("AreaType", FoundUser.AREATYPE.ToString()));
                        identity.AddClaim(new Claim("MacIsValid", "true"));
                        //--- per
                        identity.AddClaim(new Claim("QCMobAppPer", FoundUser.QCMOBAPPPER.ToString()));
                        identity.AddClaim(new Claim("PTDashPer", FoundUser.PTDASHPER.ToString()));
                        identity.AddClaim(new Claim("QCDashPer", FoundUser.QCDASHPER.ToString()));
                        identity.AddClaim(new Claim("AuditDashPer", FoundUser.AUDITDASHPER.ToString()));
                        identity.AddClaim(new Claim("AuditUnLockPer", FoundUser.AUDITUNLOCKPER.ToString()));
                        identity.AddClaim(new Claim("QCRegDefPer", FoundUser.QCREGDEFPER.ToString()));
                        identity.AddClaim(new Claim("SMSQCPer", FoundUser.SMSQCPER.ToString()));
                        identity.AddClaim(new Claim("SMSAuditPer", FoundUser.SMSAUDITPER.ToString()));
                        identity.AddClaim(new Claim("SMSSPPer", FoundUser.SMSSPPER.ToString()));
                        identity.AddClaim(new Claim("QCCardPer", FoundUser.QCCARDPER.ToString()));
                        identity.AddClaim(new Claim("SMSPTPer", FoundUser.SMSPTPER.ToString()));
                        identity.AddClaim(new Claim("AuditCardPer", FoundUser.AUDITCARDPER.ToString()));
                        identity.AddClaim(new Claim("CarStatusPer", FoundUser.CARSTATUSPER.ToString()));
                        identity.AddClaim(new Claim("AppName", LoginFromAppName));
                        identity.AddClaim(new Claim("ClientVersion", strScope[2]));
                        // ---
                        if (LoginFromAppName == "qcm")
                        {
                            int ClientForceVersion = Convert.ToInt32(clsCommon.ClientForceVersion_qcmobapp.Replace(".", ""));
                            if (intClientVersion >= ClientForceVersion)
                            {
                                identity.AddClaim(new Claim("ClientVerIsValid", "true"));
                            }
                            else
                            {
                                identity.AddClaim(new Claim("ClientVerIsValid", "false"));
                            }
                            identity.AddClaim(new Claim("UserAuthorization", "true"));
                            context.Validated(identity);
                        }
                        else if (LoginFromAppName == "ins")
                        {
                            int InspectorClientForceVersion = Convert.ToInt32(clsCommon.InspectorClientForceVersion_inspector.Replace(".", ""));
                            if (intClientVersion >= InspectorClientForceVersion)
                            {
                                identity.AddClaim(new Claim("ClientVerIsValid", "true"));
                            }
                            else
                            {
                                identity.AddClaim(new Claim("ClientVerIsValid", "false"));
                            }
                            identity.AddClaim(new Claim("UserAuthorization", "true"));
                            context.Validated(identity);
                        }
                        GeneralUtility.UpdateUserData(FoundUser, null, 0);
                    }
                    else
                    {
                        context.SetError("invalid_grant_areacode", "Area access is not allowed for the user");
                        return;
                    }
                }
                else
                {
                    context.SetError("invalid_areacode", "Provided areacode is incorrect");
                    return;
                }
            }
            else
            {
                context.SetError("invalid_grant", "Provided username and password is incorrect");
                return;
            }
        }
Esempio n. 30
0
 public List <FinalQC> GetFinalQC()
 {
     return(QccasttUtility.GetBaseFinalQCList());
 }