protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string appGuid = Request.Params["AppGuid"]; string imgtype = Request.Params["imgtype"]; string strsql = string.Empty; if (!string.IsNullOrEmpty(appGuid)) { if (imgtype == "1") { strsql = "select * from cnvp_source where appGuid='" + appGuid + "' and sourcetype like 'mfile0_%' and substring(sourcetype,8,2) > 4"; } else { strsql = "select * from cnvp_source where appGuid='" + appGuid + "' and sourcetype like 'scwmfile0_%' and substring(sourcetype,11,2) > 3"; } Model.Source source = new Model.Source(); DataTable dt = DataFactory.GetInstance(). ExecuteTable(strsql); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { imgsrc += "<p><a href='" + dt.Rows[i]["SourceUrl"] + "' target='_blank'>其它" + (i + 1) + "</a></p>"; } } } } }
public static Model.Source ConvertToModel(this Data.Entities.Source data) { var model = new Model.Source { Id = data.Id, Name = data.Name, NiceName = data.NiceName, Url = data.Url, FeedUrl = data.FeedUrl }; return(model); }
/// <summary> /// 根据上传类型获取附件地址 /// </summary> /// <param name="imgType">证件类型</param> /// <param name="guid">当前申请单guid</param> /// <returns></returns> public string GetImgUrl(string imgType, string guid) { string str = string.Empty; Model.Source source = new Model.Source(); IList list = source. GetAllList(" and SourceType='" + imgType + "' and AppGuid='" + guid + "'", "Id"); if (list != null) { foreach (Model.Source item in list) { str = item.SourceUrl; } } return str; }
/// <summary> /// 删除 附件信息 /// </summary> private void FileDelete() { string appGuid = Request.Params["appGuid"]; string sourceType = Request.Params["sourceType"]; Model.Source source = new Model.Source(); Hashtable ht = new Hashtable(); ht.Add("AppGuid", appGuid); ht.Add("SourceType", sourceType); int num = source.Delete(ht); if (num > 0) { Response.Write("{\"result\":\"1\"}"); } else { Response.Write("{\"result\":\"0\"}"); } Response.End(); }
protected void Page_Load(object sender, EventArgs e) { string AppGuid = Request.Params["AppGuid"]; if (!string.IsNullOrEmpty(AppGuid)) { string content = FileUtils.ReadFile(Server.MapPath("~/Template/scw.htm")); Hashtable ht = new Hashtable(); ht.Add("AppGuid", AppGuid); Model.SCW scw = Model.SCW.Instance.GetModelById(ht); Model.Accredit accredit = Model.Accredit.Instance.GetModelById(ht); content = content.Replace("{#GoodsName}", scw.GoodsName) .Replace("{#GoodsName}", scw.GoodsName) .Replace("{#Shipper}", scw.Shipper) .Replace("{#TransportDocNo}", scw.TransportDocNo) .Replace("{#Consignee}", scw.Consignee) .Replace("{#Carrier}", scw.Carrier) .Replace("{#TransPort}", scw.TransPort) .Replace("{#Guide}", scw.Guide) .Replace("{#HomePort}", scw.HomePort) .Replace("{#DestinationPort}", scw.DestinationPort) .Replace("{#Description}", scw.Description) .Replace("{#TotalWeight}", scw.TotalWeight) .Replace("{#MoistureLimit}", scw.MoistureLimit) .Replace("{#ParticularNature}", scw.ParticularNature) .Replace("{#GoodsGroup1}", scw.GoodsGroup == "A组" ? "☑" : "□") .Replace("{#GoodsGroup2}", scw.GoodsGroup == "C组" ? "☑" : "□"); Model.Source source = new Model.Source(); string scwmfile0 = "□"; string scwmfile4 = "□"; IList list = source.GetAllList(" and AppGuid='" + AppGuid + "' and SourceType='scwmfile0_1'", "Id"); if (list != null) { scwmfile0 = "☑"; } string strsql = "select * from cnvp_source where appGuid='" + AppGuid + "' and sourcetype like 'scwmfile0_%' and substring(sourcetype,11,2) > 3"; DataTable dt = DataFactory.GetInstance().ExecuteTable(strsql); if (dt.Rows.Count > 0) { scwmfile4 = "☑"; } content = content.Replace("{#ExatrCertificate1}", scwmfile0).Replace("{#ExatrCertificate2}", scwmfile4); //审批意见 if (accredit != null) { string xh = string.Empty; if (scw.PrintNum.Length == 1) { xh = DateTime.Now.ToString("yyyyMMdd") + "0" + scw.PrintNum; } else { xh = scw.PrintNum; } content = content.Replace("{#spyj}", "准予备查"); content = content.Replace("{#spsj}", xh); } Response.Write(content); } }
/// <summary> /// 编辑申请单 /// </summary> private void EditApply(int editState) { string applyId = Request.Params["applyId"]; string scwId = Request.Params["scwId"]; string bulkId = Request.Params["bulkId"]; //散装货物表ID 不能传入string类型,新定义一个字段存入ID string applyGuid = Request.Params["applyGuid"]; string appState = Request.Params["appState"]; string appPage = Request.Params["appPage"]; CNVP.UI.FileUpload upload = new UI.FileUpload(); Model.Application appli = new Model.Application(); Model.SCW scw = new Model.SCW(); Model.Source source = new Model.Source(); Model.BulkFreight bulk = new Model.BulkFreight(); //项目申请单 appli.UpdateModel(); appli.Id = Convert.ToInt32(applyId); appli.IO = Convert.ToInt32(IO.SelectedValue); appli.AppState = editState; //安全适运单 if (appli.IO == 1) { CNVP.UI.Application _apply = new UI.Application(); scw.UpdateModel(); //scw.ExatrCertificate = _apply.GetCheck(ExatrCertificate, ","); scw.GoodsGroup = GoodsGroup.SelectedValue; scw.Id = Convert.ToInt32(scwId); } //附件上传 source.AppGuid = applyGuid; //source.CreateTime = DateTime.Now; source.SourceUrl = upload.UploadPic(); source.UserId = Convert.ToInt32(UserLoginInfo.UserLoginID); //散装货物上传 //bulk.Id = Request.Params["bulkId"]; bulk.BfGoodsName = Request.Params["BfGoodsName"]; bulk.BfGoodsGroup = Request.Params["BfGoodsGroup"]; bulk.Class = Request.Params["Class"]; bulk.DangerousNo = Request.Params["DangerousNo"]; bulk.BfTotalWeight = Request.Params["BfTotalWeight"]; bulk.DischargingPort = Request.Params["DischargingPort"]; bulk.Position = Request.Params["Position"]; bulk.Remark = Request.Params["Remark"]; CNVP.Data.Application bll = new CNVP.Data.Application(); bll.Edit(appli, scw, source, bulk, bulkId); MessageBox.ShowMessage("修改提交成功!", "ApplicationList.aspx?State=" + appState + "&page=" + appPage); }
protected void Page_Load(object sender, EventArgs e) { string Action = Request.Params["Action"]; switch (Action) { case "EditState": EditState(); break; } if (!IsPostBack) { #region 当前页面赋值 string guid = Request.Params["guid"]; _appState = Request.Params["State"]; appPage = Request.Params["page"]; if (!string.IsNullOrEmpty(guid)) { applyGuid = guid; Hashtable ht = new Hashtable(); ht.Add("Guid", guid); Model.Application appli = Model.Application.Instance.GetModelById(ht); appli.SetWebControls(this.Page); this.ArrivedTime.Text = Convert.ToDateTime(appli.ArrivedTime).ToString("yyyy-MM-dd"); this.WorkTime.Text = Convert.ToDateTime(appli.WorkTime).ToString("yyyy-MM-dd"); if (appli.IO == 1) { strIO = "出港"; } else { strIO = "进港"; Panel1.Visible = false; } AppState.SelectedValue = appli.AppState.ToString(); //安全适运单 ht.Clear(); ht.Add("AppGuid", guid); Model.SCW scw = Model.SCW.Instance.GetModelById(ht); scw.SetWebControls(this.Page); //散装货物列表 Model.BulkFreight bulk = new Model.BulkFreight(); IList list = bulk.GetAllList(" and AppGuid='" + guid + "'", "Id"); rptBulk.DataSource = list; rptBulk.DataBind(); //图片附件 CNVP.UI.FileUpload _fuplo = new UI.FileUpload(); mfile0_0 = _fuplo.GetImgUrl("mfile0_0", guid); mfile0_1 = _fuplo.GetImgUrl("mfile0_1", guid); mfile0_2 = _fuplo.GetImgUrl("mfile0_2", guid); scwmfile2 = _fuplo.GetImgUrl("scwmfile0_2", guid); scwmfile3 = _fuplo.GetImgUrl("scwmfile0_3", guid); scwmfile4 = _fuplo.GetImgUrl("scwmfile0_4", guid); //显示其它类型的附件 //申报单 string strsql1 = "select * from cnvp_source where appGuid='" + guid + "' and sourcetype like 'mfile0_%' and substring(sourcetype,8,2) > 4"; Model.Source source = new Model.Source(); DataTable dt3 = DataFactory.GetInstance().ExecuteTable(strsql1); if (dt3.Rows.Count > 0) { for (int i = 0; i < dt3.Rows.Count; i++) { this.imgsrc1 += "<a href='" + dt3.Rows[i]["SourceUrl"] + "' target='_blank'>其它" + (i + 1) + "</a> "; } } // 适运单 string strsql2 = "select * from cnvp_source where appGuid='" + guid + "' and sourcetype like 'scwmfile0_%' and substring(sourcetype,11,2) > 3"; Model.Source source1 = new Model.Source(); DataTable dt4 = DataFactory.GetInstance().ExecuteTable(strsql2); if (dt4.Rows.Count > 0) { for (int i = 0; i < dt4.Rows.Count; i++) { this.imgsrc2 += "<a href='" + dt4.Rows[i]["SourceUrl"] + "' target='_blank'>其它" + (i + 1) + "</a> "; } } if (_fuplo.GetImgUrl("mfile0_3", guid) != "") { mfile0_3 = "4、<a href=\"" + _fuplo.GetImgUrl("mfile0_3", guid) + "\" target=\"_blank\">进/出港申报委托书</a> "; } if (_fuplo.GetImgUrl("mfile0_3", guid) != "") { mfile0_4 = "5、<a href=\"" + _fuplo.GetImgUrl("mfile0_4", guid) + "\" target=\"_blank\">保险证书类型</a> "; } if (_fuplo.GetImgUrl("scwmfile0_1", guid) != "") { scwmfile1 = "<a href=\"" + _fuplo.GetImgUrl("scwmfile0_1", guid) + "\" target=\"_blank\">水份含量和适运水份极限证书</a> "; } if (_fuplo.GetImgUrl("scwmfile0_2", guid) != "") { scwmfile2 = "<a href=\"" + _fuplo.GetImgUrl("scwmfile0_1", guid) + "\" target=\"_blank\">安全适运性评估报告</a> "; } if (_fuplo.GetImgUrl("scwmfile0_3", guid) != "") { scwmfile3 = "<a href=\"" + _fuplo.GetImgUrl("scwmfile0_3", guid) + "\" target=\"_blank\">委托书</a> "; } if (_fuplo.GetImgUrl("scwmfile0_4", guid) != "") { scwmfile4 = "<a href=\"other.aspx?AppGuid=" + applyGuid + "\" target=\"_blank\">其它</a>"; } //审批意见信息 Model.Accredit accredit = Model.Accredit.Instance.GetModelById(ht); AppOpinions.Text = accredit.AppOpinions; ScwOpinions.Text = accredit.ScwOpinions; } #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { #region 当前页面赋值 string guid = Request.Params["guid"]; if (!string.IsNullOrEmpty(guid)) { applyGuid = guid; Hashtable ht = new Hashtable(); ht.Add("Guid", guid); Model.Application appli = Model.Application.Instance.GetModelById(ht); appli.SetWebControls(this.Page); this.ArrivedTime.Text = Convert.ToDateTime(appli.ArrivedTime).ToString("yyyy-MM-dd"); this.WorkTime.Text = Convert.ToDateTime(appli.WorkTime).ToString("yyyy-MM-dd"); if (appli.IO == 1) { strIO = "出港"; } else { strIO = "进港"; Panel1.Visible = false; } if (appli.AppState == 1) { printApply = "<a href=\"solidbulk.aspx?AppGuid=" + guid + "\" target=\"_blank\">打印固体散装货物申报单</a>"; printScw = "<a href=\"scwprint.aspx?AppGuid=" + guid + "\" target=\"_blank\">打印安全适运申报单</a>"; printNotice = "<a href=\"Notice.aspx?AppGuid=" + guid + "\" class=\"btn-submit\" target=\"_blank\">打印审批通知单</a>"; } applyId = appli.Id.ToString(); //安全适运单 ht.Clear(); ht.Add("AppGuid", guid); Model.SCW scw = Model.SCW.Instance.GetModelById(ht); scw.SetWebControls(this.Page); scwId = scw.Id.ToString(); //散装货物列表 Model.BulkFreight bulk = new Model.BulkFreight(); IList list = bulk.GetAllList(" and AppGuid='" + guid + "'", "Id"); rptBulk.DataSource = list; rptBulk.DataBind(); //图片附件 CNVP.UI.FileUpload _fuplo = new UI.FileUpload(); mfile0_0 = _fuplo.GetImgUrl("mfile0_0", guid); mfile0_1 = _fuplo.GetImgUrl("mfile0_1", guid); mfile0_2 = _fuplo.GetImgUrl("mfile0_2", guid); scwmfile2 = _fuplo.GetImgUrl("scwmfile0_2", guid); scwmfile3 = _fuplo.GetImgUrl("scwmfile0_3", guid); scwmfile4 = _fuplo.GetImgUrl("scwmfile0_4", guid); if (_fuplo.GetImgUrl("mfile0_3", guid) != "") { mfile0_3 = "4、<a href=\"" + _fuplo.GetImgUrl("mfile0_3", guid) + "\" target=\"_blank\">进/出港申报委托书</a> "; } if (_fuplo.GetImgUrl("mfile0_4", guid) != "") { mfile0_4 = "5、<a href=\"" + _fuplo.GetImgUrl("mfile0_4", guid) + "\" target=\"_blank\">保险证书类型</a> "; } //显示其它类型的附件 //申报单 string strsql1 = "select * from cnvp_source where appGuid='" + guid + "' and sourcetype like 'mfile0_%' and substring(sourcetype,8,2) > 4"; Model.Source source = new Model.Source(); DataTable dt = DataFactory.GetInstance().ExecuteTable(strsql1); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { this.imgsrc1 += "<a href='" + dt.Rows[i]["SourceUrl"] + "' target='_blank'>其它" + (i + 1) + "</a> "; } } // 适运单 string strsql2 = "select * from cnvp_source where appGuid='" + guid + "' and sourcetype like 'scwmfile0_%' and substring(sourcetype,11,2) > 3"; Model.Source source1 = new Model.Source(); DataTable dt1 = DataFactory.GetInstance().ExecuteTable(strsql2); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { this.imgsrc2 += "<a href='" + dt1.Rows[i]["SourceUrl"] + "' target='_blank'>其它" + (i + 1) + "</a> "; } } if (_fuplo.GetImgUrl("scwmfile0_1", guid) != string.Empty) { scwmfile1 = "<a href=\"" + _fuplo.GetImgUrl("scwmfile0_1", guid) + "\" target=\"_blank\">水份含量和适运水份极限证书</a> "; } if (_fuplo.GetImgUrl("scwmfile0_2", guid) != "") { scwmfile2 = "<a href=\"" + _fuplo.GetImgUrl("scwmfile0_1", guid) + "\" target=\"_blank\">安全适运性评估报告</a> "; } if (_fuplo.GetImgUrl("scwmfile0_3", guid) != "") { scwmfile3 = "<a href=\"" + _fuplo.GetImgUrl("scwmfile0_3", guid) + "\" target=\"_blank\">委托书</a> "; } //if (_fuplo.GetImgUrl("scwmfile0_4", guid) != "") //{ // scwmfile4 = "<a href=\"other.aspx?AppGuid=" + applyGuid + "\" target=\"_blank\">其它</a>"; //} #region 审批意见 DataTable dts1 = DataFactory.GetInstance().ExecuteTable("select * from CNVP_accredit where AppGuid='" + guid + "'"); if (dts1 != null && dts1.Rows.Count > 0) { spyj = dts1.Rows[0]["AppOpinions"].ToString(); spyj1 = dts1.Rows[0]["ScwOpinions"].ToString(); } #endregion } #endregion } }