protected void UpdateButton_Click(object sender, EventArgs e)
    {
        DropDownList  ddl       = (DropDownList)FormView1.FindControl("DropDownList1");
        TextBox       txtten    = (TextBox)FormView1.FindControl("TenTPTextBox");
        TextBox       txtgia    = (TextBox)FormView1.FindControl("DongiaTextBox");
        TextBox       txtslc    = (TextBox)FormView1.FindControl("SoluongcoTextBox");
        TextBox       txtmota   = (TextBox)FormView1.FindControl("MotaTextBox");
        Image         imgName   = (Image)FormView1.FindControl("Image1");
        Label         lblmatp   = (Label)FormView1.FindControl("MaTPLabel1");
        SqlDataSource sqlUpdate = (SqlDataSource)FormView1.FindControl("sqlUpdateTP");
        string        urlAnh    = fileanh;

        string ten    = txtten.Text.Trim();
        string gia    = txtgia.Text.Trim();
        string slc    = txtslc.Text.Trim();
        string mota   = txtmota.Text.Trim();
        string maloai = ddl.SelectedValue;
        string matp   = lblmatp.Text;

        if (fileanh == null)
        {
            sqlUpdate.UpdateCommand = "UPDATE tblThucpham SET TenTP = N'" + ten + "', Dongia = '" + gia + "', Mota = N'" + mota + "', Soluongco = '" + slc + "' WHERE MaTP = '" + matp + "'";
            sqlUpdate.Update();
            Response.Redirect("Admin_Chitietthucpham.aspx?MaTP=" + matp);
        }
        else
        {
            sqlUpdate.UpdateCommand = "UPDATE tblThucpham SET TenTP = N'" + ten + "', Dongia = '" + gia + "', Mota = N'" + mota + "', Soluongco = '" + slc + "', urlAnh = '" + urlAnh + "' WHERE MaTP = '" + matp + "'";
            sqlUpdate.Update();
            Response.Redirect("Admin_Chitietthucpham.aspx?MaTP=" + matp);
        }
    }
Ejemplo n.º 2
0
    protected void btnAddCatManJob_Click(object sender, EventArgs e)
    {
        string vettedCreateJobText = Regex.Replace(txtCreateJob.Text.ToLower(), @"[\s]+", "");

        try
        {
            if (vettedCreateJobText != null && vettedCreateJobText != "" && vettedCreateJobText.Length <= 50)
            {
                sds.ConnectionString = Resources.ConnectionStrings.ATHENA;

                sds.SelectCommand = Resources.CatalogManagerSQLQueries.VerifyRegexSelect;
                DataSourceSelectArguments dssa = new DataSourceSelectArguments();
                dssa.AddSupportedCapabilities(DataSourceCapabilities.RetrieveTotalRowCount);
                dssa.RetrieveTotalRowCount = true;
                DataView dv = (DataView)sds.Select(dssa);

                if (dv.Count == 0)
                {
                    sds.InsertCommand = Resources.CatalogManagerSQLQueries.InsertCleanValues;
                    sds.Insert();

                    sds.UpdateCommand = Resources.CatalogManagerSQLQueries.UpdateJobs;
                    sds.Update();
                }
            }
            txtCreateJob.Text = String.Empty;
        }
        catch (InvalidCastException ex) { }
    }
Ejemplo n.º 3
0
    public string updateRoom(RoomData updateData, string old_campus, string old_building)
    {
        string response = "";

        try
        {
            ConnectDB     db        = new ConnectDB();
            SqlDataSource oracleObj = db.ConnectionOracle();

            string sql = "Update ROOM Set ROOM_THAINAME='" + updateData.Room_ThaiName + "',ROOM_ENGNAME='" + updateData.Room_EngName + "',ROOM_TYPE_CODE='" + updateData.RoomType_Code + "',ROOM_CAPACITY=" + updateData.Room_CAPACITY + ",CAMPUS_CODE='" + updateData.Campus_Code + "',BUILDING_CODE='" + updateData.Building_Code + "',FACULTY_CODE='" + updateData.Faculty_Code + "',DEPARTMENT_CODE='" + updateData.Department_Code + "',AFFIATION_CODE='" + updateData.Affiation_Code + "',ROOM_STATUS='" + updateData.Room_Status + "' Where ROOM_CODE='" + updateData.Room_Code + "' AND CAMPUS_CODE='" + old_campus + "' AND BUILDING_CODE='" + old_building + "' ";

            oracleObj.UpdateCommand = sql;

            try
            {
                if (oracleObj.Update() == 1)
                {
                    response = "OK";

                    oracleObj.UpdateCommand = "Update ROOM Set ROOM_TYPE_CODE='" + updateData.RoomType_Code + "',CAMPUS_CODE='" + updateData.Campus_Code + "',BUILDING_CODE='" + updateData.Building_Code + "',FACULTY_CODE='" + updateData.Faculty_Code + "',DEPARTMENT_CODE='" + updateData.Department_Code + "',AFFIATION_CODE='" + updateData.Affiation_Code + "',ROOM_STATUS='" + updateData.Room_Status + "' Where PARENT_ROOM_CODE='" + updateData.Room_Code + "' AND CAMPUS_CODE='" + old_campus + "' AND BUILDING_CODE='" + old_building + "' ";
                    oracleObj.Update();
                }
            }
            catch (Exception e)
            {
                response = e.Message.ToString() + " ";
            }
        }
        catch
        {
            HttpContext.Current.Session["response"] = "Unit Test:Room:updateRoom" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }
        return(response);
    }
Ejemplo n.º 4
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string        ID             = Request.QueryString["id"];
            SqlDataSource SqlDataSource2 = new SqlDataSource();

            SqlDataSource2.ID = "SqlDataSource2";
            this.Page.Controls.Add(SqlDataSource2);
            SqlDataSource2.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["memorialtagConnectionString"].ConnectionString;


            if (RadioButton1.Checked == true)
            {
                SqlDataSource2.UpdateCommand = "UPDATE [memorialtag].[dbo].[GravTabel] SET Valid = '1' where GravID ='" + ID + "'";
                //SqlDataSource2.UpdateParameters.Add("Vaild", "1");

                SqlDataSource2.Update();
            }
            if (RadioButton2.Checked == true)
            {
                SqlDataSource2.UpdateCommand = "UPDATE [memorialtag].[dbo].[GravTabel] SET Valid = '0' where GravID ='" + ID + "'";
                //SqlDataSource2.UpdateParameters.Add("Vaild", "1");

                SqlDataSource2.Update();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// แก้ไขข้อมูลจากตาราง MAJOR
        /// </summary>
        /// <param name="updateData">Major Object</param>
        /// <returns>Success</returns>
        public string updateMajor(Major updateData)
        {
            string        response  = "";
            ConnectDB     db        = new ConnectDB();
            SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

            string sql = "Update MAJOR Set MAJORTHNAME = '" + updateData.MajorThName + "', MAJORENNAME = '" + updateData.MajorEnName + "' Where MAJORCODE = '" + updateData.MajorCode + "' And CURRCODE = '" + updateData.CurrCode + "' And YEARVERSION = '" + updateData.YearVersion + "'";

            oracleObj.UpdateCommand = sql;

            try
            {
                if (oracleObj.Update() == 1)
                {
                    response = "Success";
                }
            }
            catch (Exception e)
            {
                string exception = e.Message;
                HttpContext.Current.Session["response"] = "updateMajor: " + exception;
                HttpContext.Current.Response.Redirect("../err_response.aspx");
            }

            return(response);
        }
Ejemplo n.º 6
0
    public string updateWorkLoadConfig(WorkLoadConfigData updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "Update WorkLoadConfig Set HourReference=" + updateData.HourReference + ", TotalCredit=" + updateData.TotalCredit + " Where LecturerType='" + updateData.LecturerType + "' And LecturerPosition='" + updateData.LecturerPosition + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
            HttpContext.Current.Session["response"] = "Unit Test:WorkLoadConfig:updateWorkLoadConfig" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 7
0
    public string updateAdmissionType(AdmissionTypeData updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "Update ADMISSION_TYPE Set ADMISSIONTYPE_THAI = '" + updateData.AdmissionType_Thai + "', ADMISSIONTYPE_ENG='" + updateData.AdmissionType_Eng + "' Where ADMISSIONTYPE_CODE='" + updateData.AdmissionType_Code + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
            HttpContext.Current.Session["response"] = "Unit Test:System Config: " + response;
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง TQF2SEC3STRUCTUREGROUP
    /// </summary>
    /// <param name="updateData">TQF2Sec3StructureGroupCategory Object</param>
    /// <returns>Success</returns>
    public string updateTQF2Sec3StructureGroup(TQF2Sec3StructureGroup updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update TQF2SEC3STRUCTUREGROUP Set GROUPCREDITS = '" + updateData.GroupCredits + "',  COURSEGROUPFLAG='" + updateData.CourseGroupFlag + "'Where CURRCODE = '" + updateData.CurrCode + "' And YEARVERSION = '" + updateData.YearVersion + "' And CURRFORMATCODE = '" + updateData.CurrFormatCode + "' And CURRTYPECODE = '" + updateData.CurrTypeCode + "' And MAJORCODE = '" + updateData.MajorCode + "' And CATEGORYCODE = '" + updateData.CategoryCode + "' And COURSEGROUPCODE = '" + updateData.CourseGroupCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateTQF2Sec3StructureGroup: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 9
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง CATEGORY
    /// </summary>
    /// <param name="updateData">Category Object</param>
    /// <returns>Success</returns>
    public string updateCategory(Category updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update CATEGORY Set CATEGORYTHNAME = '" + updateData.CategoryThName + "', CATEGORYENNAME = '" + updateData.CategoryEnName + "' Where CATEGORYCODE = '" + updateData.CategoryCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateCategory: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 10
0
        protected void btn_delpic_Click1(object sender, EventArgs e)
        {
            m_FindControl_Control(FormView16, typeof(Image));
            img1 = ((Image)contrl_temp);

            if (img1.ImageUrl.Substring(img1.ImageUrl.LastIndexOf(@"/") + 1).ToLower()
                != "defaultimg.png" &&
                img1.ImageUrl.Substring(img1.ImageUrl.LastIndexOf(@"\") + 1).ToLower()
                != "defaultimg.png")
            {
                string str_expath = System.Web.Hosting.HostingEnvironment.MapPath("~");
                string str_temp   = str_expath + img1.ImageUrl.Substring(3, img1.ImageUrl.Length - 3);
                if (System.IO.File.Exists(str_temp))
                {
                    System.IO.File.Delete(str_temp);
                }


                SqlDataSource sds = new SqlDataSource();
                sds.ConnectionString = str_Data_Source;
                sds.UpdateCommand    = "update T床位系統 set f照片 = null WHERE f照片 ='" + img1.ImageUrl + "'";
                sds.Update();
                Response.Redirect(this.Page.Request.UrlReferrer.ToString());
            }
        }
Ejemplo n.º 11
0
    public string setNewsID_to_FilesData(string files_id, string news_id)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "";

        sql = "Update News_Files SET NEWS_ID='" + news_id + "' Where FILES_ID='" + files_id + "'";
        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
            HttpContext.Current.Session["response"] = "Unit Test:News:setNewsID_to_FilesData" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataSource sqldatasource2 = new SqlDataSource();
            sqldatasource2.ConnectionString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString();
            sqldatasource2.UpdateParameters.Add("Order_date", TextBox1.Text);
            sqldatasource2.UpdateParameters.Add("Assign_numbers", TextBox2.Text);
            sqldatasource2.UpdateParameters.Add("Account_numbers", DropDownList1.Text);
            sqldatasource2.UpdateParameters.Add("Account_abstract", TextBox3.Text);
            sqldatasource2.UpdateParameters.Add("Income", TextBox4.Text);
            sqldatasource2.UpdateParameters.Add("Spend", TextBox5.Text);
            sqldatasource2.UpdateCommand = "Update [Account_Order_M] set Order_date=@Order_date, Account_numbers=@Account_numbers, Assign_numbers=@Assign_numbers, Account_abstract=@Account_abstract, Income=@Income, Spend=@Spend where Id="+Request["Id"];

            int affraw_update = sqldatasource2.Update();

            if (affraw_update == 0)
            {
                Label1.Text = "error";
            }
            else
            {
                Label1.Text = "ok";
                Button1.Visible = false;
            }
            sqldatasource2.Dispose();
    }
Ejemplo n.º 13
0
    //按鈕更新
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        //壓縮圖片並存檔
        CImageProess.get().UploadImage(FileUpload1, 資料夾路徑, CDictionary.SET_BRAND_PX);

        x = new SqlDataSource();
        x.ConnectionString = CDictionary.CONN_URL;

        string sql = "UPDATE Company set ";
        if (!string.IsNullOrEmpty(txtContent.Text))
        {
            sql += " name=N'" + txtName.Text + "', ";
            if (FileUpload1.HasFile)
                sql += " picBrandPath='" + CImageProess.imageName + "', ";
            sql += " manager=N'" + txtManager.Text + "', ";
            sql += " tel=N'" + txtPhone.Text + "', ";
            sql += " sparEmail=N'" + txtSpareEmail.Text + "', ";
            sql += " addr=N'" + txtAddress.Text + "', ";
            sql += " content=N'" + txtContent.Text + "' ";
            sql += "WHERE companyID='" + companyID + "'";

            x.UpdateCommand = sql;
            x.Update();
        }
        else
            return;

        Response.Write("<script>alert('更改資料成功!')</script>");
        Response.Write("<script>location.href='companyCheck.aspx'</script>");
    }
Ejemplo n.º 14
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง SERVICESTATUS
    /// </summary>
    /// <param name="updateData">ServiceStatus Object</param>
    /// <returns>Success</returns>
    public string updateServiceStatus(ServiceStatus updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update SERVICESTATUS Set SERVICESTATUSVALUE = '" + updateData.ServiceStatusValue + "', SERVICESTATUSNAME = '" + updateData.ServiceStatusName + "' Where SERVICESTATUSCODE = '" + updateData.ServiceStatusCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateServiceStatus: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 15
0
    public string updateMajor(MajorData updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "Update MAJOR Set MAJOR_THAINAME = '" + updateData.Major_Thai + "', MAJOR_ENGNAME='" + updateData.Major_Eng + "', MAJOR_SHORTNAME='" + updateData.Major_ShortName + "', DEPARTMENT_CODE='" + updateData.Major_DepartmentCode + "', MAJOR_CODE_STUDENTID='" + updateData.Major_Code_StudentID + "', MAJOR_STATUS='" + updateData.Major_Status + "' Where MAJOR_CODE='" + updateData.Major_Code + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
            HttpContext.Current.Session["response"] = "Unit Test:System Config: " + response;
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 16
0
    public string updateConfig(SystemConfigData config_data)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();
        string        sql       = "Update SYSTEM_CONFIG Set ACADEMIC_YEAR='" + config_data.AcademicYear + "',SEMESTER='" + config_data.Semester + "' ";

        try
        {
            oracleObj.UpdateCommand = sql;


            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch
        {
            HttpContext.Current.Session["response"] = "Unit Test:SystemConfig:updateConfig" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }


        return(response);
    }
Ejemplo n.º 17
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง STUDENT_PROCEEDING
    /// เฉพาะข้อมูล STUDENT_PROCEEDING_TITLE, PROCEEDING_NAME, PROCEEDING_DB_LEVEL, PROCEEDING_DATE
    /// </summary>
    /// <param name="updateData">StudentEnglishTest Object</param>
    /// <returns>OK</returns>
    public string updateStudentProceeding(StudentProceedingData updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "Update STUDENT_PROCEEDING Set STUDENT_PROCEEDING_TITLE = '" + updateData.StudentProceedingTitle + "', PROCEEDING_NAME = '" + updateData.ProceedingName + "', PROCEEDING_DB_LEVEL = '" + updateData.ProceedingDbLevel + "', PROCEEDING_DATE = '" + updateData.ProceedingDate + "' Where STUDENT_PROCEEDING_ID = '" + updateData.StudentProceedingId + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateStudentProceeding: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 18
0
    // ไม่ใช้งาน
    public string updateSummerProject(ProjectData dataUpdate)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        ProjectData field = dataUpdate;
        string      sql   = "Update PROJECT_SUMMER SET THEORY_FEE=" + field.Project_Theory_Fee + ",PRACTICE_FEE=" + field.Project_Practice_Fee + ",THESIS_PROJ_FEE=" + field.Project_ThesisProject_Fee + ",PACKET_FEE=" + field.Project_Packet_Fee + ",NEW_REGIS_FEE=" + field.Project_NewRegister_Fee + ",CARD_FEE=" + field.Project_Card_Fee + ",STUDY_FACILITY_FEE=" + field.Project_StudyFacility_Fee + ",IT_FEE=" + field.Project_IT_Fee + ",HEALTH_FEE=" + field.Project_Health_Fee + ",LIBRARY_FEE=" + field.Project_Library_Fee + ",PROPERTIES_FEE=" + field.Project_Properties_Fee + ",ACCIDENT_FEE=" + field.Project_Accident_Fee + ",ACADEMIC_FEE=" + field.Project_Academic_Fee + ",STUDENT_STATUS_FEE=" + field.Project_StudentStatus_Fee + ",MAINTAINING_FEE=" + field.Project_Maintaining_Fee + ",MORAL_FEE=" + field.Project_Moral_Fee + ",ACTIVITY_FEE=" + field.Project_Activity_Fee + ",CHARGE=" + field.Project_Charge + ",QE_FEE=" + field.Project_QE_Fee + " Where PROJECT_CODE='" + field.Project_Code + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
        }



        return(response);
    }
Ejemplo n.º 19
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง COURSEELECTIVE
    /// </summary>
    /// <param name="updateData">CourseElective Object</param>
    /// <returns>Success</returns>
    public string updateCourseElective(CourseElective updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update COURSEELECTIVE Set COURSEELECTIVETHNAME = '" + updateData.CourseElectiveThName + "', COURSEELECTIVEENNAME = '" + updateData.CourseElectiveEnName + "', CREDIT = '" + updateData.Credit + "' Where ID = '" + updateData.Id + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateCourseElective: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 20
0
    public string updateHourRefer(HourReferData updateData)
        {
        string response = "";
        ConnectDB db = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "Update HOUR_REFER_CONFIG Set HOUR_REF=" + updateData.HourRefer + " Where DEGREE_CHAR='" + updateData.Degree_Char + "' AND COURSE_TYPE='" + updateData.CourseType + "'";

        oracleObj.UpdateCommand = sql;

        try
            {
            if (oracleObj.Update() == 1)
                {
                response = "OK";
                }
            }
        catch (Exception e)
            {
            response = e.Message.ToString();
            HttpContext.Current.Session["response"] = "Unit Test:HourRefer:updateHourRefer" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
            }

        return response;

        }
Ejemplo n.º 21
0
        protected void btnCheckout_Click1(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(payment))
            {
                lblPaymentWarning.Text = "Please Select any Payment Method to complete the buying Process.";
                cod.Focus();
            }
            else
            {
                SqlDataSource SqlDataSource1 = new SqlDataSource();
                SqlDataSource1.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;


                SqlDataSource1.InsertCommand = "INSERT INTO [Order] ([cart_transid], [order_customerName], [order_total], [order_payment],[user_id]) VALUES (@cart_transid, @order_customerName, @order_total, @order_payment, @user_id)";

                SqlDataSource1.InsertParameters.Add("cart_transid", Session["Tid"].ToString());
                SqlDataSource1.InsertParameters.Add("order_customerName", customerName);
                SqlDataSource1.InsertParameters.Add("order_total", totalprice);
                SqlDataSource1.InsertParameters.Add("order_payment", payment.ToString());
                SqlDataSource1.InsertParameters.Add("user_id", Session["Id"].ToString());

                SqlDataSource1.Insert();

                SqlDataSource1.UpdateCommand = @"UPDATE [Cart] SET [cart_status] = @cart_status WHERE [cart_transid] = @cart_transid ";

                SqlDataSource1.UpdateParameters.Add("cart_status", "Paid");
                SqlDataSource1.UpdateParameters.Add("cart_transid", Session["Tid"].ToString());
                SqlDataSource1.Update();

                SqlDataSource1.Dispose();
                Response.Redirect("thankyou.aspx");
            }
        }
Ejemplo n.º 22
0
    // V 1.0.0
    public string updateExamTable(ExamTableData dataUpdate, string degree_char)
    {
        string        TableName = getTableName(degree_char);
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();



        string sql = "Update " + TableName + " Set EXAM_MID_ROOM='" + dataUpdate.ExamMid_Room + "',EXAM_MID_DAY='" + dataUpdate.ExamMid_Day + "',EXAM_MID_START_TIME='" + dataUpdate.ExamMid_StartTime + "',EXAM_MID_END_TIME='" + dataUpdate.ExamMid_EndTime + "',EXAM_FINAL_ROOM='" + dataUpdate.ExamFinal_Room + "',EXAM_FINAL_DAY='" + dataUpdate.ExamFinal_Day + "',EXAM_FINAL_START_TIME='" + dataUpdate.ExamFinal_StartTime + "',EXAM_FINAL_END_TIME='" + dataUpdate.ExamFinal_EndTime + "' Where ACADEMIC_YEAR='" + dataUpdate.AcademicYear + "' And SEMESTER='" + dataUpdate.Semester + "' And COURSE_CODE='" + dataUpdate.Course_Code + "' AND CURR_CODE='" + dataUpdate.Curr_Code + "' AND FAC_CODE='" + dataUpdate.Faculty_Code + "' AND DEP_CODE='" + dataUpdate.Department_Code + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString() + sql;
        }

        return(response);
    }
Ejemplo n.º 23
0
    public string updatePlan(PlanData updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update CURRTYPE Set LEVELCODE = '" + updateData.plan_levalcode + "', CURRTYPENAME='" + updateData.plan_name + "' Where CURRTYPECODE='" + updateData.plan_code + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            response = e.Message.ToString();
            HttpContext.Current.Session["response"] = "Unit Test:Plan: ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 24
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง LECTUREREXPRIENCE
    /// </summary>
    /// <param name="updateData">LecturerExprience Object</param>
    /// <returns>Success</returns>
    public string updateLecturerExprience(LecturerExprience updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update LECTUREREXPRIENCE Set SUBJECTNAME = '" + updateData.SubjectName + "', LECTURERTYPE = '" + updateData.LecturerType + "', BEGINYEAR = '" + updateData.BeginYear + "', ENDYEAR = '" + updateData.EndYear + "', QUITISSUE = '" + updateData.QuitIssue + "' Where EXPRIENCEID = '" + updateData.ExprienceId + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateLecturerExprience: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 25
0
    public string updateAcademicCalendar(AcademicCalendarData insertData)
    {
        string response = "";

        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "";

        try
        {
            sql = "Update Academic_Calendar SET NRL_START_DATE='" + insertData.nrl_start_date + "',NRL_END_DATE='" + insertData.nrl_end_date + "',AD_START_DATE='" + insertData.ad_start_date + "',AD_END_DATE='" + insertData.ad_end_date + "',CH_START_DATE='" + insertData.ch_start_date + "',CH_END_DATE='" + insertData.ch_end_date + "',WT_START_DATE='" + insertData.wt_start_date + "',WT_END_DATE='" + insertData.wt_end_date + "',PP_START_DATE='" + insertData.pp_start_date + "',PP_END_DATE='" + insertData.pp_end_date + "',PPL_START_DATE='" + insertData.ppl_start_date + "',PPL_END_DATE='" + insertData.ppl_end_date + "',PT_START_DATE='" + insertData.pt_start_date + "',PT_END_DATE='" + insertData.pt_end_date + "',PTL_START_DATE='" + insertData.ptl_start_date + "',PTL_END_DATE='" + insertData.ptl_end_date + "',PR_START_DATE='" + insertData.pr_start_date + "',PR_END_DATE='" + insertData.pr_end_date + "',PRL_START_DATE='" + insertData.prl_start_date + "',PRL_END_DATE='" + insertData.prl_end_date + "',RE_START_DATE='" + insertData.re_start_date + "',RE_END_DATE='" + insertData.re_end_date + "',PS_START_DATE='" + insertData.ps_start_date + "',PS_END_DATE='" + insertData.ps_end_date + "',PSL_START_DATE='" + insertData.psl_start_date + "',PSL_END_DATE='" + insertData.psl_end_date + "' Where ACADEMIC_YEAR='" + insertData.academic_year + "' And SEMESTER='" + insertData.semester + "' And DEGREE_CHAR='" + insertData.degree + "'";


            oracleObj.UpdateCommand = sql;


            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch
        {
            HttpContext.Current.Session["response"] = "Unit Test:AcademicCalendar:insertAcademicCalender" + " ไม่สามารถดำเนินการได้ " + sql;
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 26
0
        /// <summary>
        /// แก้ไขข้อมูลจากตาราง DIVISION
        /// </summary>
        /// <param name="updateData">Department Object</param>
        /// <returns>Success</returns>
        public string updateDivision(Division updateData)
        {
            string        response  = "";
            ConnectDB     db        = new ConnectDB();
            SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

            string sql = "Update DIVISION Set DIVISIONTHNAME = '" + updateData.DivisionThName + "', DIVISIONENNAME = '" + updateData.DivisionEnName + "', DIVISIONENSHORTNAME = '" + updateData.DivisionEnShortName + "', DEPARTMENTCODE = '" + updateData.DepartmentCode + "', DIVISION_STATUS = '" + updateData.DivisionStatus + "', DIVISION_CODE_STUDENTID = '" + updateData.DivisionCodeStudent + "' Where DIVISIONCODE = '" + updateData.DivisionCode + "'";

            oracleObj.UpdateCommand = sql;

            try
            {
                if (oracleObj.Update() == 1)
                {
                    response = "Success";
                }
            }
            catch (Exception e)
            {
                string exception = e.Message;
                HttpContext.Current.Session["response"] = "updateDivision: " + exception;
                HttpContext.Current.Response.Redirect("err_response.aspx");
            }

            return(response);
        }
Ejemplo n.º 27
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง ENGLISH_DB
    /// </summary>
    /// <param name="updateData">EnglishDb Object</param>
    /// <returns>OK</returns>
    public string updateEnglishDb(EnglishDbData updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle();

        string sql = "Update ENGLISH_DB Set ENGLSIH_DB_NAME = '" + updateData.EnglishDbName + "' Where ENGLISH_DB_ID = '" + updateData.EnglishDbId + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateEnglishDb: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 28
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง CURRFORMAT
    /// </summary>
    /// <param name="updateData">CurrFormat Object</param>
    /// <returns>Success</returns>
    public string updateCurrFormat(CurrFormat updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update CURRFORMAT Set LEVELCODE = '" + updateData.LevelCode + "', CURRFORMATNAME = '" + updateData.CurrFormatName + "' Where CURRFORMATCODE = '" + updateData.CurrFormatCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateCurrFormat: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 29
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง ABOUTLECTURER
    /// </summary>
    /// <param name="updateData">AboutLecturer Object</param>
    /// <returns>Success</returns>
    public string updateAboutLecturer(AboutLecturer updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update ABOUTLECTURER Set YEARVERSION = '" + updateData.YearVersion + "', LECTIDENTITY = '" + updateData.LectIdentity + "', LOADTYPECODE = '" + updateData.LoadTypeCode + "', SEQUENCE = '" + updateData.Sequence + "', MAJORCODE = '" + updateData.MajorCode + "' Where CURRCODE = '" + updateData.CurrCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateAboutLecturer: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 30
0
    public string cancelExtendStudent(string academic_year, string semester, string course_code, int sec_num, int subsec_num, string student_id, string lecturer_code)
    {
        string response = "";
        string sql      = "";

        try
        {
            ConnectDB     db        = new ConnectDB();
            SqlDataSource oracleObj = db.ConnectionOracle();

            sql = "Update EXTEND_AVAILABLE_STUDENT SET CANCEL_STATUS = '1', LECTURER_CANCEL='" + lecturer_code + "'  Where  ACADEMIC_YEAR = '" + academic_year + "' AND SEMESTER = '" + semester + "' AND COURSE_CODE = '" + course_code + "' AND SEC_NO = " + sec_num + " AND SUBSEC_NO = " + subsec_num + " AND STUDENT_ID = '" + student_id + "' AND CANCEL_STATUS='0' ";

            oracleObj.UpdateCommand = sql;

            if (oracleObj.Update() == 1)
            {
                response = "OK";
            }
            else
            {
                // response = sql;
            }
        }
        catch (Exception err)
        {
            HttpContext.Current.Session["response"] = "Unit Test:ExtendAvailableStudent:insertExtendStudent" + " ไม่สามารถดำเนินการได้";
            HttpContext.Current.Response.Redirect("err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 31
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง COURSEELECTIVEMEMBER
    /// </summary>
    /// <param name="updateData">CourseElectiveMember Object</param>
    /// <returns>Success</returns>
    public string updateCourseElectiveMember(CourseElectiveMember updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update COURSEELECTIVEMEMBER Set COURSECODE = '" + updateData.CourseCode + "', COURSEELECTIVECODE = '" + updateData.CourseElectiveCode + "', FACULTYCODE = '" + updateData.FacultyCode + "', FACULTYOWNER = '" + updateData.FacultyOwner + "' Where COURSEELECTIVEMEMBERCODE = '" + updateData.CourseElectiveMemberCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateCourseElectiveMember: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 32
0
    /// <summary>
    /// แก้ไขข้อมูลจากตาราง SUFLAGE
    /// </summary>
    /// <param name="updateData">SuFlage Object</param>
    /// <returns>Success</returns>
    public string updateSuFlage(SuFlage updateData)
    {
        string        response  = "";
        ConnectDB     db        = new ConnectDB();
        SqlDataSource oracleObj = db.ConnectionOracle_tqf2();

        string sql = "Update SUFLAGE Set SUFLAGNAME = '" + updateData.SuFlageName + "', SUFLAGEENNAME = '" + updateData.SuFlageEnName + "' Where SUFLAGCODE = '" + updateData.SuFlagCode + "'";

        oracleObj.UpdateCommand = sql;

        try
        {
            if (oracleObj.Update() == 1)
            {
                response = "Success";
            }
        }
        catch (Exception e)
        {
            string exception = e.Message;
            HttpContext.Current.Session["response"] = "updateCourseFlag: " + exception;
            HttpContext.Current.Response.Redirect("../err_response.aspx");
        }

        return(response);
    }
Ejemplo n.º 33
0
    protected void btnNewsUpdate_Click(object sender, EventArgs e)
    {
        //actID 已知的活動代碼
        //用where查狀態是否還為"待審中"
        //是待審中再進行更新動作
        //是上架就進行Question 警告使用者 更新後, 將重新送審
        x = new SqlDataSource();
        x.ConnectionString = @"Data Source=iii0.database.windows.net;Initial Catalog=prjTRK;Persist Security Info=True;User ID=iii;Password=P@ssw0rd";
        x.SelectCommand = "Select *from Promotions where activityID ='" + activity.Text + "'";
        DataView dv = x.Select(DataSourceSelectArguments.Empty) as DataView;
        statusID = dv.Table.Rows[0]["statusID"].ToString();

        if (statusID == "3" || statusID == "4")
        {
            //壓縮圖片並存檔
            CImageProess.get().UploadImage(FileUpload1, 資料夾路徑, CDictionary.SET_PROMOTION_PX);

            x = new SqlDataSource();
            x.ConnectionString = @"Data Source=iii0.database.windows.net;Initial Catalog=prjTRK;Persist Security Info=True;User ID=iii;Password=P@ssw0rd";

            string sql = "UPDATE Promotions set ";
            if (!string.IsNullOrEmpty(titleInput.Text))
            {
                sql += " title=N'" + titleInput.Text + "', ";
                if (FileUpload1.HasFile)
                    sql += " picPath='" + CImageProess.imageName + "', ";
                sql += " startDate='" + startDate.Text + "', ";
                sql += " endDate='" + endDate.Text + "', ";
                sql += " onShelfDate = convert(varchar, DATEADD(hour, 8, GETUTCDATE()), 113)," ;
                sql += " statusID = 3 ,";
                sql += " content=N'" + txtNewsContent.Text + "' ";
                sql += " WHERE activityID='" + activity.Text + "'";
                x.UpdateCommand = sql;
                x.Update();
                Response.Redirect("~/windowCompany/companyCheck.aspx");
            }
            else
                return;
        }
        else
            return;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataSource sqldatasource2 = new SqlDataSource();
        sqldatasource2.ConnectionString = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString.ToString();
        sqldatasource2.UpdateParameters.Add("Lottery", DropDownList1.Text);
        sqldatasource2.UpdateCommand = "Update [Account_Order_M] set Lottery=@Lottery where Id=" + Request["Id"];

        int affraw_update = sqldatasource2.Update();

        if (affraw_update == 0)
        {
            Label8.Text = "error";
        }
        else
        {
            Label8.Text = "ok";
            Button1.Visible = false;
        }
        sqldatasource2.Dispose();
    }
Ejemplo n.º 35
0
    public void set_seat()
    {
        String Route1 = Request.QueryString["Route1"];
        String Route2 = Request.QueryString["Route2"];

        String Seat_Q_R1 = Request.QueryString["S_R1"];
        String Seat_Q_R2 = Request.QueryString["S_R2"];
        String[] Seat_R1 = {};
        String[] Seat_R2 = {};

        SqlDataSource seat = new SqlDataSource();
        seat.ConnectionString =
            ConfigurationManager.ConnectionStrings["BusTicketConnectionString1"].ToString();
        seat.UpdateCommand = "UPDATE [Seat] SET [Seat_Status] = @Seat_Status "
            +"WHERE [Route_has_Bus_ID] = @Route_has_Bus_ID AND [Seat_Name] = @Seat_Name";

        if (Seat_Q_R1 != null)
        {
            if (Seat_Q_R1.ToString() != "")
            {
                Seat_R1 = Seat_Q_R1.Split('_');
            }
        }

        if (Seat_Q_R2 != null)
        {
            if (Seat_Q_R2.ToString() != "")
            {
                Seat_R2 = Seat_Q_R2.Split('_');
            }
        }

        if (Route1 != null)
        {
            if (Route1.ToString() != "")
            {
                for (int i = 0; i < Seat_R1.Length; i++)
                {
                    seat.UpdateParameters.Clear();
                    seat.UpdateParameters.Add("Seat_Status", "จอง");
                    seat.UpdateParameters.Add("Route_has_Bus_ID", Route1.ToString());
                    seat.UpdateParameters.Add("Seat_Name", Seat_R1[i]);
                    seat.Update();
                }
            }
        }
        if (Route2 != null)
        {
            if (Route2.ToString() != "")
            {
                for (int i = 0; i < Seat_R2.Length; i++)
                {
                    seat.UpdateParameters.Clear();
                    seat.UpdateParameters.Add("Seat_Status", "จอง");
                    seat.UpdateParameters.Add("Route_has_Bus_ID", Route2.ToString());
                    seat.UpdateParameters.Add("Seat_Name", Seat_R2[i]);
                    seat.Update();
                }
            }
        }
    }