Пример #1
0
    protected void btnUploadAttachments_Click(object sender, EventArgs e)
    {
        try
        {
            if (FileUploader1.FileName.Length > 0)
            {
                int CrewID = int.Parse(getQueryString("CrewID"));
                int VoyID  = int.Parse(getQueryString("VoyID"));

                string sFileName = CrewID.ToString() + "_" + VoyID.ToString() + "_2" + ".pdf";

                string Upload_Path = System.Web.HttpContext.Current.Server.MapPath("~/Uploads/CrewDocuments/");
                FileUploader1.SaveAs(Upload_Path + "\\" + sFileName);

                int DocID = objCrewBLL.Insert_CrewAgreementRecord(CrewID, VoyID, 2, 0, "Crew Agreement - Signed by Office", sFileName, sFileName, GetSessionUserID());

                Load_Agreements();
                Load_Agreement_Status();
            }
        }
        catch (Exception ex)
        {
            string js = "alert('Error in saving data!! Error: " + ex.Message + "');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "errorsaving", js, true);
        }
    }
Пример #2
0
    protected void lnkAttachedFile_Click(object sender, EventArgs e)
    {
        try
        {
            if (FileUploader1.HasFile)
            {
                str1 = System.IO.Path.GetFileName(FileUploader1.PostedFile.FileName);
                FileUploader1.SaveAs(Server.MapPath("~/TempAttachment/") + str1);

                path1 = Server.MapPath("~/TempAttachment/") + str1;
                ChkAttach1.Visible    = true;
                ChkAttach1.Checked    = true;
                ChkAttach1.Text       = str1;
                FileUploader1.Visible = false;
            }
            if (FileUpload2.HasFile)
            {
                str2 = System.IO.Path.GetFileName(FileUpload2.PostedFile.FileName);
                FileUpload2.SaveAs(Server.MapPath("~/TempAttachment/") + str2);

                path2 = Server.MapPath("~/TempAttachment/") + str2;
                ChkAttach2.Visible  = true;
                ChkAttach2.Checked  = true;
                ChkAttach2.Text     = str2;
                FileUpload2.Visible = false;
            }
            if (FileUpload3.HasFile)
            {
                str3 = System.IO.Path.GetFileName(FileUpload3.PostedFile.FileName);
                FileUpload3.SaveAs(Server.MapPath("~/TempAttachment/") + str3);

                path3 = Server.MapPath("~/TempAttachment/") + str3;
                ChkAttach3.Visible  = true;
                ChkAttach3.Checked  = true;
                ChkAttach3.Text     = str3;
                FileUpload3.Visible = false;
            }
            if (path1 != "" && path2 != "" && path3 != "")
            {
                lnkAttachedFile.Visible = false;
            }
        }

        catch (Exception ex)
        {
            obj_Comman.ShowPopUpMsg("Files Not Attched, Please try Again..", this.Page);
        }
    }
Пример #3
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        //注册信息
        Tz888.BLL.Login.LoginInfoBLL objInfo1 = new Tz888.BLL.Login.LoginInfoBLL();
        //登记联系人


        Tz888.BLL.Register.common            objInfo2   = new Tz888.BLL.Register.common();
        Tz888.Model.Register.OrgContactModel modelInfo2 = new Tz888.Model.Register.OrgContactModel();
        //会员信息表


        Tz888.Model.Register.MemberInfoModel modelInfo3 = new Tz888.Model.Register.MemberInfoModel();
        Tz888.BLL.Register.MemberInfoBLL     objInfo3   = new Tz888.BLL.Register.MemberInfoBLL();

        #region  信息赋值



        string LoginName  = this.ViewState["LoginMemberName"].ToString();
        string MemberName = txtMemberName.Text.Trim();
        bool   Sex        = Convert.ToBoolean(rblSex.SelectedValue);
        string NickName   = lbNickName.Text;

        string Address      = txtAddress.Text;
        string PostCode     = txtPostCode.Text;
        string Mobile       = txtMobile.Text;
        string ManageTypeID = this.ViewState["ManageTypeID"].ToString();

        #region 注册信息
        modelInfo3.MemberID          = 0;
        modelInfo3.LoginName         = this.ViewState["LoginMemberName"].ToString();
        modelInfo3.MemberName        = MemberName;
        modelInfo3.Sex               = Sex;
        modelInfo3.NickName          = NickName;
        modelInfo3.Birthday          = DateTime.Now;
        modelInfo3.CertificateID     = "";
        modelInfo3.CertificateNumber = "";
        modelInfo3.CountryCode       = "";
        modelInfo3.ProvinceID        = "";
        modelInfo3.CountyID          = "";
        modelInfo3.Address           = Address;
        modelInfo3.PostCode          = PostCode;
        modelInfo3.Tel               = txtTelCountry.Text + "-" + txtTelZoneCode.Text + "-" + txtTelNumber.Text;
        modelInfo3.Mobile            = txtMobile.Text;
        modelInfo3.FAX               = txtFaxCountry.Text + "-" + txtFaxZoneCode.Text + "-" + txtFaxNumber.Text;
        modelInfo3.Email             = txtEmail.Text;
        modelInfo3.IsSecurity        = false;
        modelInfo3.ManageTypeID      = ManageTypeID;

        string strRequirInfo = "";
        foreach (ListItem li in ChkLstRequirInfo.Items)
        {
            if (li.Selected && li.Enabled)
            {
                strRequirInfo = strRequirInfo + li.Value.ToString().Trim() + ",";
            }
        }
        if (strRequirInfo == "")
        {
            Tz888.Common.MessageBox.Show(this.Page, "请选择您的用户意向。");
        }
        modelInfo3.RequirInfo = strRequirInfo;

        modelInfo3.RequirInfoDesc = "";

        //保存头像
        string Pic1 = "";
        try
        {
            string[] UploadImgFileName = FileUploader1.SaveImages("MemberHead");

            if (UploadImgFileName.Length > 0)
            {
                Pic1 = UploadImgFileName[0];
            }
        }
        catch (Exception aa) {
            //// Response.Write(aa.ToString());
            //return;
        }
        if (this.ViewState["HeadPortrait"] != null && this.ViewState["HeadPortrait"].ToString() != "")
        {
            modelInfo3.HeadPortrait = Pic1 != "" ? Pic1 : this.ViewState["HeadPortrait"].ToString();
        }
        else
        {
            modelInfo3.HeadPortrait = Pic1 != "" ? Pic1 : "";
        }

        this.ViewState["HeadPortrait"] = modelInfo3.HeadPortrait;

        //  Response.Write(Session["HeadPortrait"].ToString());

        FileUploader1.Img        = ConfigurationManager.AppSettings["ImageDomain"].ToString() + "/" + modelInfo3.HeadPortrait;
        FileUploader1.ButtonName = "修改";
        FileUploader1.MaxPics    = 1;
        FileUploader1.IsUp       = "0";//是否通过控件上传

        #endregion

        #region 公司登记信息
        modelInfo2.ContactID        = 0;
        modelInfo2.LoginName        = this.ViewState["LoginMemberName"].ToString();
        modelInfo2.OrganizationName = txtOrganizationName.Text;
        modelInfo2.Name             = LoginName;
        modelInfo2.Career           = tbCareer.Text;
        modelInfo2.TelCountryCode   = txtTelCountry.Text;
        modelInfo2.TelStateCode     = txtTelZoneCode.Text;
        modelInfo2.TelNum           = txtTelNumber.Text;
        modelInfo2.FaxCountryCode   = txtFaxCountry.Text;
        modelInfo2.FaxStateCode     = txtFaxZoneCode.Text;
        modelInfo2.FaxNum           = txtFaxNumber.Text;
        modelInfo2.Email            = txtEmail.Text;
        modelInfo2.Mobile           = txtMobile.Text;
        modelInfo2.address          = txtAddress.Text;
        modelInfo2.PostCode         = txtPostCode.Text;
        modelInfo2.Website          = txtWebSite.Text;
        modelInfo2.IsDel            = false;
        modelInfo2.remark           = "";

        #endregion
        #endregion

        int  int1 = 0;
        long int2 = 0;


        //判断会员信息表里是否己存在,并更新注册表
        if (this.ViewState["tag"].ToString() == "add")
        {
            int1 = objInfo3.MemberMessage_Insert(modelInfo3);
        }
        else if (this.ViewState["tag"].ToString() == "update")
        {
            int1 = objInfo3.MemberMessage_Update(modelInfo3);
        }


        //判断登记联系人表里是否己存在
        int2 = objInfo2.OrgContactMan_FromMemberMessage(modelInfo2);

        if (int1 > 0 && int2 > 0)
        {
            Tz888.Common.MessageBox.Show(this.Page, "信息修改成功!");
        }
    }