private void userLoginClick(object sender, RoutedEventArgs e)//登录日志
        {
            try
            {
                listType            = _listType.ope1;
                AIS.IsChecked       = false;
                radar.IsChecked     = false;
                fuse.IsChecked      = false;
                login.IsChecked     = false;
                operation.IsChecked = false;
                alarm.IsChecked     = false;
                device.IsChecked    = false;

                login.IsChecked = true;
                long startTime = dataTime()[0]; //开始时间
                long endTime   = dataTime()[1]; //结束时间

                AISList.Visibility       = Visibility.Collapsed;
                radarList.Visibility     = Visibility.Collapsed;
                fuseList.Visibility      = Visibility.Collapsed;
                userLoginList.Visibility = Visibility.Visible;
                operateList.Visibility   = Visibility.Collapsed;
                alarmList.Visibility     = Visibility.Collapsed;
                deviceList.Visibility    = Visibility.Collapsed;

                opep = new dataAnadll.OperationLogProvider();
                int allpage = 0;
                opep.SearchLog(1, getTimeStamp(startTime), getTimeStamp(endTime), out PageIndex.Total);
                var a = getTimeStamp(startTime);
                var b = getTimeStamp(endTime);
                List <dataAnadll.OperationLog> list;

                PageIndex.Current = 1;

                loginDataList.Clear();
                for (int j = 0; j < PageIndex.Total; j++)
                {
                    opep.GetPage(1 + j, out list);
                    for (int i = 0; i < list.Count; i++)
                    {
                        loginData loginTarget = new loginData();

                        loginTarget.logNumber = (j * 1000 + i).ToString();
                        loginTarget.userName  = list[i].UserName;
                        loginTarget.operate   = list[i].OptionName;
                        loginTarget.time      = list[i].OptionTime.ToString();
                        loginTarget.result    = list[i].Result.ToString();
                        loginTarget.other     = list[i].Note;
                        loginTarget.ip        = list[i].IP.ToString();
                        loginTarget.type      = logNumber[list[i].LogType];
                        loginDataList.Add(loginTarget);
                    }
                }
                userLoginList.DataContext = loginDataList;
            }
            catch (Exception ee)
            {
            }
        }
Exemple #2
0
        // INSTANTIATE CLASS(ES)
        public void InstantiateObjects()
        {
            data = new loginData();
            ext  = new loginExt();
            //hash = new loginHash();
            helpers = new adminHelpers();

            // model objects
            props = new loginProps();
            tbl   = new loginDataObjects_tables();
            view  = new loginDataObjects_views();

            // data objects
            schema = new loginInitSchema();
        }
Exemple #3
0
        // INSTANTIATE CLASS(ES)
        public void InstantiateObjects()
        {
            // controller objects
            data = new loginData();
            ext  = new loginExt();
            //hash = new loginHash();

            // model objects
            //props = new loginProps();
            tbl  = new loginDataObjects_tables();
            view = new loginDataObjects_views();

            // data objects
            schema = new loginInitSchema();
        }
Exemple #4
0
        public JsonResult loginUserData([FromBody] loginData loginData)
        {
            string clientip = Request.HttpContext.Connection.RemoteIpAddress.ToString().TrimEnd() == "::1" ? "127.0.0.1" : Request.HttpContext.Connection.RemoteIpAddress.ToString().TrimEnd(), userAgent = Request.Headers["user-Agent"].ToString().TrimEnd();

            return(Json(new LoginClass().GetLoginModels(loginData, clientip, userAgent)));
        }
Exemple #5
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        bool flag = true;

        if (TextBox1.Text.Length < 4 || TextBox1.Text.Length > 31)
        {
            flag        = false;
            Label1.Text = "!!! Name length should be (4-31)";
        }
        else
        {
            Label1.Text = "";
        }
        if (TextBox2.Text.Length < 6 || TextBox1.Text.Length > 49)
        {
            flag        = false;
            Label2.Text = "!!! Mail length should be (6-49)";
        }
        else
        {
            Label2.Text = "";
        }
        if (TextBox3.Text.Length < 6 || TextBox3.Text.Length > 49)
        {
            flag        = false;
            Label3.Text = "!!! Address length should be (6-49)";
        }
        else
        {
            Label3.Text = "";
        }
        if (TextBox4.Text.Length < 6 || TextBox4.Text.Length > 49)
        {
            flag        = false;
            Label4.Text = "!!! web url length should be (6-49)";
        }
        else
        {
            Label4.Text = "";
        }
        if (TextBox6.Text.Length < 2 || TextBox6.Text.Length > 12)
        {
            flag        = false;
            Label7.Text = "!!! phone no length should be (3-12)";
        }
        else
        {
            Label7.Text = "";
        }

        if (TextBox7.Text.Length < 8 || TextBox7.Text.Length > 35)
        {
            flag        = false;
            Label8.Text = "!!! Password length should be (8-35)";
        }
        else
        {
            Label8.Text = "";
        }
        if (TextBox7.Text != TextBox8.Text)
        {
            flag        = false;
            Label9.Text = "!!! Password not Matched";
        }
        else
        {
            Label9.Text = "";
        }
        if (CheckBox1.Checked == false)
        {
            flag         = false;
            Label10.Text = "!!! check the checkbox";
        }
        else
        {
            Label10.Text = "";
        }

        if (flag == true)
        {
            String inputMail             = TextBox2.Text;
            DataClassesDataContext dbCon = new DataClassesDataContext();
            var user = from usr in dbCon.loginDatas
                       where usr.userMail == inputMail
                       select usr;
            if (user.Count() != 0)
            {
                Response.Write("<script>alert(' !!! >" + inputMail + "< mail is already in used.');</script>");
            }
            else if (user.Count() == 0)
            {
                string userType            = "Company";
                string activity            = "n";
                string reg_date            = DateTime.Now.ToString("yyyy-MM-dd");
                string idNumber            = "CP" + DateTime.Now.ToString("yyyyMMddHHmmss");
                string inputCompanyName    = TextBox1.Text;
                string inputAddress        = TextBox3.Text;
                string inputCompanyWebSite = TextBox4.Text;
                string establishedDate     = TextBox5.Text;
                string inputHq             = DropDownList1.Text;
                string phoneNumber         = TextBox6.Text;
                string userPasword         = TextBox7.Text;

                try
                {
                    DataClassesDataContext dbConnec = new DataClassesDataContext();
                    loginData obj = new loginData();
                    obj.idNo         = idNumber;
                    obj.activity     = activity;
                    obj.reg_date     = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
                    obj.userPassword = userPasword;
                    obj.userMail     = inputMail;
                    obj.usertype     = userType;

                    companyDataTbl companyData = new companyDataTbl();
                    companyData.companyId      = idNumber;
                    companyData.companyName    = inputCompanyName;
                    companyData.companyAddress = inputAddress;
                    companyData.companyWebSite = inputCompanyWebSite;
                    companyData.foundationOn   = Convert.ToDateTime(establishedDate.ToString());
                    companyData.headQuater     = inputHq;
                    companyData.contactNo      = phoneNumber;

                    dbCon.loginDatas.InsertOnSubmit(obj);
                    dbCon.companyDataTbls.InsertOnSubmit(companyData);
                    dbCon.SubmitChanges();
                    Response.Redirect("confirmationPage.aspx");
                }
                catch (Exception)
                {
                    throw;
                }
            }
            else
            {
                Response.Write("<script>alert(' !!! Use Another Mail.');</script>");
            }
        }
    }
Exemple #6
0
 public LoginController()
 {
     this.email    = null;
     this.password = null;
     this.log      = new loginData();
 }
    private void tempCreateAccount()
    {
        //Setup Save File Writer
        BinaryFormatter bf = new BinaryFormatter();
        //FileStream file = File.Create(Application.persistentDataPath + "/serverLogin.dat");
        FileStream file = File.Create("ServerData/Logins" +"/serverLogin.dat");

        //Create Save File
        loginData data = new loginData();
        data.username = "******";
        data.password = "******";

        //Serialize data and save, then closes file
        bf.Serialize(file, data);
        file.Close();

        Debug.Log("Created Admin Account: " + "ServerData/Logins/serverLogin.dat");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        bool flag = true;

        if (TextBox1.Text.Length < 4 || TextBox1.Text.Length > 31)
        {
            flag        = false;
            Label1.Text = "!!! Name length should be (4-31)";
        }
        else
        {
            Label1.Text = "";
        }
        if (TextBox2.Text.Length < 6 || TextBox1.Text.Length > 49)
        {
            flag        = false;
            Label2.Text = "!!! Mail length should be (6-49)";
        }
        else
        {
            Label2.Text = "";
        }
        if (TextBox3.Text.Length < 6 || TextBox3.Text.Length > 49)
        {
            flag        = false;
            Label3.Text = "!!! Address length should be (6-49)";
        }
        else
        {
            Label3.Text = "";
        }
        if (TextBox6.Text.Length < 2 || TextBox6.Text.Length > 12)
        {
            flag        = false;
            Label7.Text = "!!! Phone no length should be (3-12)";
        }
        else
        {
            Label7.Text = "";
        }
        if (TextBox9.Text.Length < 6 || TextBox9.Text.Length > 49)
        {
            flag        = false;
            Label9.Text = "!!! Institute length should be (6-49)";
        }
        else
        {
            Label9.Text = "";
        }
        if (TextBox7.Text.Length < 8 || TextBox7.Text.Length > 35)
        {
            flag         = false;
            Label11.Text = "!!! Password length should be (8-35)";
        }
        else
        {
            Label11.Text = "";
        }
        if (TextBox7.Text != TextBox8.Text)
        {
            flag         = false;
            Label12.Text = "!!! Password not Matched";
        }
        else
        {
            Label12.Text = "";
        }
        if (CheckBox1.Checked == false)
        {
            flag         = false;
            Label13.Text = "!!! check the checkbox";
        }
        else
        {
            Label13.Text = "";
        }

        if (flag == true)
        {
            String inputMail             = TextBox2.Text;
            DataClassesDataContext dbCon = new DataClassesDataContext();
            var user = from usr in dbCon.loginDatas
                       where usr.userMail == inputMail
                       select usr;
            if (user.Count() != 0)
            {
                Response.Write("<script>alert(' !!! >" + inputMail + "< mail is already in used.');</script>");
            }
            else if (user.Count() == 0)
            {
                string userType     = "Applicant";
                string activity     = "y";
                string reg_date     = DateTime.Now.ToString("yyyy-MM-dd");
                string idNumber     = "AP" + DateTime.Now.ToString("yyyyMMddHHmmss");
                string inputName    = TextBox1.Text;
                string inputAddress = TextBox3.Text;

                string DateOfBirth = TextBox5.Text;
                string gender      = RadioButtonList1.SelectedItem.Text;
                string division    = DropDownList1.Text;
                string phoneNumber = TextBox6.Text;
                string degree      = DropDownList2.Text;
                string institute   = TextBox9.Text;
                string subject     = DropDownList3.Text;
                string userPasword = TextBox7.Text;
                try
                {
                    DataClassesDataContext dbConnec = new DataClassesDataContext();
                    loginData obj = new loginData();
                    obj.idNo         = idNumber;
                    obj.activity     = activity;
                    obj.reg_date     = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
                    obj.userPassword = userPasword;
                    obj.userMail     = inputMail;
                    obj.usertype     = userType;

                    userData userData1 = new userData();
                    userData1.userId        = idNumber;
                    userData1.fullName      = inputName;
                    userData1.degree        = degree;
                    userData1.addressOfUser = inputAddress;
                    userData1.contactNo     = phoneNumber;
                    userData1.gender        = gender;
                    userData1.institute     = institute;
                    userData1.subjectGrad   = subject;
                    userData1.division      = division;
                    userData1.dob           = Convert.ToDateTime(DateOfBirth.ToString());


                    dbCon.loginDatas.InsertOnSubmit(obj);
                    dbCon.userDatas.InsertOnSubmit(userData1);
                    dbCon.SubmitChanges();
                    Response.Redirect("confirmationPage.aspx");
                }
                catch (Exception)
                {
                    throw;
                }
            }
            else
            {
                Response.Write("<script>alert(' !!! Use Another Mail.');</script>");
            }
        }
    }
Exemple #9
0
 partial void DeleteloginData(loginData instance);
Exemple #10
0
 partial void UpdateloginData(loginData instance);
Exemple #11
0
 partial void InsertloginData(loginData instance);
        void changeContent(_listType type, int currentPage)
        //将表格的内容进行切换
        {
            try
            {
                PageIndex.Current = currentPage;

                switch (type)
                {
                case _listType.alarm:
                    List <dataAnadll.AlarmLog> list;
                    alarmp.GetPage(currentPage, out list);
                    alarmDataList.Clear();
                    for (int i = 0; i < list.Count; i++)
                    {
                        alarmData alarmTarget = new alarmData();

                        string a = "";

                        if (list[i].alarm_area_num == 201)
                        {
                            a = alarmType[0];
                        }
                        else if (list[i].alarm_area_num == 202)
                        {
                            a = alarmType[1];
                        }
                        else if (list[i].alarm_area_num == 203)
                        {
                            a = alarmType[2];
                        }
                        else if (list[i].alarm_area_num >= 210 && list[i].alarm_area_num <= 215)
                        {
                            a = alarmType[3];
                        }
                        else if (list[i].alarm_area_num >= 220 && list[i].alarm_area_num <= 225)
                        {
                            a = alarmType[4];
                        }
                        else if (list[i].alarm_area_num == 255)
                        {
                            a = alarmType[5];
                        }
                        alarmTarget.DisplayNumber = (i + (PageIndex.Current - 1) * 1000).ToString();
                        alarmTarget.alarmNumber   = a;
                        alarmTarget.time          = list[i].time.ToString();
                        alarmTarget.radarNumber   = list[i].radar_batch_id.ToString();
                        alarmTarget.radarNumber2  = list[i].radar_batch_id2.ToString();   //告警日志添加雷达2 批号

                        alarmTarget.IMO = list[i].ais_batch_id.ToString();
                        switch (list[i].alarm_type)
                        {
                        case 1:
                            alarmTarget.alarmString = "驶入";
                            break;

                        case 2:
                            alarmTarget.alarmString = "驶出";
                            break;

                        default:
                            alarmTarget.alarmString = "未知报警";
                            break;
                        }
                        switch (list[i].country)
                        {
                        case 412:
                        case 413:
                            alarmTarget.country = "中国";
                            break;

                        case 574:
                        case 576:
                            alarmTarget.country = "越南";
                            break;

                        case 533:
                            alarmTarget.country = "马拉西亚";
                            break;

                        default:
                            alarmTarget.country = "其他";
                            break;
                        }

                        alarmTarget.Atrrib = state[list[i].iff_attrib];
                        alarmDataList.Add(alarmTarget);
                    }
                    alarmList.DataContext = alarmDataList;
                    break;

                case _listType.ais:
                    List <dataAnadll.FUS_ICD_MySql.AISMsg_SS> list_ais;
                    aisp.GetPage(currentPage, out list_ais);
                    AISDataList.Clear();
                    for (int i = 0; i < list_ais.Count; i++)
                    {
                        AISData AISTarget = new AISData();

                        AISTarget.boatName   = list_ais[i].cName;
                        AISTarget.IMO        = list_ais[i].ulIMO;
                        AISTarget.MMSI       = list_ais[i].ulRecoCode;
                        AISTarget.call       = list_ais[i].cCall_ID;
                        AISTarget.country    = list_ais[i].country;
                        AISTarget.longitude  = list_ais[i].dLong;
                        AISTarget.latitude   = list_ais[i].dLat;
                        AISTarget.angle      = list_ais[i].fDirectCourse;
                        AISTarget.speed      = list_ais[i].fDirectSpeed;
                        AISTarget.time       = (GetTime((list_ais[i].ulTime).ToString())).ToString();
                        AISTarget.trackState = list_ais[i].ucSailStatus;
                        AISTarget.high       = list_ais[i].fMaxDeep;
                        AISTarget.people     = list_ais[i].ulCount;
                        AISTarget.destance   = list_ais[i].cDestination;

                        AISDataList.Add(AISTarget);
                    }
                    AISList.DataContext = AISDataList;
                    break;

                case _listType.dev:

                    List <dataAnadll.SystemLog> list_dev;
                    devp.GetPage(currentPage, out list_dev);
                    deviceDataList.Clear();
                    for (int i = 0; i < list_dev.Count; i++)
                    {
                        deviceData deviceTarget = new deviceData();

                        deviceTarget.number       = i.ToString();
                        deviceTarget.ip           = list_dev[i].machine_IP.ToString();
                        deviceTarget.device       = list_dev[i].machine_Name.ToString();
                        deviceTarget.networkState = this.type[list_dev[i].machine_Network];
                        deviceTarget.workState    = this.type[list_dev[i].machine_Workstate];
                        deviceTarget.time         = list_dev[i].machine_time.ToString();
                        deviceTarget.other        = list_dev[i].reason.ToString();

                        deviceDataList.Add(deviceTarget);
                    }
                    deviceList.DataContext = deviceDataList;
                    break;

                case _listType.fus:
                    List <dataAnadll.FUS_ICD_MySql.FusTarget_SS> list_fus;
                    fusp.GetPage(currentPage, out list_fus);
                    fuseDataList.Clear();
                    for (int i = 0; i < list_fus.Count; i++)
                    {
                        fuseData fuseTarget = new fuseData();
                        fuseTarget.number = list_fus[i].lFusBatchID;
                        fuseTarget.time   = (GetTime((list_fus[i].lTime).ToString())).ToString();
                        string a = "";
                        if (list_fus[i].FusDataType == "2")
                        {
                            a = mix[0];
                        }
                        else if (list_fus[i].FusDataType == "3")
                        {
                            a = mix[1];
                        }
                        else if (list_fus[i].FusDataType == "100")
                        {
                            a = mix[2];
                        }
                        fuseTarget.type            = a;
                        fuseTarget.dataNumber      = list_fus[i].SrcNum;
                        fuseTarget.longitude       = list_fus[i].dLongti;
                        fuseTarget.latitude        = list_fus[i].dLati;
                        fuseTarget.angle           = list_fus[i].dNorthCourse;
                        fuseTarget.name            = list_fus[i].cName;
                        fuseTarget.call            = list_fus[i].cCall_ID;
                        fuseTarget.country         = list_fus[i].country;
                        fuseTarget.Atrrbi          = state[Convert.ToInt32(list_fus[i].ucIFFAttrib)];
                        fuseTarget.high            = list_fus[i].fMaxDeep;
                        fuseTarget.people          = list_fus[i].ulCount;
                        fuseTarget.IMO             = list_fus[i].ulAISBatchID;
                        fuseTarget.radar_batch_id  = list_fus[i].ulRdbatchID;
                        fuseTarget.radar_batch_id2 = list_fus[i].ulOpticalID;
                        fuseDataList.Add(fuseTarget);
                    }

                    fuseList.DataContext = fuseDataList;
                    break;

                case _listType.radar:
                    List <dataAnadll.FUS_ICD_MySql.RdDetectMsg_SS> list_rd;
                    radarp.GetPage(currentPage, out list_rd);
                    radarDataList.Clear();
                    for (int i = 0; i < list_rd.Count; i++)
                    {
                        radarData radarTarget = new radarData();
                        radarTarget.radarID   = list_rd[i].PardPara.ucRadarID.ToString();
                        radarTarget.number    = list_rd[i].lTargetNo;
                        radarTarget.distance  = list_rd[i].ulTargetDis;
                        radarTarget.longitude = list_rd[i].dLongti;
                        radarTarget.latitude  = list_rd[i].dLati;
                        radarTarget.angle     = list_rd[i].ulTargetCourse;
                        radarTarget.north     = list_rd[i].dNorthCourse;
                        radarTarget.speed     = list_rd[i].ulTargetSpeed;
                        // if (list_rd[i].radar_count == 70.ToString())
                        {
                            //   radarTarget.time = list_rd[i].lFoundTime;
                        }
                        //  else
                        {
                            radarTarget.time = (GetTime((list_rd[i].lFoundTime).ToString())).ToString();
                        }

                        radarDataList.Add(radarTarget);
                    }
                    radarList.DataContext = radarDataList;
                    break;

                case _listType.ope1:
                    List <dataAnadll.OperationLog> list_ope1;
                    opep.GetPage(currentPage, out list_ope1);
                    loginDataList.Clear();
                    for (int i = 0; i < list_ope1.Count; i++)
                    {
                        loginData loginTarget = new loginData();

                        loginTarget.logNumber = (i + (PageIndex.Current - 1) * 1000).ToString();
                        loginTarget.userName  = list_ope1[i].UserName.ToString();
                        loginTarget.operate   = list_ope1[i].OptionName;
                        loginTarget.time      = list_ope1[i].OptionTime.ToString();
                        loginTarget.result    = list_ope1[i].Result.ToString();
                        loginTarget.other     = list_ope1[i].Note;
                        loginTarget.ip        = list_ope1[i].IP.ToString();
                        loginTarget.type      = logType[list_ope1[i].LogType].ToString();
                        loginDataList.Add(loginTarget);
                    }
                    userLoginList.DataContext = loginDataList;
                    break;

                case _listType.ope2:
                    List <dataAnadll.OperationLog> list_ope2;
                    opep.GetPage(currentPage, out list_ope2);
                    operateDataList.Clear();
                    for (int i = 0; i < list_ope2.Count; i++)
                    {
                        operateData operateTarget = new operateData();

                        operateTarget.logNumber = (i + (PageIndex.Current - 1) * 1000).ToString();
                        operateTarget.userName  = list_ope2[i].UserName.ToString();
                        operateTarget.operate   = list_ope2[i].OptionName.ToString();
                        operateTarget.time      = list_ope2[i].OptionTime.ToString();
                        operateTarget.result    = list_ope2[i].Result;
                        operateTarget.other     = list_ope2[i].Note.ToString();
                        operateTarget.ip        = list_ope2[i].IP.ToString();
                        operateTarget.type      = logType[list_ope2[i].LogType].ToString();

                        operateDataList.Add(operateTarget);
                    }
                    operateList.DataContext = operateDataList;
                    break;
                }
            }
            catch (Exception ee)
            {
            }
        }