예제 #1
0
        public string userName(string user) //chnage
        {
            OthersBLL other = new OthersBLL();
            string    s     = other.checkUserName(user);

            return(s);
        }
 public string checkUserName(string username) //Change Here
 {
     try
     {
         OthersBLL other = new OthersBLL();
         string    s     = other.checkUserName(username);
         return(s);
     }
     catch
     {
         return("0");
     }
 }
예제 #3
0
 public XmlDocument LocalBodies(int district, int taluka, int localBodyType)
 {
     try
     {
         OthersBLL othersDll = new OthersBLL();
         return(othersDll.getLocalBodies(district, taluka, localBodyType));
     }
     catch
     {
         CommonCode commonCode = new CommonCode();
         return(commonCode.ErrorXml(CommonCode.SQL_ERROR));
     }
 }
예제 #4
0
 public XmlDocument Talukas(int district)
 {
     try
     {
         OthersBLL othersDll = new OthersBLL();
         return(othersDll.getTalukas(district));
     }
     catch
     {
         CommonCode commonCode = new CommonCode();
         return(commonCode.ErrorXml(CommonCode.SQL_ERROR));
     }
 }
예제 #5
0
 public XmlDocument Districts(int state)
 {
     try
     {
         OthersBLL othersDll = new OthersBLL();
         return(othersDll.getDistrict(state));
     }
     catch
     {
         CommonCode commonCode = new CommonCode();
         return(commonCode.ErrorXml(CommonCode.SQL_ERROR));
     }
 }
예제 #6
0
 public XmlDocument getVotersById(string id)
 {
     try
     {
         OthersBLL othersDll = new OthersBLL();
         return(othersDll.getVotersById(id));
     }
     catch
     {
         CommonCode commonCode = new CommonCode();
         return(commonCode.ErrorXml(CommonCode.SQL_ERROR));
     }
 }
예제 #7
0
 public XmlDocument getVoters(string fName, string lName, string localBody)
 {
     try
     {
         OthersBLL othersDll = new OthersBLL();
         return(othersDll.getVotersNames(fName, lName, localBody));
     }
     catch
     {
         CommonCode commonCode = new CommonCode();
         return(commonCode.ErrorXml(CommonCode.SQL_ERROR));
     }
 }
        public string GetResponsibility(string localBody, string wardno, string mobileno) //Change Here
        {
            try
            {
                string[] uregid = mobileno.Split('$');
                mobileno = objenc.DecryptInteger(uregid[0], uregid[1]);

                OthersBLL bll = new OthersBLL();
                return(bll.GetResponsibility(localBody, wardno, mobileno));
            }
            catch
            {
                return("0");
            }
        }
예제 #9
0
        public bool Insert(OthersBLL others)
        {
            bool          isSuccess = false;
            SqlConnection conn      = new SqlConnection(UserDAL.myconnstrng);

            try
            {
                string     sql = "INSERT INTO tbl_Others (others_no, Others, Unit) VALUES (@others_no, @Others, @Unit)";
                SqlCommand cmd = new SqlCommand(sql, conn);

                cmd.Parameters.AddWithValue("@others_no", others.ID);
                cmd.Parameters.AddWithValue("@Others", others.Others);
                cmd.Parameters.AddWithValue("@Unit", others.Unit);

                conn.Open();

                int rows = cmd.ExecuteNonQuery();

                // If the query is executed successfully then the value to rows will be greaten than 0 else it will be less than 0
                if (rows > 0)
                {
                    // Query successful
                    isSuccess = true;
                }
                else
                {
                    // Query failed
                    isSuccess = false;
                }
            }
            catch (Exception ex)
            {
                // Throw message if any error occurs
                MessageBox.Show(ex.Message, "Insert data in Database Information!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                conn.Close();
            }

            return(isSuccess);
        }
예제 #10
0
        public bool Update(OthersBLL others)
        {
            bool          isSuccess = false;
            SqlConnection conn      = new SqlConnection(UserDAL.myconnstrng);

            try
            {
                string     sql = "UPDATE tbl_Others SET Others=@Others, Unit=@Unit WHERE others_no=@others_no";
                SqlCommand cmd = new SqlCommand(sql, conn);

                cmd.Parameters.AddWithValue("@Others", others.Others);
                cmd.Parameters.AddWithValue("@Unit", others.Unit);
                cmd.Parameters.AddWithValue("@others_no", others.ID);

                conn.Open();

                int rows = cmd.ExecuteNonQuery();

                if (rows > 0)
                {
                    // Query successful
                    isSuccess = true;
                }
                else
                {
                    // Query failed
                    isSuccess = false;
                }
            }
            catch (Exception ex)
            {
                // Throw message if any error occurs
                MessageBox.Show(ex.Message, "Update data in Database Information!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                conn.Close();
            }

            return(isSuccess);
        }