Exemplo n.º 1
0
        /// <summary>
        /// 保存事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Save_Click(object sender, EventArgs e)
        {
            if (User_Name.Value.ToLower() == "")
            {
                User_Name.Focus();
                errorMsg.InnerHtml = "请输入姓名!";
                return;
            }
            if (User_Account.Value.ToLower() == "")
            {
                User_Name.Focus();
                errorMsg.InnerHtml = "请输入账号/手机号码!";
                return;
            }
            int       i       = 0;
            Hashtable ht_User = new Hashtable();

            ht_User["User_Name"]    = User_Name.Value;
            ht_User["User_Account"] = User_Account.Value;
            ht_User["User_Sex"]     = User_Sex.Value;
            i = DataFactory.SqlDataBase().UpdateByHashtable("Base_UserInfo", "User_ID", RequestSession.GetSessionUser().UserId.ToString(), ht_User);

            if (i > 0)
            {
                Session.Abandon();  //取消当前会话
                Session.Clear();    //清除当前浏览器所以Session
                Response.Write("<script>alert('修改成功,请重新登录');top.location.href='/Frame/login.aspx'</script>");
            }
            else
            {
                errorMsg.InnerHtml = "修改登录密码失败";
            }
        }
Exemplo n.º 2
0
        private void Create_Click(object sender, EventArgs e)
        {
            conn = new OracleConnection(ordb);
            conn.Open();
            OracleCommand cmd = new OracleCommand();

            cmd.Connection  = conn;
            cmd.CommandText = "select username from useraccounts where username=:username";
            cmd.Parameters.Add("username", User_Name.Text);
            OracleDataReader dr = cmd.ExecuteReader();
            int count           = 0;

            while (dr.Read())
            {
                count++;
            }
            dr.Close();
            if (count != 0)
            {
                MessageBox.Show("UserName already taken");
                User_Name.Clear();
                Password.Clear();
                Confirm.Clear();
                conn.Close();
            }
            else if (Password.Text != Confirm.Text)
            {
                MessageBox.Show("Password doesn't match");
                Password.Clear();
                Confirm.Clear();
                conn.Close();
            }
            else
            {
                if (checkBox1.Checked)
                {
                    Global.Admin = 1;
                }

                OracleCommand cmd2 = new OracleCommand();
                cmd2.Connection  = conn;
                cmd2.CommandText = "insert into UserAccounts values (:username,:name,:password,:email,null,:phone,:flat,:building,:city,:street,:admin)";
                cmd2.Parameters.Add("username", User_Name.Text);
                cmd2.Parameters.Add("name", Name.Text);
                cmd2.Parameters.Add("password", Password.Text);
                cmd2.Parameters.Add("email", Email.Text);
                cmd2.Parameters.Add("phone", int.Parse(Phone.Text));
                cmd2.Parameters.Add("flat", int.Parse(Flat.Text));
                cmd2.Parameters.Add("building", int.Parse(building.Text));
                cmd2.Parameters.Add("city", City.Text);
                cmd2.Parameters.Add("street", int.Parse(Street.Text));
                cmd2.Parameters.Add("admin", Global.Admin);
                int r = cmd2.ExecuteNonQuery();
                MessageBox.Show("UserAccount Created");
                conn.Close();
                Global.CurrentUser = Name.Text;
                Search S = new Search();
                S.Show();
            }
        }
Exemplo n.º 3
0
        public async Task Turn(User_Name user, int cell, int number)
        {
            var(world, result) = ArenaEngine.Turn(user, cell, number);

            await Clients.All.Turned(result.Turn, result.IsWin, result.IsFail);

            if (result.IsWin || result.IsFail)
            {
                await Clients.All.Game(world.Game);

                await Clients.All.Top(world.Top);
            }
        }
Exemplo n.º 4
0
 //
 //  Function:   public void Remove_User(int user_type, int index_no)
 //
 //  Arguments:  int user_type = Type of user to remove (0 = System User, 1 = Site)
 //              int index_no = Index number of user to remove from list
 //
 //  Purpose:    Removes an entire record of a user at a certain index
 //
 public void Remove_User(int user_type, int index_no)
 {
     User_Name.RemoveAt(index_no);
     User_ID.RemoveAt(index_no);
     Access.RemoveAt(index_no);
     if (user_type == 1)
     {
         Site_User_ID.RemoveAt(index_no);
         Site_ID.RemoveAt(index_no);
         View_Resources.RemoveAt(index_no);
         Add_Resources.RemoveAt(index_no);
         Modify_Resources.RemoveAt(index_no);
         Del_Resources.RemoveAt(index_no);
         View_Tickets.RemoveAt(index_no);
         Add_Tickets.RemoveAt(index_no);
     }
 }
Exemplo n.º 5
0
 //重置登录表单
 private void Resetting_Button(object sender, RoutedEventArgs e)
 {
     User_Name.Clear();
     User_Password.Clear();
 }
Exemplo n.º 6
0
        //
        //  Function:   public void Get_List(int mode, long site_id)
        //
        //  Arguments:  int mode = Mode of list to get (0 = All Users, 1 = Only Users For This Site)
        //              long site_id = Site ID to get the list for (if mode is 1)
        //
        //  Purpose:    Gets a list of all users (mode = 0) or ones granted rights to see a site (mode = 1)
        //
        public void Get_List(int mode, long site_id = 0)
        {
            List <int> site_users = new List <int>();

            Initialize();

            // If the user name is blank then get it from the system and try to log in with AD security
            string connString = SQLConnString;

            // Query the User Database for the user
            StringBuilder query = new StringBuilder("SELECT * FROM ");

            switch (mode)
            {
            // All Users
            case 0:
                query.Append(tblUserInfo);
                query.Append(" ORDER BY User_Name");
                using (SqlConnection sqlCon = new SqlConnection(connString))
                {
                    sqlCon.Open();
                    SqlCommand SqlCmd = new SqlCommand(query.ToString(), sqlCon);
                    using SqlDataReader reader = SqlCmd.ExecuteReader();
                    while (reader.Read())
                    {
                        User_ID.Add((int)reader[0]);
                        User_Name.Add(String.Format("{0}", reader[1]));
                        Access.Add((int)reader[2]);
                    }
                    sqlCon.Close();
                }
                break;

            // Site_ID users
            case 1:
                query.Append(tblSiteUsers);
                query.Append(" WHERE Site_ID = ");
                query.Append(site_id.ToString());
                // Get list of User_ID's
                using (SqlConnection sqlCon = new SqlConnection(connString))
                {
                    sqlCon.Open();
                    SqlCommand SqlCmd = new SqlCommand(query.ToString(), sqlCon);
                    using SqlDataReader reader = SqlCmd.ExecuteReader();
                    while (reader.Read())
                    {
                        Site_User_ID.Add((long)reader[0]);
                        Site_ID.Add((long)reader[1]);
                        site_users.Add((int)reader[2]);
                        User_ID.Add((int)reader[2]);
                        View_Resources.Add((bool)reader[3]);
                        Add_Resources.Add((bool)reader[4]);
                        Modify_Resources.Add((bool)reader[5]);
                        Del_Resources.Add((bool)reader[6]);
                        View_Tickets.Add((bool)reader[7]);
                        Add_Tickets.Add((bool)reader[8]);
                        Mark_Delete.Add(false);
                    }
                    sqlCon.Close();
                }

                // Convert that list to actual names for display
                foreach (int id in site_users)
                {
                    query.Clear();
                    query.Append("SELECT * FROM ");
                    query.Append(tblUserInfo);
                    query.Append(" WHERE User_ID = ");
                    query.Append(id.ToString());
                    using (SqlConnection sqlCon = new SqlConnection(connString))
                    {
                        sqlCon.Open();
                        SqlCommand SqlCmd = new SqlCommand(query.ToString(), sqlCon);
                        using SqlDataReader reader = SqlCmd.ExecuteReader();
                        while (reader.Read())
                        {
                            User_Name.Add(String.Format("{0}", reader[1]));
                        }
                        sqlCon.Close();
                    }
                }
                break;
            }
        }
        private void btn_Save_Click(object sender, EventArgs e)
        {
            if (txt_Apn.Text != "" && txt_Apn.Text.Length > 0)
            {
                StringBuilder bs = new StringBuilder();
                bs.AppendLine("ORDER NO #      :" + " " + txt_OrderNo.Text.ToString());
                bs.AppendLine("ADDRESS		   :"+ " " + txt_Address.Text.ToString());
                bs.AppendLine("COUNTY		   :"+ " " + txt_County.Text.ToString());
                bs.AppendLine("APN		       :"+ " " + txt_Apn.Text.ToString());
                bs.AppendLine("BORROWER NAME   :" + " " + txt_BorrowerName.Text.ToString());
                bs.AppendLine("EFFECTIVE DATE  :" + " " + txt_Effective_date.Text.ToString());
                bs.AppendLine(Environment.NewLine);
                bs.AppendLine("Names Run	   :"+ "" + Environment.NewLine);
                bs.AppendLine(txt_Names_Run.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Legal Reference :" + " " + txt_LegalRef.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Data Depth      :" + " " + txt_DataDepth.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Open Items:" + "" + Environment.NewLine);
                bs.AppendLine("Deeds:   " + "" + Environment.NewLine);
                bs.AppendLine(txt_Deeds.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Mortgages:   " + "" + Environment.NewLine);
                bs.AppendLine(txt_Mortgages.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Judgments/Liens: " + "" + Environment.NewLine);
                bs.AppendLine(txt_JudgmentLies.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Additional documents : " + "" + Environment.NewLine);
                bs.AppendLine(txt_Additional_Documents.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Closed Items:" + "" + Environment.NewLine);
                bs.AppendLine(txt_Closed_Items.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("General Comments:" + "" + Environment.NewLine);
                bs.AppendLine(txt_Comments.Text.ToString() + "" + Environment.NewLine);
                bs.AppendLine("Client instructions/requirements:" + "" + Environment.NewLine);
                bs.AppendLine(txt_client_Instructions.Text.ToString() + "" + Environment.NewLine);
                if (Directory.Exists(@"C:\OMS_Notes"))
                {
                    src = @"C:\OMS_Notes\Searcher Notes-" + User_Name.ToString() + ".txt";
                    des = @"\\192.168.12.33\oms\" + Client + @"\" + Subclient + @"\" + OrderId + @"\Searcher Notes-" + User_Name.ToString() + ".txt";

                    src_qc = @"C:\OMS_Notes\Searcher QC Notes-" + User_Name.ToString() + ".txt";
                    des_qc = @"\\192.168.12.33\oms\" + Client + @"\" + Subclient + @"\" + OrderId + @"\Searcher QC Notes-" + User_Name.ToString() + ".txt";
                }
                else
                {
                    //strisrc1=@"C:\OMS_Notes";
                    Directory.CreateDirectory(@"C:\OMS_Notes"); //Directory.CreateDirectory(src_qc);
                    src = @"C:\OMS_Notes\Searcher Notes-" + User_Name.ToString() + ".txt";
                    des = @"\\192.168.12.33\oms\" + Client + @"\" + Subclient + @"\" + OrderId + @"\Searcher Notes-" + User_Name.ToString() + ".txt";

                    src_qc = @"C:\OMS_Notes\Searcher QC Notes-" + User_Name.ToString() + ".txt";
                    des_qc = @"\\192.168.12.33\oms\" + Client + @"\" + Subclient + @"\" + OrderId + @"\Searcher QC Notes-" + User_Name.ToString() + ".txt";
                }



                Directory.CreateDirectory(@"\\192.168.12.33\oms\" + Client + @"\" + Subclient + @"\" + OrderId);
                DirectoryEntry de = new DirectoryEntry(@"\\192.168.12.33\oms\" + Client + @"\" + Subclient + @"\" + OrderId, "administrator", "password1$");
                de.Username = "******";
                de.Password = "******";

                if (Order_Task == "2")
                {
                    FileStream fs = new FileStream(src, FileMode.Append, FileAccess.Write, FileShare.Write);
                    fs.Flush();
                    fs.Close();
                    File.WriteAllText(src, bs.ToString());
                    File.Copy(src, des, true);
                    System.IO.FileInfo f  = new System.IO.FileInfo(src);
                    System.IO.FileInfo f1 = new System.IO.FileInfo(des);
                    filesize       = f.Length;
                    file_extension = f.Extension;
                }
                else if (Order_Task == "3")
                {
                    FileStream fs = new FileStream(src_qc, FileMode.Append, FileAccess.Write, FileShare.Write);
                    fs.Flush();
                    fs.Close();
                    File.WriteAllText(src_qc, bs.ToString());
                    File.Copy(src_qc, des_qc, true);
                    System.IO.FileInfo f  = new System.IO.FileInfo(src_qc);
                    System.IO.FileInfo f1 = new System.IO.FileInfo(des_qc);
                    filesize       = f.Length;
                    file_extension = f.Extension;
                }



                GetFileSize(filesize);


                if (Order_Searcherid != 0 && Order_Taskid == int.Parse(Order_Task.ToString()) && Inserted_User_Id != 0)
                {
                    Hashtable htup = new Hashtable();
                    DataTable dtup = new DataTable();

                    htup.Add("@Trans", "CHECK_EXIST_DOCUMENT");
                    htup.Add("@OrderId", OrderId);
                    if (Order_Task == "2")
                    {
                        htup.Add("@Document_Name", "Searcher Notes");
                    }
                    else if (Order_Task == "3")
                    {
                        htup.Add("@Document_Name", "Search_QC Notes");
                    }
                    dtup = dataaccess.ExecuteSP("Sp_Order_Searcher_Notes", htup);
                    if (dtup.Rows.Count > 0)
                    {
                        //UPDATE_DOCUMENT_PATH
                        htup.Clear(); dtup.Clear();
                        htup.Add("@Trans", "UPDATE_DOCUMENT_PATH");
                        if (Order_Task == "2")
                        {
                            htup.Add("@Document_Path", des);
                        }
                        else if (Order_Task == "3")
                        {
                            htup.Add("@Document_Path", des_qc);
                        }
                        htup.Add("@OrderId", OrderId);
                        dtup = dataaccess.ExecuteSP("Sp_Order_Searcher_Notes", htup);
                    }
                    else
                    {
                        //INSERT
                        htup.Clear(); dtup.Clear();
                        htup.Add("@Trans", "INSERT");

                        htup.Add("@Order_ID", int.Parse(OrderId.ToString()));
                        htup.Add("@File_Size", File_size);
                        if (Order_Task == "2")
                        {
                            htup.Add("@Instuction", "Searcher Notes");
                            htup.Add("@Document_Path", des);
                            htup.Add("@Document_Name", "Searcher Notes");
                        }
                        else if (Order_Task == "3")
                        {
                            htup.Add("@Instuction", "Search_QC Notes");
                            htup.Add("@Document_Path", des_qc);
                            htup.Add("@Document_Name", "Search_QC Notes");
                        }
                        htup.Add("@Extension", file_extension);

                        htup.Add("@Inserted_By", User_Id);
                        htup.Add("@Inserted_date", DateTime.Now);
                        dtup = dataaccess.ExecuteSP("Sp_Document_Upload", htup);
                    }
                    //update the order search notes record
                    htup.Clear(); dtup.Clear();
                    htup.Add("@Trans", "UPDATE_NOTES");
                    htup.Add("@Order_Searcher_Notes_Id", Order_Searcherid);
                    htup.Add("@Names_Run", txt_Names_Run.Text);
                    htup.Add("@Effective_Date", txt_Effective_date.Text);

                    htup.Add("@Legal_Reference", txt_LegalRef.Text);
                    htup.Add("@Data_Depth", txt_DataDepth.Text);
                    htup.Add("@Deeds", txt_Deeds.Text);
                    htup.Add("@Mortgages", txt_Mortgages.Text);
                    htup.Add("@Judgments_Liens", txt_JudgmentLies.Text);
                    htup.Add("@Closed_Items", txt_Closed_Items.Text);
                    htup.Add("@General_Comments", txt_Comments.Text);
                    htup.Add("@Client_Instruction", txt_client_Instructions.Text);
                    htup.Add("@Additional_Documents", txt_Additional_Documents.Text);
                    htup.Add("@Modified_by", User_Id);
                    //htup.Add("@OrderId", OrderId);
                    dtup = dataaccess.ExecuteSP("Sp_Order_Searcher_Notes", htup);
                    MessageBox.Show("Record Updated Successfully");
                }
                else if (Order_Taskid != int.Parse(Order_Task.ToString()))
                {
                    Hashtable htin = new Hashtable();
                    DataTable dtin = new DataTable();

                    htin.Add("@Trans", "CHECK_EXIST_DOCUMENT");
                    htin.Add("@OrderId", OrderId);
                    if (Order_Task == "2")
                    {
                        htin.Add("@Document_Name", "Searcher Notes");
                    }
                    else if (Order_Task == "3")
                    {
                        htin.Add("@Document_Name", "Search_QC Notes");
                    }
                    dtin = dataaccess.ExecuteSP("Sp_Order_Searcher_Notes", htin);
                    if (dtin.Rows.Count > 0)
                    {
                        //UPDATE_DOCUMENT_PATH
                        htin.Clear(); dtin.Clear();
                        htin.Add("@Trans", "UPDATE_DOCUMENT_PATH");
                        if (Order_Task == "2")
                        {
                            htin.Add("@Document_Path", des);
                        }
                        else if (Order_Task == "3")
                        {
                            htin.Add("@Document_Path", des_qc);
                        }
                        htin.Add("@OrderId", OrderId);
                        dtin = dataaccess.ExecuteSP("Sp_Order_Searcher_Notes", htin);
                    }
                    else
                    {
                        //INSERT
                        htin.Clear(); dtin.Clear();
                        htin.Add("@Trans", "INSERT");

                        htin.Add("@Order_ID", int.Parse(OrderId.ToString()));
                        htin.Add("@File_Size", File_size);
                        if (Order_Task == "2")
                        {
                            htin.Add("@Instuction", "Searcher Notes");
                            htin.Add("@Document_Path", des);
                            htin.Add("@Document_Name", "Searcher Notes");
                        }
                        else if (Order_Task == "3")
                        {
                            htin.Add("@Instuction", "Search_QC Notes");
                            htin.Add("@Document_Path", des_qc);
                            htin.Add("@Document_Name", "Search_QC Notes");
                        }
                        htin.Add("@Extension", file_extension);

                        htin.Add("@Inserted_By", User_Id);
                        htin.Add("@Inserted_date", DateTime.Now);
                        dtin = dataaccess.ExecuteSP("Sp_Document_Upload", htin);
                    }

                    htin.Clear(); htin.Clear();

                    //insert

                    htin.Add("@Trans", "INSERT_NOTES");
                    htin.Add("@Names_Run", txt_Names_Run.Text);
                    htin.Add("@Effective_Date", txt_Effective_date.Text);
                    htin.Add("@Legal_Reference", txt_LegalRef.Text);
                    htin.Add("@Data_Depth", txt_DataDepth.Text);
                    htin.Add("@Deeds", txt_Deeds.Text);
                    htin.Add("@Mortgages", txt_Mortgages.Text);
                    htin.Add("@Judgments_Liens", txt_JudgmentLies.Text);
                    htin.Add("@General_Comments", txt_Comments.Text);
                    htin.Add("@Closed_Items", txt_Closed_Items.Text);
                    htin.Add("@Inserted_by", User_Id);
                    htin.Add("@OrderId", OrderId.ToString());
                    htin.Add("@Order_Task_Id", int.Parse(Order_Task.ToString()));
                    htin.Add("@Client_Instruction", txt_client_Instructions.Text);
                    htin.Add("@Additional_Documents", txt_Additional_Documents.Text);
                    dtin = dataaccess.ExecuteSP("Sp_Order_Searcher_Notes", htin);


                    //Update APN


                    MessageBox.Show("Record Inserted Successfully");
                }
                Hashtable htapn = new Hashtable();
                DataTable dtapn = new DataTable();

                htapn.Add("@Trans", "UPDATE_APN");
                htapn.Add("@APN", txt_Apn.Text);
                htapn.Add("@Order_ID", OrderId);
                dtapn = dataaccess.ExecuteSP("Sp_Order", htapn);
            }
            else
            {
                MessageBox.Show("Please Enter APN Number");
                txt_Apn.Focus();
            }
        }