예제 #1
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if (fileUpload.HasFile == true)
            {
                RequestData data = new RequestData();

                data.ApproveID   = ddlApprove.SelectedItem.Value;
                data.Subject     = txtSubject.Text;
                data.Description = txtDescription.Text;
                data.CreateBy    = hdUserName.Value;
                data.Path_File   = path_file + fileUpload.PostedFile.FileName;

                RequestDAL dal    = new RequestDAL();
                string     req_Id = hdReqIdStock.Value;
                bool       check  = dal.RequestInsert(data, req_Id);

                if (check == true)
                {
                    string fileName = Path.GetFileName(fileUpload.PostedFile.FileName);
                    fileUpload.PostedFile.SaveAs(Server.MapPath(path_file) + fileName);

                    this.Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "myscript", "Message_Show('Save Success')", true);

                    Response.Redirect("DisplayStock.aspx?ReqId=" + req_Id);
                }
            }
            else
            {
                //เป็นฟังก์ชัน javascript เรียกที่ main.master
                //RegisterClientScriptBlock(typeof(Page), "myscript", "ชื่อฟังก์ชัน", true);
                this.Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "myscript", "Message_Show('กรุณาอัพโหลดไฟล์')", true);
            }
        }//btnSend_Click
예제 #2
0
        /// <summary>
        /// Date Created:   04/10/2011
        /// Created By:     Josephine Gad
        /// (description)   Insert hotel/vehicle request
        /// ---------------------------------------------
        /// </summary>
        /// <param name="RequestID"></param>
        /// <param name="SeafarerId"></param>
        /// <param name="VesselId"></param>
        /// <param name="OnOffDate"></param>
        /// <param name="Status"></param>
        /// <param name="IsNeedHotel"></param>
        /// <param name="BranchID"></param>
        /// <param name="CheckInDate"></param>
        /// <param name="CheckOutDate"></param>
        /// <param name="IsNeedTransportation"></param>
        /// <param name="Origin"></param>
        /// <param name="OriginRemarks"></param>
        /// <param name="Destination"></param>
        /// <param name="DestinationRemarks"></param>
        /// <param name="PickupDate"></param>
        /// <param name="PortId"></param>
        /// <param name="CityID"></param>
        /// <param name="PortAgentId"></param>
        /// <param name="CostCenterID"></param>
        /// <param name="RankID"></param>
        /// <param name="User"></param>
        public static Int32 RequestInsert(string RequestID, string SeafarerId,
                                          string VesselId, string OnOffDate, string Status, bool IsNeedHotel,
                                          string BranchID, string CheckInDate, string CheckOutDate, bool IsNeedTransportation,
                                          string Origin, string OriginRemarks, string Destination, string DestinationRemarks, string PickupDate,
                                          string PortId, string CityID, string PortAgentId, string CostCenterID, string RankID, string User)
        {
            Int32 pRequestID = 0;

            pRequestID = RequestDAL.RequestInsert(RequestID, SeafarerId, VesselId, OnOffDate, Status,
                                                  IsNeedHotel, BranchID, CheckInDate, CheckOutDate, IsNeedTransportation,
                                                  Origin, OriginRemarks, Destination, DestinationRemarks, PickupDate, PortId, CityID,
                                                  PortAgentId, CostCenterID, RankID, User);
            return(pRequestID);
        }