Esempio n. 1
0
    public static Hi.Model.YZT_Annex UpFCmaterials(DataTable dt, int type, string name, string date, string UserID)
    {
        DateTime time = DateTime.Now;

        Hi.Model.YZT_Annex annexModel = null;

        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow[] dr1 = dt.Select(string.Format(" type='{0}' and fileAlias=4", type));

            if (dr1.Length > 0)
            {
                annexModel = new Hi.Model.YZT_Annex();

                annexModel.fileName   = name;
                annexModel.validDate  = date == "" ? DateTime.MinValue : Convert.ToDateTime(date);
                annexModel.ts         = time;
                annexModel.modifyuser = UserID.ToInt(0);

                annexModel.ID           = dr1[0]["ID"].ToString().ToInt(0);
                annexModel.type         = type;
                annexModel.fileAlias    = dr1[0]["fileAlias"].ToString();
                annexModel.fcID         = dr1[0]["fcID"].ToString().ToInt(0);
                annexModel.dr           = dr1[0]["dr"].ToString().ToInt(0);
                annexModel.CreateUserID = dr1[0]["CreateUserID"].ToString().ToInt(0);
                annexModel.CreateDate   = Convert.ToDateTime(dr1[0]["CreateDate"].ToString());
            }
        }
        return(annexModel);
    }
Esempio n. 2
0
    public static string Edit(string KeyID, string HidFfileName, string UserID)
    {
        Common.ResultMessage   Msg     = new Common.ResultMessage();
        Hi.Model.YZT_FirstCamp fcmodel = new Hi.BLL.YZT_FirstCamp().GetModel(KeyID.ToInt(0));

        if (fcmodel != null)
        {
            //医疗器械经营许可证
            Hi.Model.YZT_Annex annexModel = new Hi.Model.YZT_Annex();
            annexModel.fcID         = fcmodel.ID;
            annexModel.type         = 2;
            annexModel.fileName     = HidFfileName;
            annexModel.fileAlias    = "2";
            annexModel.validDate    = DateTime.MinValue;
            annexModel.CreateDate   = DateTime.Now;
            annexModel.dr           = 0;
            annexModel.ts           = DateTime.Now;
            annexModel.modifyuser   = UserID.ToInt(0);
            annexModel.CreateUserID = UserID.ToInt(0);

            if (new Hi.BLL.YZT_Annex().Add(annexModel) > 0)
            {
                Msg.result = true;
            }
        }
        else
        {
            Msg.code = "未查找到数据";
        }
        return(new JavaScriptSerializer().Serialize(Msg));
    }
Esempio n. 3
0
    public Hi.Model.YZT_Annex insertAnnex(int id, int type, string name, string date)
    {
        DateTime time = DateTime.Now;

        Hi.Model.YZT_Annex annexModel = new Hi.Model.YZT_Annex();
        annexModel.fcID         = id;
        annexModel.type         = type;
        annexModel.fileName     = name;
        annexModel.fileAlias    = "4";
        annexModel.validDate    = Convert.ToDateTime(date);
        annexModel.CreateDate   = time;
        annexModel.dr           = 0;
        annexModel.ts           = time;
        annexModel.modifyuser   = UserID;
        annexModel.CreateUserID = UserID;
        return(annexModel);
    }
Esempio n. 4
0
    /// <summary>
    /// 新增首营信息附件资料
    /// </summary>
    /// <param name="id">首营信息ID</param>
    /// <param name="type">附件资料类型</param>
    /// <param name="name">文件名称</param>
    /// <param name="date">有效期</param>
    /// <returns></returns>
    public static Hi.Model.YZT_Annex insertAnnex(int id, int type, string name, string date, string UserID, string fileAlias)
    {
        DateTime time = DateTime.Now;

        Hi.Model.YZT_Annex annexModel = new Hi.Model.YZT_Annex();
        annexModel.fcID         = id;
        annexModel.type         = type;
        annexModel.fileName     = name;
        annexModel.fileAlias    = fileAlias;
        annexModel.validDate    = date == "" ? DateTime.MinValue : Convert.ToDateTime(date);
        annexModel.CreateDate   = time;
        annexModel.dr           = 0;
        annexModel.ts           = time;
        annexModel.modifyuser   = UserID.ToInt(0);
        annexModel.CreateUserID = UserID.ToInt(0);
        return(annexModel);
    }
Esempio n. 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.YZT_Annex model, SqlTransaction Tran)
 {
     return(dal.Update(model, Tran));
 }
Esempio n. 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.YZT_Annex model, SqlTransaction Tran)
 {
     return(dal.Add(model, Tran));
 }
Esempio n. 7
0
    /// <summary>
    /// 确认按钮单击事件
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string HidFfileNameNew = this.HidFfileName.Value.Trim();   //营业执照 附件名称
        string HidFfileNameOld = "";                               //营业执照 附件旧名称(更新后 需要删除的旧附件)

        string HidFfileNameNew2 = this.HidFfileName2.Value.Trim(); //生产许可证 附件名称
        string HidFfileNameOld2 = "";                              //生产许可证 附件旧名称(更新后 需要删除的旧附件)

        string HidFfileNameNew3 = this.HidFfileName3.Value.Trim(); // 附件名称
        string HidFfileNameOld3 = "";

        string HidFfileNameNew4 = this.HidFfileName4.Value.Trim();// 附件名称
        string HidFfileNameOld4 = "";

        string HidFfileNameNew5 = this.HidFfileName5.Value.Trim();// 附件名称
        string HidFfileNameOld5 = "";

        string HidFfileNameNew6 = this.HidFfileName6.Value.Trim();// 附件名称
        string HidFfileNameOld6 = "";

        string HidFfileNameNew7 = this.HidFfileName7.Value.Trim();// 附件名称
        string HidFfileNameOld7 = "";

        string HidFfileNameNew8 = this.HidFfileName8.Value.Trim();// 附件名称
        string HidFfileNameOld8 = "";

        string HidFfileNameNew9 = this.HidFfileName9.Value.Trim();// 附件名称
        string HidFfileNameOld9 = "";

        string HidFfileNameNew10 = this.HidFfileName10.Value.Trim();// 附件名称
        string HidFfileNameOld10 = "";


        Hi.Model.YZT_FCmaterials fCmaterialsModel = null;
        string         id   = Request.QueryString["id"];
        SqlTransaction Tran = null;

        try
        {
            Tran = DBUtility.SqlHelper.CreateStoreTranSaction();
            int fid = 0;
            //新增
            if (string.IsNullOrWhiteSpace(id))
            {
                fCmaterialsModel = new Hi.Model.YZT_FCmaterials();
                fCmaterialsModel = getfCmaterialsModel(fCmaterialsModel);
                fCmaterialsModel.CreateUserID = UserID;
                fCmaterialsModel.CreateDate   = DateTime.Now;
                fCmaterialsModel.dr           = 0;
                fid = new Hi.BLL.YZT_FCmaterials().Add(fCmaterialsModel, Tran);
                if (fid > 0)
                {
                    DateTime time  = DateTime.Now;
                    int      count = 0;
                    try
                    {
                        count = 1;
                        //新增营业执照附件表
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName.Value.Trim()))
                        {
                            Hi.Model.YZT_Annex annexModel = insertAnnex(Convert.ToInt32(fid), 5, this.HidFfileName.Value.Trim(), this.validDate.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName2.Value.Trim()))
                        {
                            //新增生产许可证表
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 6, this.HidFfileName2.Value.Trim(), this.validDate2.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName3.Value.Trim()))
                        {
                            //新增税务登记证
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 12, this.HidFfileName3.Value.Trim(), this.validDate3.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName4.Value.Trim()))
                        {
                            //新增开户银行许可证
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 13, this.HidFfileName4.Value.Trim(), this.validDate4.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName5.Value.Trim()))
                        {
                            //新增质量管理体系调查表
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 14, this.HidFfileName5.Value.Trim(), this.validDate5.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName6.Value.Trim()))
                        {
                            //新增GSP/GMP证书
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 15, this.HidFfileName6.Value.Trim(), this.validDate6.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }

                        if (!string.IsNullOrWhiteSpace(this.HidFfileName7.Value.Trim()))
                        {
                            //新增开票信息
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 16, this.HidFfileName7.Value.Trim(), this.validDate7.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName8.Value.Trim()))
                        {
                            //新增企业年报
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 17, this.HidFfileName8.Value.Trim(), this.validDate8.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName9.Value.Trim()))
                        {
                            //新增银行收付款帐号资料
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 18, this.HidFfileName9.Value.Trim(), this.validDate9.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                        if (!string.IsNullOrWhiteSpace(this.HidFfileName10.Value.Trim()))
                        {
                            //新增购销合同
                            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(fid), 19, this.HidFfileName10.Value.Trim(), this.validDate10.Value.Trim());
                            count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                        }
                    }
                    catch (Exception)
                    {
                        count = 0;
                    }
                    if (count > 0)
                    {
                        Tran.Commit();
                        Response.Redirect("FCmaterialsInfo.aspx?id=" + fid, true);
                    }
                    else
                    {
                        throw new Exception("新增异常!");
                    }
                }
                else
                {
                    throw new Exception("新增异常!");
                }
            }
            else
            {
                //修改
                fCmaterialsModel = new Hi.BLL.YZT_FCmaterials().GetModel(Convert.ToInt32(id));
                fCmaterialsModel = getfCmaterialsModel(fCmaterialsModel);
                if (new Hi.BLL.YZT_FCmaterials().Update(fCmaterialsModel, Tran))
                {
                    DateTime time = DateTime.Now;
                    List <Hi.Model.YZT_Annex> annexList = new Hi.BLL.YZT_Annex().GetList("", " fcID=" + id + " and dr=0", "");
                    foreach (Hi.Model.YZT_Annex item in annexList)
                    {
                        item.ts         = time;
                        item.modifyuser = UserID;
                        if (item.type == 5)
                        {
                            //营业执照修改
                            HidFfileNameOld = item.fileName;
                            item.fileName   = HidFfileNameNew;
                            if (!string.IsNullOrWhiteSpace(this.validDate.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate.Value.Trim());
                            }
                        }
                        else if (item.type == 6)
                        {
                            //生产许可证修改
                            HidFfileNameOld2 = item.fileName;
                            item.fileName    = HidFfileNameNew2;
                            if (!string.IsNullOrWhiteSpace(this.validDate2.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate2.Value.Trim());
                            }
                        }
                        else if (item.type == 12)
                        {
                            //税务登记证修改
                            HidFfileNameOld3 = item.fileName;
                            item.fileName    = HidFfileNameNew3;
                            if (!string.IsNullOrWhiteSpace(this.validDate3.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate3.Value.Trim());
                            }
                        }
                        else if (item.type == 13)
                        {
                            //开户银行许可证修改
                            HidFfileNameOld4 = item.fileName;
                            item.fileName    = HidFfileNameNew4;
                            if (!string.IsNullOrWhiteSpace(this.validDate4.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate4.Value.Trim());
                            }
                        }
                        else if (item.type == 14)
                        {
                            //质量管理体系调查表修改
                            HidFfileNameOld5 = item.fileName;
                            item.fileName    = HidFfileNameNew5;
                            if (!string.IsNullOrWhiteSpace(this.validDate5.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate5.Value.Trim());
                            }
                        }
                        else if (item.type == 15)
                        {
                            //GSP/GMP证书修改
                            HidFfileNameOld6 = item.fileName;
                            item.fileName    = HidFfileNameNew6;
                            if (!string.IsNullOrWhiteSpace(this.validDate6.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate6.Value.Trim());
                            }
                        }
                        else if (item.type == 16)
                        {
                            //开票信息修改
                            HidFfileNameOld7 = item.fileName;
                            item.fileName    = HidFfileNameNew7;
                            if (!string.IsNullOrWhiteSpace(this.validDate7.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate7.Value.Trim());
                            }
                        }
                        else if (item.type == 17)
                        {
                            //企业年报修改
                            HidFfileNameOld8 = item.fileName;
                            item.fileName    = HidFfileNameNew8;
                            if (!string.IsNullOrWhiteSpace(this.validDate8.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate8.Value.Trim());
                            }
                        }
                        else if (item.type == 18)
                        {
                            //银行收付款帐号资料修改
                            HidFfileNameOld9 = item.fileName;
                            item.fileName    = HidFfileNameNew9;
                            if (!string.IsNullOrWhiteSpace(this.validDate9.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate9.Value.Trim());
                            }
                        }
                        else if (item.type == 19)
                        {
                            //购销合同修改
                            HidFfileNameOld10 = item.fileName;
                            item.fileName     = HidFfileNameNew10;
                            if (!string.IsNullOrWhiteSpace(this.validDate10.Value.Trim()))
                            {
                                item.validDate = Convert.ToDateTime(this.validDate10.Value.Trim());
                            }
                        }

                        if (!new Hi.BLL.YZT_Annex().Update(item, Tran))
                        {
                            break;
                            throw new Exception("修改异常!");
                        }
                    }


                    List <Hi.Model.YZT_Annex> annex1 = annexList.Where(a => a.type == 5).ToList();
                    if (annex1.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName.Value.Trim()))
                    {
                        //新增营业执照附件表
                        Hi.Model.YZT_Annex annexModel = insertAnnex(Convert.ToInt32(id), 5, this.HidFfileName.Value.Trim(), this.validDate.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex2 = annexList.Where(a => a.type == 6).ToList();
                    if (annex2.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName2.Value.Trim()))
                    {
                        //新增生产许可证表
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 6, this.HidFfileName2.Value.Trim(), this.validDate2.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex3 = annexList.Where(a => a.type == 12).ToList();
                    if (annex3.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName3.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 12, this.HidFfileName3.Value.Trim(), this.validDate3.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex4 = annexList.Where(a => a.type == 13).ToList();
                    if (annex4.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName4.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 13, this.HidFfileName4.Value.Trim(), this.validDate4.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex5 = annexList.Where(a => a.type == 14).ToList();
                    if (annex5.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName5.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 14, this.HidFfileName5.Value.Trim(), this.validDate5.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex6 = annexList.Where(a => a.type == 15).ToList();
                    if (annex6.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName6.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 15, this.HidFfileName6.Value.Trim(), this.validDate6.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex7 = annexList.Where(a => a.type == 16).ToList();
                    if (annex7.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName7.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 16, this.HidFfileName7.Value.Trim(), this.validDate7.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex8 = annexList.Where(a => a.type == 17).ToList();
                    if (annex8.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName8.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 17, this.HidFfileName8.Value.Trim(), this.validDate8.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex9 = annexList.Where(a => a.type == 18).ToList();
                    if (annex9.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName9.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 18, this.HidFfileName9.Value.Trim(), this.validDate9.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    List <Hi.Model.YZT_Annex> annex10 = annexList.Where(a => a.type == 19).ToList();
                    if (annex10.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName10.Value.Trim()))
                    {
                        Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 19, this.HidFfileName10.Value.Trim(), this.validDate10.Value.Trim());
                        int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
                    }

                    //删除旧的营业执照附件
                    if (HidFfileNameOld != HidFfileNameNew)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    //删除旧的生产许可证 附加
                    if (HidFfileNameOld2 != HidFfileNameNew2)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld2);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld3 != HidFfileNameNew3)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld3);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld4 != HidFfileNameNew4)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld4);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld5 != HidFfileNameNew5)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld5);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld6 != HidFfileNameNew6)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld6);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld7 != HidFfileNameNew7)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld7);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld8 != HidFfileNameNew8)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld8);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld9 != HidFfileNameNew9)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld9);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }
                    if (HidFfileNameOld10 != HidFfileNameNew10)
                    {
                        FileInfo file = new FileInfo(HttpContext.Current.Server.MapPath("../../UploadFile/") + HidFfileNameOld10);
                        if (file.Exists)
                        {
                            file.Delete();
                        }
                    }

                    Tran.Commit();
                    Response.Redirect("FCmaterialsInfo.aspx?id=" + id, true);
                }
                else
                {
                    throw new Exception("修改异常!");
                }
            }
        }
        catch (Exception ex)
        {
            if (Tran != null)
            {
                if (Tran.Connection != null)
                {
                    Tran.Rollback();
                }
            }
            JScript.AlertMethod(this, ex.Message, JScript.IconOption.错误, "function (){ window.location.href=window.location.href; }");
        }
        finally
        {
            DBUtility.SqlHelper.ConnectionClose();
        }
    }
Esempio n. 8
0
    public static string Edit(string KeyID, string CompID, string DisID, string UserID, string HtID, string ForceDate, string InvalidDate, string HidFfileName1, string validDate1, string HidFfileName2, string validDate2, string HidFfileName3, string validDate3, string HidFfileName4, string validDate4, string ApplyRemark)
    {
        //
        Common.ResultMessage    Msg       = new Common.ResultMessage();
        Hi.Model.YZT_CMerchants cmModel   = new Hi.BLL.YZT_CMerchants().GetModel(KeyID.ToInt(0));
        Hi.Model.YZT_FirstCamp  firstcamp = new Hi.Model.YZT_FirstCamp();

        //判断是否是该厂商的代理商
        List <Hi.Model.SYS_CompUser> compulist = new Hi.BLL.SYS_CompUser().GetList("", " UserID=" + UserID + " and CompID=" + CompID + " and DisID=" + DisID + "", "");

        Hi.Model.SYS_Users usersModel = new Hi.BLL.SYS_Users().GetModel(UserID);

        //首营信息
        string    sql = "select an.*,fc.ID from YZT_Annex an left join YZT_FCmaterials fc  on an.fcID =fc.ID and an.fileAlias in (4) and an.type in(5,7,8,9) where fc.DisID=" + DisID + " and ISNULL(fc.dr,0)=0 and fc.type=2 and ISNULL(an.dr,0)=0";
        DataTable dt  = SqlHelper.GetTable(SqlHelper.LocalSqlServer, sql);

        LoginModel uModel = null;

        if (HttpContext.Current.Session["UserModel"] is LoginModel)
        {
            uModel = HttpContext.Current.Session["UserModel"] as LoginModel;
        }

        SqlTransaction Tran = null;

        try
        {
            Tran = DBUtility.SqlHelper.CreateStoreTranSaction();

            if (DisID == "0")
            {
                Hi.Model.BD_Distributor Distributor = new Hi.Model.BD_Distributor();
                Distributor.CompID       = 0;
                Distributor.DisName      = uModel.CompName;
                Distributor.IsEnabled    = 1;
                Distributor.Paypwd       = Util.md5("123456");
                Distributor.Phone        = uModel.Phone;
                Distributor.AuditState   = 0;
                Distributor.CreateDate   = DateTime.Now;
                Distributor.CreateUserID = uModel.UserID;
                Distributor.ts           = DateTime.Now;
                Distributor.modifyuser   = uModel.UserID;
                Distributor.IsCheck      = 0;
                Distributor.CreditType   = 0;
                Distributor.pic          = "";
                //Distributor.creditCode = txt_creditCode;
                Distributor.Leading = "";
                Distributor.Licence = "";
                int DistributorID = 0;
                if ((DistributorID = new Hi.BLL.BD_Distributor().Add(Distributor, Tran)) > 0)
                {
                    DisID = DistributorID.ToString();

                    //代理商账户登录
                    Hi.Model.SYS_CompUser compuser = new Hi.Model.SYS_CompUser();
                    compuser.UserID       = UserID.ToInt(0);
                    compuser.CompID       = CompID.ToInt(0);
                    compuser.DisID        = DisID.ToInt(0);
                    compuser.AreaID       = 0;
                    compuser.RoleID       = usersModel == null ? 0 : usersModel.RoleID;
                    compuser.CType        = 2;
                    compuser.UType        = 5;
                    compuser.IsAudit      = 0;
                    compuser.IsEnabled    = 1;
                    compuser.ts           = DateTime.Now;
                    compuser.CreateUserID = UserID.ToInt(0);
                    compuser.modifyuser   = UserID.ToInt(0);
                    compuser.CreateDate   = DateTime.Now;

                    if (new Hi.BLL.SYS_CompUser().Add(compuser, Tran) <= 0)
                    {
                        Tran.Rollback();
                        Msg.code = "用户信息添加失败";
                        return(new JavaScriptSerializer().Serialize(Msg));
                    }
                }
                else
                {
                    Tran.Rollback();
                    Msg.code = "用户信息添加失败";
                    return(new JavaScriptSerializer().Serialize(Msg));
                }
            }
            else
            {
                if (compulist != null && compulist.Count <= 0)
                {
                    //代理商账户登录
                    Hi.Model.SYS_CompUser compuser = new Hi.Model.SYS_CompUser();
                    compuser.UserID       = UserID.ToInt(0);
                    compuser.CompID       = CompID.ToInt(0);
                    compuser.DisID        = DisID.ToInt(0);
                    compuser.AreaID       = 0;
                    compuser.RoleID       = usersModel == null ? 0 : usersModel.RoleID;
                    compuser.CType        = 2;
                    compuser.UType        = 5;
                    compuser.IsAudit      = 0;
                    compuser.IsEnabled    = 1;
                    compuser.ts           = DateTime.Now;
                    compuser.CreateUserID = UserID.ToInt(0);
                    compuser.modifyuser   = UserID.ToInt(0);
                    compuser.CreateDate   = DateTime.Now;

                    if (new Hi.BLL.SYS_CompUser().Add(compuser, Tran) <= 0)
                    {
                        Tran.Rollback();
                        Msg.code = "用户信息添加失败";
                        return(new JavaScriptSerializer().Serialize(Msg));
                    }
                }
            }

            List <Hi.Model.YZT_FirstCamp> fcamplist = new Hi.BLL.YZT_FirstCamp().GetList("", " CMID=" + KeyID + " and DisID=" + DisID + " and CompID=" + CompID + " and HtID=" + HtID, "");
            if (fcamplist != null && fcamplist.Count > 0)
            {
                Tran.Rollback();
                Msg.code = "已申请合作";
                return(new JavaScriptSerializer().Serialize(Msg));
            }

            firstcamp.CMID        = KeyID.ToInt(0);
            firstcamp.CompID      = CompID.ToInt(0);
            firstcamp.DisID       = DisID.ToInt(0);
            firstcamp.ForceDate   = ForceDate != "" ? Convert.ToDateTime(ForceDate) : DateTime.MinValue;
            firstcamp.InvalidDate = InvalidDate != "" ? Convert.ToDateTime(InvalidDate) : DateTime.MinValue;
            firstcamp.State       = 0;
            firstcamp.HtID        = HtID.ToInt(0);
            firstcamp.Applyremark = ApplyRemark;

            firstcamp.ts           = DateTime.Now;
            firstcamp.modifyuser   = UserID.ToInt(0);
            firstcamp.CreateDate   = DateTime.Now;
            firstcamp.CreateUserID = UserID.ToInt(0);

            int id = new Hi.BLL.YZT_FirstCamp().Add(firstcamp, Tran);

            if (id > 0)
            {
                //string annexdel = " fileAlias=1 and type in(5,7,9,8) and fcID=" + id;
                //new Hi.BLL.YZT_Annex().AnnexDelete(annexdel, Tran);

                List <Hi.Model.YZT_FCmaterials> fcmlist = new Hi.BLL.YZT_FCmaterials().GetList("", "DisID=" + DisID + " and type=2", "");
                int fcmid = 0;
                Hi.Model.YZT_FCmaterials fcmmodel = null;
                if (fcmlist != null && fcmlist.Count > 0)
                {
                    fcmmodel = fcmlist[0];
                    fcmid    = fcmmodel.ID;
                }
                else
                {
                    fcmmodel              = new Hi.Model.YZT_FCmaterials();
                    fcmmodel.CompID       = 0;
                    fcmmodel.DisID        = DisID.ToInt(0);
                    fcmmodel.type         = 2;
                    fcmmodel.ts           = DateTime.Now;
                    fcmmodel.modifyuser   = UserID.ToInt(0);
                    fcmmodel.CreateUserID = UserID.ToInt(0);
                    fcmmodel.CreateDate   = DateTime.Now;
                    fcmmodel.dr           = 0;
                    fcmid = new Hi.BLL.YZT_FCmaterials().Add(fcmmodel, Tran);
                }

                int    count       = id;
                string ProvideData = cmModel.ProvideData;
                if (ProvideData.IndexOf("1") > -1)
                {
                    //营业执照
                    Hi.Model.YZT_Annex annexModel1 = insertAnnex(id, 5, HidFfileName1, validDate1, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel1, Tran);

                    Hi.Model.YZT_Annex updateModel1 = UpFCmaterials(dt, 5, HidFfileName1, validDate1, UserID);
                    if (updateModel1 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel1, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 5, HidFfileName1, validDate1, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (ProvideData.IndexOf("2") > -1)
                {
                    //医疗器械经营许可证
                    Hi.Model.YZT_Annex annexModel2 = insertAnnex(id, 7, HidFfileName2, validDate2, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);

                    Hi.Model.YZT_Annex updateModel2 = UpFCmaterials(dt, 7, HidFfileName2, validDate2, UserID);
                    if (updateModel2 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel2, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 7, HidFfileName2, validDate2, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (ProvideData.IndexOf("3") > -1)
                {
                    //开户许可证
                    Hi.Model.YZT_Annex annexModel3 = insertAnnex(id, 9, HidFfileName3, validDate3, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel3, Tran);

                    Hi.Model.YZT_Annex updateModel3 = UpFCmaterials(dt, 9, HidFfileName3, validDate3, UserID);
                    if (updateModel3 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel3, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 9, HidFfileName3, validDate3, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (ProvideData.IndexOf("4") > -1)
                {
                    //医疗器械备案
                    Hi.Model.YZT_Annex annexModel4 = insertAnnex(id, 8, HidFfileName4, validDate4, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel4, Tran);

                    Hi.Model.YZT_Annex updateModel4 = UpFCmaterials(dt, 8, HidFfileName4, validDate4, UserID);
                    if (updateModel4 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel4, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 8, HidFfileName4, validDate4, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (count <= 0)
                {
                    Tran.Rollback();
                    Msg.code = "编辑异常!";
                    return(new JavaScriptSerializer().Serialize(Msg));
                }
                Tran.Commit();
                Msg.result = true;
            }
            else
            {
                Tran.Rollback();
                Msg.code = "编辑异常!";
            }
        }
        catch (Exception)
        {
            Msg.code = "编辑异常!";
            throw;
        }
        return(new JavaScriptSerializer().Serialize(Msg));
    }
Esempio n. 9
0
    public static string Edit(string KeyID, string UserID, string ForceDate, string InvalidDate, string HidFfileName1, string validDate1, string HidFfileName2, string validDate2, string HidFfileName3, string validDate3, string HidFfileName4, string validDate4, string ApplyRemark)
    {
        //
        Common.ResultMessage Msg = new Common.ResultMessage();

        Hi.Model.YZT_FirstCamp firstcamp = new Hi.BLL.YZT_FirstCamp().GetModel(KeyID.ToInt(0));

        string ProvideData = new Hi.BLL.YZT_CMerchants().GetModel(firstcamp.CMID).ProvideData;

        //首营信息
        string    sql = "select an.*,fc.ID from YZT_Annex an left join YZT_FCmaterials fc  on an.fcID =fc.ID and an.fileAlias in (4) and an.type in(5,7,8,9) where fc.DisID=" + firstcamp.DisID + " and ISNULL(fc.dr,0)=0 and fc.type=2 and ISNULL(an.dr,0)=0";
        DataTable dt  = SqlHelper.GetTable(SqlHelper.LocalSqlServer, sql);

        SqlTransaction Tran = null;

        try
        {
            Tran = DBUtility.SqlHelper.CreateStoreTranSaction();

            firstcamp.ForceDate   = ForceDate != "" ? Convert.ToDateTime(ForceDate) : DateTime.MinValue;
            firstcamp.InvalidDate = InvalidDate != "" ? Convert.ToDateTime(InvalidDate) : DateTime.MinValue;
            firstcamp.Applyremark = ApplyRemark;

            firstcamp.ts         = DateTime.Now;
            firstcamp.modifyuser = UserID.ToInt(0);

            bool id = new Hi.BLL.YZT_FirstCamp().Update(firstcamp, Tran);

            if (id)
            {
                string annexdel = " fileAlias=1 and type in(5,7,9,8) and fcID=" + KeyID;
                new Hi.BLL.YZT_Annex().AnnexDelete(annexdel, Tran);

                List <Hi.Model.YZT_FCmaterials> fcmlist = new Hi.BLL.YZT_FCmaterials().GetList("", " type=2 and DisID=" + firstcamp.DisID, "");
                int fcmid = 0;
                Hi.Model.YZT_FCmaterials fcmmodel = null;
                if (fcmlist != null && fcmlist.Count > 0)
                {
                    fcmmodel = fcmlist[0];
                    fcmid    = fcmmodel.ID;
                }
                else
                {
                    fcmmodel              = new Hi.Model.YZT_FCmaterials();
                    fcmmodel.CompID       = 0;
                    fcmmodel.DisID        = firstcamp.DisID;
                    fcmmodel.type         = 2;
                    fcmmodel.ts           = DateTime.Now;
                    fcmmodel.modifyuser   = UserID.ToInt(0);
                    fcmmodel.CreateUserID = UserID.ToInt(0);
                    fcmmodel.CreateDate   = DateTime.Now;
                    fcmmodel.dr           = 0;
                    fcmid = new Hi.BLL.YZT_FCmaterials().Add(fcmmodel, Tran);
                }

                bool count = id;
                if (ProvideData.IndexOf("1") > -1)
                {
                    //营业执照
                    Hi.Model.YZT_Annex annexModel1 = insertAnnex(KeyID.ToInt(0), 5, HidFfileName1, validDate1, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel1, Tran) > 0;

                    Hi.Model.YZT_Annex updateModel1 = UpFCmaterials(dt, 5, HidFfileName1, validDate1, UserID);
                    if (updateModel1 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel1, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 5, HidFfileName1, validDate1, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (ProvideData.IndexOf("2") > -1)
                {
                    //医疗器械经营许可证
                    Hi.Model.YZT_Annex annexModel2 = insertAnnex(KeyID.ToInt(0), 7, HidFfileName2, validDate2, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran) > 0;

                    Hi.Model.YZT_Annex updateModel2 = UpFCmaterials(dt, 7, HidFfileName2, validDate2, UserID);
                    if (updateModel2 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel2, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 7, HidFfileName2, validDate2, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (ProvideData.IndexOf("3") > -1)
                {
                    //开户许可证
                    Hi.Model.YZT_Annex annexModel3 = insertAnnex(KeyID.ToInt(0), 9, HidFfileName3, validDate3, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel3, Tran) > 0;

                    Hi.Model.YZT_Annex updateModel3 = UpFCmaterials(dt, 9, HidFfileName3, validDate3, UserID);
                    if (updateModel3 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel3, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 9, HidFfileName3, validDate3, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (ProvideData.IndexOf("4") > -1)
                {
                    //医疗器械备案
                    Hi.Model.YZT_Annex annexModel4 = insertAnnex(KeyID.ToInt(0), 8, HidFfileName4, validDate4, UserID, "1");
                    count = new Hi.BLL.YZT_Annex().Add(annexModel4, Tran) > 0;

                    Hi.Model.YZT_Annex updateModel4 = UpFCmaterials(dt, 8, HidFfileName4, validDate4, UserID);
                    if (updateModel4 != null)
                    {
                        new Hi.BLL.YZT_Annex().Update(updateModel4, Tran);
                    }
                    else
                    {
                        Hi.Model.YZT_Annex annexModel11 = insertAnnex(fcmid, 8, HidFfileName4, validDate4, UserID, "4");
                        new Hi.BLL.YZT_Annex().Add(annexModel11, Tran);
                    }
                }
                if (count)
                {
                    Tran.Commit();
                    Msg.result = true;
                }
                else
                {
                    Tran.Rollback();
                    Msg.code = "编辑异常!";
                }
            }
            else
            {
                Tran.Rollback();
                Msg.code = "编辑异常!";
            }
        }
        catch (Exception)
        {
            Msg.code = "编辑异常!";
            throw;
        }
        return(new JavaScriptSerializer().Serialize(Msg));
    }
Esempio n. 10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hi.Model.YZT_Annex model)
 {
     return(dal.Update(model));
 }
Esempio n. 11
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Hi.Model.YZT_Annex model)
 {
     return(dal.Add(model));
 }
Esempio n. 12
0
    /// <summary>
    /// 上传合同
    /// </summary>
    /// <param name="Name"></param>
    /// <param name="vDate"></param>
    public void insertContract(string Name, string txtForceDate, string txtInvalidDate)
    {
        string         json = "";
        SqlTransaction tran = null;

        if (!string.IsNullOrWhiteSpace(Name))
        {
            try
            {
                tran = SqlHelper.CreateStoreTranSaction();
                DateTime time = DateTime.Now;
                Hi.Model.YZT_Contract contractModel = new Hi.Model.YZT_Contract();
                contractModel.contractNO   = "";
                contractModel.contractDate = time;
                contractModel.DisID        = KeyID;
                contractModel.CState       = 3;//线下合同
                contractModel.ForceDate    = Convert.ToDateTime(txtForceDate);
                contractModel.InvalidDate  = Convert.ToDateTime(txtInvalidDate);
                contractModel.Remark       = "线下合同";
                contractModel.CreateDate   = DateTime.Now;
                contractModel.CreateUserID = UserID;
                contractModel.dr           = 0;
                contractModel.ts           = DateTime.Now;
                contractModel.modifyuser   = UserID;
                contractModel.CompID       = CompID;
                int Cid = new Hi.BLL.YZT_Contract().Add(contractModel, tran);
                Hi.Model.YZT_Annex annexModel = new Hi.Model.YZT_Annex();
                annexModel.fcID         = Convert.ToInt32(Cid);
                annexModel.type         = 10;
                annexModel.fileName     = Name;
                annexModel.fileAlias    = "3";
                annexModel.validDate    = Convert.ToDateTime(txtInvalidDate);
                annexModel.CreateDate   = time;
                annexModel.dr           = 0;
                annexModel.ts           = time;
                annexModel.modifyuser   = UserID;
                annexModel.CreateUserID = UserID;
                int count = new Hi.BLL.YZT_Annex().Add(annexModel, tran);
                tran.Commit();
                if (count > 0)
                {
                    json = "{\"ret\":\"ok\"}";
                }
                else
                {
                    json = "{\"ret\":\"上传失败\"}";
                }
            }
            catch (Exception e)
            {
                tran.Rollback();
                json = "{\"ret\":\"" + e.Message + "\"}";
            }
        }
        else
        {
            json = "{\"ret\":\"附件不能为空!\"}";
        }
        Response.Write(json);
        Response.End();
    }
Esempio n. 13
0
    /// <summary>
    /// 修改时  需要新增的附件
    /// </summary>
    private void updateIndestAnnex(List <Hi.Model.YZT_Annex> annexList, string id, SqlTransaction Tran)
    {
        List <Hi.Model.YZT_Annex> annex1 = annexList.Where(a => a.type == 5).ToList();

        if (annex1.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName.Value.Trim()))
        {
            //新增营业执照附件表
            Hi.Model.YZT_Annex annexModel = insertAnnex(Convert.ToInt32(id), 5, this.HidFfileName.Value.Trim(), this.validDate.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel, Tran);
        }

        List <Hi.Model.YZT_Annex> annex2 = annexList.Where(a => a.type == 7).ToList();

        if (annex2.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName2.Value.Trim()))
        {
            //新增医疗器械经营许可证附件表
            Hi.Model.YZT_Annex annexModel = insertAnnex(Convert.ToInt32(id), 7, this.HidFfileName2.Value.Trim(), this.validDate2.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel, Tran);
        }

        List <Hi.Model.YZT_Annex> annex3 = annexList.Where(a => a.type == 8).ToList();

        if (annex3.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName3.Value.Trim()))
        {
            //新增营业执照附件表
            Hi.Model.YZT_Annex annexModel = insertAnnex(Convert.ToInt32(id), 8, this.HidFfileName3.Value.Trim(), this.validDate3.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel, Tran);
        }

        List <Hi.Model.YZT_Annex> annex4 = annexList.Where(a => a.type == 9).ToList();

        if (annex4.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName4.Value.Trim()))
        {
            //新增生产许可证表
            Hi.Model.YZT_Annex annexModel4 = insertAnnex(Convert.ToInt32(id), 9, this.HidFfileName4.Value.Trim(), this.validDate4.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel4, Tran);
        }


        List <Hi.Model.YZT_Annex> annex11 = annexList.Where(a => a.type == 12).ToList();

        if (annex11.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName11.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 12, this.HidFfileName11.Value.Trim(), this.validDate11.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex12 = annexList.Where(a => a.type == 13).ToList();

        if (annex12.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName12.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 13, this.HidFfileName12.Value.Trim(), this.validDate12.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex5 = annexList.Where(a => a.type == 14).ToList();

        if (annex5.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName5.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 14, this.HidFfileName5.Value.Trim(), this.validDate5.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex6 = annexList.Where(a => a.type == 15).ToList();

        if (annex6.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName6.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 15, this.HidFfileName6.Value.Trim(), this.validDate6.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex7 = annexList.Where(a => a.type == 16).ToList();

        if (annex7.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName7.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 16, this.HidFfileName7.Value.Trim(), this.validDate7.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex8 = annexList.Where(a => a.type == 17).ToList();

        if (annex8.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName8.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 17, this.HidFfileName8.Value.Trim(), this.validDate8.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex9 = annexList.Where(a => a.type == 18).ToList();

        if (annex9.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName9.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 18, this.HidFfileName9.Value.Trim(), this.validDate9.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }

        List <Hi.Model.YZT_Annex> annex10 = annexList.Where(a => a.type == 19).ToList();

        if (annex10.Count <= 0 && !string.IsNullOrWhiteSpace(this.HidFfileName10.Value.Trim()))
        {
            Hi.Model.YZT_Annex annexModel2 = insertAnnex(Convert.ToInt32(id), 19, this.HidFfileName10.Value.Trim(), this.validDate10.Value.Trim());
            int count = new Hi.BLL.YZT_Annex().Add(annexModel2, Tran);
        }
    }