示例#1
0
        private string UpdateLastDate(string id)
        {
            sqlConnection con = sqlConnection.Instance;

            con.sqlCommand("UpdateLastDate");
            con.InsertValstring("@id", id);
            con.InsertValDate("@lastdate", DateTime.Now.Date);
            return(con.getVal("@result"));
        }
示例#2
0
        public string AddPartyMember()
        {
            con.sqlCommand("newMemberParty");

            con.InsertValint("@member", MemberCode);
            con.InsertValstring("@partyn", PartyName);
            con.InsertValstring("@name", FName);
            con.InsertValstring("@lastn", LName);
            con.InsertValDate("@dateT", GetDob());
            con.InsertValint("@list", ListPlace);
            con.InsertValstring("@ediction", Education);
            con.InsertValstring("@exp", Experience);
            return(con.getVal("@Result").ToString());
        }
        public string updateAreaManager(string id, string name, string lastname, string username, string password, DateTime birthDay, string addres, string area, string city, string tell)
        {
            sqlConnection con = sqlConnection.Instance;

            con.sqlCommand("updateAreaManager");
            con.InsertValstring("@idVoter", id);
            con.InsertValstring("@name", name);
            con.InsertValstring("@lastname", lastname);
            con.InsertValstring("@username", username);
            con.InsertValstring("@password", password);
            con.InsertValDate("@birthDay", birthDay);
            con.InsertValstring("@address", addres);
            con.InsertValstring("@area", area);
            con.InsertValstring("@city", city);
            con.InsertValstring("@tell", tell);
            return(con.getVal("@Result"));
        }
示例#4
0
        //Returns Result as int (1/0) if the action succeeded or not.
        public int AddNewKalpiManagerToArea(string id, string fname, string lname, string username, string password, DateTime birthDay, string address, string city, string tell, string area, string kalpiCode)
        {
            con.sqlCommand("AddNewKalpiManagerToArea"); //set new kalpi manager to area SQL query.

            con.InsertValstring("@id", id.ToString());
            con.InsertValstring("@fname", fname);
            con.InsertValstring("@lname", lname);
            con.InsertValstring("@username", username);
            con.InsertValstring("@password", password);
            con.InsertValstring("@permission", "2");
            con.InsertValDate("@birthDay", birthDay);
            con.InsertValstring("@city", city);
            con.InsertValstring("@address", address);
            con.InsertValstring("@area", area);
            con.InsertValstring("@kalpiCode", kalpiCode);
            con.InsertValstring("@tell", tell);

            return(int.Parse(con.getVal("Result").ToString()));
        }
        //Update worker to Commissioner
        public string updateWorker(string id, string kalpiCode, string name, string lastname, string username, string password, string permission, DateTime birthDay, string addres, string area, string city, string tell)
        {
            Voter         worker = new Voter(id, kalpiCode, name, lastname, username, password, permission, birthDay, addres, area, city, tell, "Commissioner", true, false, true);
            sqlConnection con    = sqlConnection.Instance;

            con.sqlCommand("updateWorker");
            con.InsertValstring("@idVoter", worker.Id);
            con.InsertValstring("@kalpiCode", worker.KalpiCode);
            con.InsertValstring("@name", worker.FName);
            con.InsertValstring("@lastname", worker.LName);
            con.InsertValstring("@username", worker.username);
            con.InsertValstring("@password", worker.Passowrd);
            con.InsertValstring("@permission", worker.Permission);
            con.InsertValstring("@address", worker.Address);
            con.InsertValstring("@area", worker.Area);
            con.InsertValstring("@city", worker.City);
            con.InsertValDate("@birthDay", worker.DOB);
            con.InsertValstring("@tell", worker.Tell);
            return(con.getVal("@Result"));
        }