示例#1
0
文件: RP.cs 项目: napoleon789/love_gv
        public void Update_soxo(string giai, string ketqua, string ngay)
        {
            string Command_Insert = "";
            if (giai.ToUpper() == "NHAT")
            {
                Command_Insert = "Insert into SOXO (ngay,nhat) values ('" + ngay + "','" + ketqua + "');";
            }
            else
            {
                Command_Insert = "Update SOXO set  " + giai + " = '" + ketqua + "'  where  ngay='" + ngay + "';";
            }

            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    SqlCommand comm = new SqlCommand(Command_Insert, conn);
                    conn.Open();
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#2
0
文件: RP.cs 项目: napoleon789/love_gv
        public void Update_soxo2(string ngay,string Tinh, string ketqua)
        {
            string Command_Check = "select * from SOXO2 where Ngay='" + ngay + "' and Tinh='" + Tinh + "'";
            string Command_Insert = "Insert into SOXO2 (ngay,tinh,ketqua) values ('" + ngay + "','" + Tinh + "','" + ketqua + "');";
            string Command_Update = "Update SOXO2 set  ketqua = '" + ketqua + "'  where  ngay='" + ngay + "'and tinh='" + Tinh + "';";
            string Command_Exc = "";
            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    conn.Open();
                    SqlDataAdapter adapter = new SqlDataAdapter(Command_Check, conn);
                    DataTable DT = new DataTable();
                    adapter.Fill(DT);
                    if (DT.Rows.Count < 1)
                    {
                        Command_Exc = Command_Insert;
                    }
                    else
                    {
                        Command_Exc = Command_Update;
                    }
                    SqlCommand comm = new SqlCommand(Command_Exc, conn);
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#3
0
文件: RP.cs 项目: napoleon789/love_gv
        public void Update_dichvukhach(string cmdcode, string subcmdcode, string number, string content, string date)
        {
            string Command_insert = "Update Orther set content= '"+content+"' where Command = '" + cmdcode + "' and SubCommand ='" + subcmdcode + "' and Service_num ='" + number + "' and  Ngay ='" + date + "'";
            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    conn.Open();
                    SqlCommand comm = new SqlCommand(Command_insert, conn);
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#4
0
文件: RP.cs 项目: napoleon789/love_gv
        public void Update_Football(string Madichvu, string Magiai, string Stime, string Etime, string Noidung)
        {
            string Command_insert = "Update Football_1 set Noidung = '" + Noidung + "', update_time=getdate() where dichvu = '" + Madichvu + "' and Magiai ='" + Magiai + "' and Stime ='" + Stime + "' and  Etime ='" + Etime + "'; ";
            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    conn.Open();
                    SqlCommand comm = new SqlCommand(Command_insert, conn);
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#5
0
文件: RP.cs 项目: napoleon789/love_gv
        public void Insert_Football(string Madichvu, string Magiai, string Stime, string Etime, string Noidung)
        {
            string Command_insert = "Insert into Football_1 values ('" + Madichvu + "','" + Magiai + "','" + Stime + "','" + Etime + "','" + Noidung + "',getdate())";
            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    conn.Open();
                    SqlCommand comm = new SqlCommand(Command_insert, conn);
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#6
0
文件: RP.cs 项目: napoleon789/love_gv
        public void Insert_dichvukhach(string cmdcode, string subcmdcode, string number,string content, string date)
        {
            string Command_insert = "Insert into Orther values ('" + cmdcode + "','" + subcmdcode + "','" + number + "','" + content + "','" + date + "')";
            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    conn.Open();
                    SqlCommand comm = new SqlCommand(Command_insert, conn);
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#7
0
文件: RP.cs 项目: napoleon789/love_gv
        // GPC MO MTC MT ServiceNum CommandCode
        public void Delete_Football(string Madichvu, string Magiai, string Stime, string Etime)
        {
            string Command_delete = "delete from Football_1 where dichvu = '" + Madichvu + "' and Magiai ='" + Magiai + "' and Stime ='" + Stime + "' and  Etime ='" + Etime + "'; ";
            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    conn.Open();
                    SqlCommand comm = new SqlCommand(Command_delete, conn);
                    comm.ExecuteNonQuery();
                    conn.Close();
                }
                catch
                {

                }
            }
        }
示例#8
0
文件: RP.cs 项目: napoleon789/love_gv
        public static int C_VMS_MTC(string dauso, string malenh, string sdate, string edate)
        {
            string strsql = "SELECT COUNT(*) AS MT FROM dbo.SMS_MT_NEW ";
            //strsql += "WHERE  SMS_MT_NEW.MOID IN (SELECT SMS_MO_NEW.MOID FROM SMS_MO_NEW WHERE((SUBSTRING(SMS_MO_NEW.SRC, 1, 4) IN ('8490', '8493')) OR (SUBSTRING(DEST, 1, 5) IN ('84122', '84126','84121','84128')))";
            strsql += "WHERE opid like 'VMS%'";
            strsql += dauso != "" ? " AND SMS_MT_NEW.src='" + dauso + "'" : "";
            strsql += malenh != "" ? " AND SMS_MT_NEW.Cmdcode ='" + malenh + "'" : "";
            strsql += " AND SMS_MT_NEW.Procresult=1 AND SMS_MT_NEW.MTSeqRef=1 ";
            if (sdate != "" || edate != "") strsql += " AND (CONVERT(datetime,substring(reqtime,1,8),112) Between CONVERT(datetime,'" + sdate + "') And CONVERT(datetime,'" + edate + "')";
            strsql += ")";

            DBAccess db = new DBAccess();
            using (SqlConnection conn = new SqlConnection(db.ConnectionString))
            {
                try
                {
                    SqlDataAdapter mData = new SqlDataAdapter(strsql, conn);
                    DataSet mCount = new DataSet();
                    mData.Fill(mCount);
                    if (Convert.ToInt32(mCount.Tables[0].Rows[0][0]) > 0) return Convert.ToInt32(mCount.Tables[0].Rows[0][0]);
                    else return 0;
                }
                catch
                {
                    return 0;
                }
            }
        }
示例#9
0
文件: RP.cs 项目: napoleon789/love_gv
 public static int C_VMS_MO(string dauso, string malenh, string sdate, string edate)
 {
     string strsql = "SELECT COUNT(*) AS MO FROM dbo.SMS_MO_NEW ";
     //strsql += "WHERE  ((SUBSTRING(SRC, 1, 4) IN ('8490', '8493')) OR (SUBSTRING(SRC, 1, 5) IN ('84122', '84126','84121','84128')))";
     strsql += "WHERE opid like 'VMS%'";
     strsql += dauso != "" ? " AND DEST='" + dauso + "'" :"";
     strsql += malenh != "" ? " AND Cmdcode = '" + malenh + "'" : "";
     if (sdate != "" || edate != "") strsql += " AND CONVERT(datetime,SMS_MO_NEW.Receive_time,103) Between CONVERT(datetime,'" + sdate + "') And CONVERT(datetime,'" + edate + "')";
     DBAccess db = new DBAccess();
     using (SqlConnection conn = new SqlConnection(db.ConnectionString))
     {
         try
         {
             SqlDataAdapter mData = new SqlDataAdapter(strsql, conn);
             DataSet mCount = new DataSet();
             mData.Fill(mCount);
             if (Convert.ToInt32(mCount.Tables[0].Rows[0][0]) > 0) return Convert.ToInt32(mCount.Tables[0].Rows[0][0]);
             else return 0;
         }
         catch
         {
             return 0;
         }
     }
 }