Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        private void Delete()
        {
            string guidList = Request.Params["Guid"];
            string rslt = string.Empty;
            if (!string.IsNullOrEmpty(guidList))
            {
                Model.Application apply = new Model.Application();
                Model.BulkFreight bulk = new Model.BulkFreight();
                Model.SCW scw = new Model.SCW();
                string[] guid = guidList.Split(',');
                foreach (var item in guid)
                {
                    apply.Guid = item;
                    bulk.AppGuid = item;
                    scw.AppGuid = item;

                    try
                    {
                        CNVP.Data.Application bll = new CNVP.Data.Application();
                        bll.ApplyDelete(apply, scw, bulk);
                        rslt = "1";
                    }
                    catch (Exception e)
                    {
                        rslt = "0";
                    }
                    finally
                    {

                    }
                }
                Response.Write("{\"result\":\"" + rslt + "\"}");
                Response.End();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新申请单状态
        /// </summary>
        private void EditState()
        {
            string guid = Request.Params["applyGuid"];
            string applyState = AppState.SelectedValue;
            _appState = Request.Params["applyState"];
            appPage = Request.Params["appPage"];
            Model.Application apply = new Model.Application();
            Model.Accredit accredit = new Model.Accredit();

            Hashtable ht = new Hashtable();
            ht.Add("Guid", guid);
            Model.Application appli = Model.Application.Instance.GetModelById(ht);
            Model.SCW scw = new Model.SCW();
            if (appli.IO == 1)
            {
                Model.PrintNum printNum = new Model.PrintNum();
                using (DataTable dt = CNVP.Framework.DataAccess.DataFactory.GetInstance().ExecuteTable("select max(ApplyNum) as maxA from CNVP_PrintNum"))
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        int maxANum = Convert.ToInt32(dt.Rows[0]["maxA"].ToString()) + 1;
                        printNum.Update("ApplyNum=" + maxANum, string.Empty);
                        apply.Update("PrintNum=" + maxANum, " and Guid='" +
                    guid + "'");
                    }
                }
                using (DataTable dt1 = CNVP.Framework.DataAccess.DataFactory.GetInstance().ExecuteTable("select max(ScwNum) as maxS from CNVP_PrintNum"))
                {
                    if (dt1 != null && dt1.Rows.Count > 0)
                    {
                        int maxSNum = Convert.ToInt32(dt1.Rows[0]["maxS"].ToString()) + 1;
                        printNum.Update("ScwNum=" + maxSNum, string.Empty);
                        scw.Update("PrintNum=" + maxSNum, " and AppGuid='" +
                    guid + "'");
                    }
                }
            }
            else
            {
                Model.PrintNum printNum = new Model.PrintNum();
                using (DataTable dt = CNVP.Framework.DataAccess.DataFactory.GetInstance().ExecuteTable("select max(ApplyNum) as maxA from CNVP_PrintNum"))
                {
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        int maxANum = Convert.ToInt32(dt.Rows[0]["maxA"].ToString()) + 1;
                        printNum.Update("ApplyNum=" + maxANum, string.Empty);
                        apply.Update("PrintNum=" + maxANum, " and Guid='" +
                    guid + "'");
                    }
                }
            }

            //修改申请单状态
            if (!string.IsNullOrEmpty(guid))
            {
                apply.Update("AppState=" + applyState, " and Guid='" +
                    guid + "'");
                if (_appState == "1")
                {
                    if (appli.IO == 1)
                    {
                        strIO = "出港";
                    }
                    else
                    {
                        strIO = "进港";
                        Panel1.Visible = false;
                    }
                }
            }

            //增加或修改审批意见
            CNVP.UI.Application _apply = new Application();
            if (_apply.IsOpinionExist(guid))
            {
                accredit.Update("AppOpinions='" + AppOpinions.Text + "', ScwOpinions='" + ScwOpinions.Text + "'"," and AppGuid='" + guid + "'");
            }
            else
            {
                accredit.AccreditationMen = Convert.ToInt32(LoginInfo.LoginID);
                accredit.AccreditationTime = DateTime.Now;
                accredit.AppGuid = guid;
                accredit.Guid = Public.GetGuID;
                accredit.AppOpinions = AppOpinions.Text;
                accredit.ScwOpinions = ScwOpinions.Text;
                accredit.Insert(accredit);
            }

            MessageBox.ShowMessage("审批成功!", "ApplyList.aspx?State=" + _appState + "&page=" + appPage);
        }