Ejemplo n.º 1
0
        public List <Model.ObjSub> objsublist = null; //结果值
        protected override void SetPowerZone()
        {
            int id = Convert.ToInt32(Request.QueryString["xxid"]);

            uid.Value = id.ToString();
            objuser   = BLL.ObjUser.GetModel(id);
            obj       = BLL.OObject.GetModel(objuser.ObjID);
            oapply    = BLL.ObjUserApply.GetModelOID(objuser.BaoMingOID);
            listChild = BLL.ObjChild.GetModelList(" ID IN(" + oapply.SubID + ") ");
            listExcel = BLL.ObjExcel.GetModelList(" ObjOID='" + obj.ObjOID + "' ");


            objsample = BLL.ObjSample.GetModelOID(objuser.YangPinOID);
            obj       = BLL.OObject.GetModel(oapply.ObjID);
            tmember   = BLL.Member.GetModelByMID(oapply.MID);


            objsubuser = BLL.ObjSubUser.GetModelList(" SpInt=" + obj.ID + " AND MID='" + tmember.MID + "'").FirstOrDefault();
            if (objsubuser != null)
            {
                string[] sublist = objsubuser.Spare.Split(',');
                string   substr  = "";
                foreach (var item in sublist)
                {
                    if (string.IsNullOrEmpty(item))
                    {
                        continue;
                    }
                    substr += "'" + item + "',";
                }

                objsublist = BLL.ObjSub.GetModelList(" OID in(" + substr.Substring(0, substr.Length - 1) + ") ");
            }
        }
Ejemplo n.º 2
0
        protected override string btnModify_Click()
        {
            string xx = Request.Form["remsg"];

            lock (lockobj)
            {
                Hashtable          MyHs    = new Hashtable();
                Model.ObjUserApply oamodel = BLL.ObjUserApply.GetModel(Convert.ToInt32(Request.Form["oaid"]));
                if (oamodel.SState != 0)
                {
                    return("此状态不能打回");
                }

                oamodel.SState  = 1;
                oamodel.ReSpare = xx;
                BLL.ObjUserApply.Update(oamodel, MyHs);

                Model.ObjUser oumodel = BLL.ObjUser.GetModelBaoMingOID(oamodel.BaoMingCode);
                oumodel.BState = 1;
                BLL.ObjUser.Update(oumodel, MyHs);
                if (BLL.CommonBase.RunHashtable(MyHs))
                {
                    BLL.OperationRecordBLL.Add(TModel.MID, "报名信息打回", "报名编号为:" + oamodel.BaoMingCode);
                    return("打回成功");
                }
                else
                {
                    return("报名审核打回失败");
                }
            }
        }
        protected override string btnAdd_Click()
        {
            Model.ObjUser    ouser    = BLL.ObjUser.GetModel(Convert.ToInt32(Request.Form["uid"]));
            Model.ObjSubUser Osubuser = BLL.ObjSubUser.GetModel(Convert.ToInt32(Request.Form["osuid"]));

            Hashtable MyHs = new Hashtable();

            if (ouser.RState != 1)
            {
                return("状态已更新,请刷新");
            }
            ouser.RState       = 3;
            ouser.USState      = 3;
            ouser.RDate        = DateTime.Now;
            ouser.ZhengShuCode = Guid.NewGuid().ToString("D");
            BLL.ObjUser.Update(ouser);

            Osubuser.SState = 3;
            BLL.ObjSubUser.Update(Osubuser, MyHs);

            Model.ObjUserApply oua = BLL.ObjUserApply.GetModelOID(ouser.BaoMingOID);
            oua.YZState = 1;
            BLL.ObjUserApply.Update(oua, MyHs);


            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                BLL.OperationRecordBLL.Add(TModel.MID, "验证结果审核成功", "项目名称为:" + ouser.ObjName + ",结果提交人为:" + ouser.MID);
                return("审核成功");
            }
            else
            {
                return("审核失败");
            }
        }
Ejemplo n.º 4
0
        protected override void SetPowerZone()
        {
            int pid = Convert.ToInt32(Request.QueryString["xxid"]);

            oid.Value = pid.ToString();

            int bm = Convert.ToInt32(Request.QueryString["bmid"]);

            bmid.Value = bm.ToString();

            oua              = BLL.ObjUserApply.GetModel(bm);
            uploadurl.Value  = oua.BaoMingImgUrl;
            uploadurl2.Value = oua.FeiYongImgUrl;


            obj       = BLL.OObject.GetModel(pid);
            listExcel = BLL.ObjExcel.GetModelList(" ObjOID='" + obj.ObjOID + "' ");
            listChild = BLL.ObjChild.GetModelList(" ObjOID='" + obj.ObjOID + "' ");
            Random rd = new Random();
            int    cc = rd.Next(1000, 9999);

            roam.Value  = cc.ToString();
            roam2.Value = cc.ToString();
            rdstr       = cc.ToString();
        }
Ejemplo n.º 5
0
        protected override void SetPowerZone()
        {
            HardUrl = BLL.Member.ManageMember.TModel.QRCode;
            int xxid = Convert.ToInt32(Request.QueryString["xxid"]);

            obj       = BLL.ObjUser.GetModel(xxid);
            JGDate    = Baodate2Chinese(Convert.ToDateTime(obj.RDate).ToString("yyyy-MM-dd"));
            userapply = BLL.ObjUserApply.GetModelOID(obj.BaoMingOID);
        }
Ejemplo n.º 6
0
        protected override void SetPowerZone()
        {
            int oid = Convert.ToInt32(Request.QueryString["xxid"]);

            oaid.Value = oid.ToString();
            oapply     = BLL.ObjUserApply.GetModel(oid);
            listChild  = BLL.ObjChild.GetModelList(" ID IN(" + oapply.SubID + ") ");
            obj        = BLL.OObject.GetModel(oapply.ObjID);
            tmember    = BLL.Member.GetModelByMID(oapply.MID);
        }
Ejemplo n.º 7
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1' and OState=3 ";

            if (!string.IsNullOrEmpty(context.Request["nTitle"]))
            {
                strWhere += " and ObjName like '%" + HttpUtility.UrlDecode(context.Request["nTitle"]) + "%'";
            }

            int count;
            List <Model.OObject> ListO = BLL.OObject.GetList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListO.Count; i++)
            {
                Model.ObjUserApply oba = BLL.ObjUserApply.GetModelList(" MID='" + TModel.MID + "' and [OBJID]=" + ListO[i].ID + " and YZState=0; ").FirstOrDefault();
                sb.Append(ListO[i].ID + "~");
                sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                sb.Append(ListO[i].ReObjMID + "~");
                sb.Append(ListO[i].ObjName + "~");
                //sb.Append(ListO[i].CreateDate.ToString("yyyy-MM-dd HH:mm") + "~");
                sb.Append(ListO[i].BMDate.ToString("yyyy-MM-dd HH:mm") + "~");
                sb.Append((ListO[i].SState == 1?"已结束":"正在进行") + "~");
                sb.Append((oba != null ? (oba.SState.ToString().Replace("0", "未审核").Replace("1", "<span style='color:red;'>打回</span>").Replace("3", "<span style='color:green;'>已审核</span>")) : "未报名") + "~");
                sb.Append((oba != null ? oba.ReSpare : "") + "~");
                if (ListO[i].SState == 0)
                {
                    if (ListO[i].BMDate < DateTime.Now)
                    {
                        sb.Append((BMState(TModel.MID, ListO[i].ID) == "可报名" ? "<div  class=\"pay btn btn-success\" style=\"background-color: darkgray;\" >报名</div > " : ""));
                    }
                    else
                    {
                        sb.Append((BMState(TModel.MID, ListO[i].ID) == "可报名" ? "<div  class=\"pay btn btn-success\" onclick=\"callhtml('/ProjectManage/SignProject.aspx?xxid=" + ListO[i].ID + "','报名')\">报名</div > " : ""));
                    }

                    if (oba != null && oba.SState == 1)
                    {
                        sb.Append("<div  class=\"pay btn btn-success\" onclick=\"callhtml('/ProjectManage/ModifySignProject.aspx?xxid=" + ListO[i].ID + "&bmid=" + oba.ID + "','修改')\">修改</div>");
                    }
                }

                sb.Append("≌");
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
Ejemplo n.º 8
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1'";

            if (!string.IsNullOrEmpty(context.Request["IsState"]))
            {
                strWhere += " and SState in(" + HttpUtility.UrlDecode(context.Request["IsState"]) + ")";
            }

            if (!string.IsNullOrEmpty(context.Request["bmoid"]))
            {
                strWhere += " and OBJID=" + context.Request["bmoid"] + "";
            }

            //如果是单位部门的话 能管理自己发布的项目
            if (!TModel.Role.IsAdmin)
            {
                strWhere += " and  objID IN(SELECT ID FROM OObject WHERE ReObjMID='" + TModel.MID + "') ";
            }
            int count;
            List <Model.ObjSample> ListO = BLL.ObjSample.GetList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListO.Count; i++)
            {
                Model.OObject      obj    = BLL.OObject.GetModel(ListO[i].ObjID);
                Model.ObjUser      ouser  = BLL.ObjUser.GetModel(ListO[i].SpInt);
                Model.ObjUserApply oapply = BLL.ObjUserApply.GetModelOID(ouser.BaoMingOID);
                sb.Append(ListO[i].ID + "~");
                sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                sb.Append(obj.ObjOID + "~");
                sb.Append(obj.ObjName + "~");
                sb.Append(ouser.DanWeiName + "~");
                sb.Append(ListO[i].Spare + "~");
                sb.Append("<a href='" + ListO[i].YangPinImgUrl + "' target='_blank'><img width='80' height='80' src='" + ListO[i].YangPinImgUrl + "' /></a>" + "~");
                sb.Append(oapply.CreateDate.ToString("yyyy-MM-dd HH:mm") + "~");
                sb.Append(ListO[i].SState.ToString().Replace("0", "未寄送").Replace("1", "已寄送,未确认").Replace("2", "损坏,待重新寄送").Replace("3", "寄送完成") + "~");
                sb.Append(((ListO[i].SState == 0 || ListO[i].SState == 2) ? "<div  class=\"pay btn btn-success\" onclick=\"callhtml('/ProjectManage/SampleJS.aspx?xxid=" + ListO[i].ID + "','样品寄送')\">样品寄送</ div > " : ""));
                sb.Append("≌");
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
Ejemplo n.º 9
0
        protected override void SetPowerZone()
        {
            int oid = Convert.ToInt32(Request.QueryString["xxid"]);

            oaid.Value = oid.ToString();
            objS       = BLL.ObjSample.GetModel(oid);

            Model.OObject oobject = BLL.OObject.GetModel(objS.ObjID);


            objU = BLL.ObjUser.GetModelOID(objS.OjbOID);
            objA = BLL.ObjUserApply.GetModelOID(objU.BaoMingOID);

            YangPinCode.Value = oobject.ObjOID + "_" + objA.BMInt;

            listChild = BLL.ObjChild.GetModelList(" ID IN(" + objA.SubID + ") ");
            BMMember  = BLL.Member.GetModelByMID(objA.MID);
        }
Ejemplo n.º 10
0
        protected override void SetPowerZone()
        {
            int pid = Convert.ToInt32(Request.QueryString["xxid"]);

            OUSER     = BLL.ObjUser.GetModel(pid);
            uid.Value = pid.ToString();
            oid.Value = OUSER.ObjID.ToString();
            obj       = BLL.OObject.GetModel(OUSER.ObjID);

            Model.ObjUserApply oA = BLL.ObjUserApply.GetModelOID(OUSER.BaoMingOID);
            listExcel = BLL.ObjExcel.GetModelList(" ObjOID='" + obj.ObjOID + "' ");
            listChild = BLL.ObjChild.GetModelList(" ID in(" + oA.SubID + ") ");
            Random rd = new Random();
            int    cc = rd.Next(1000, 9999);

            roam.Value = cc.ToString();
            rdstr      = cc.ToString();
        }
Ejemplo n.º 11
0
        protected override string btnAdd_Click()
        {
            lock (lockobj)
            {
                Hashtable          MyHs    = new Hashtable();
                Model.ObjUserApply oamodel = BLL.ObjUserApply.GetModel(Convert.ToInt32(Request.Form["oaid"]));
                if (oamodel.SState != 0)
                {
                    return("此状态不能审核");
                }
                oamodel.SState = 3;
                int AddInt = Convert.ToInt32(BLL.CommonBase.GetSingle("select COUNT(*) from ObjUserApply where SState=3 and objID=" + oamodel.ObjID + ";"));
                oamodel.BMInt = 1000 + AddInt + 1;
                BLL.ObjUserApply.Update(oamodel, MyHs);

                Model.ObjUser oumodel = BLL.ObjUser.GetModelBaoMingOID(oamodel.BaoMingCode);
                oumodel.BState = 3;
                BLL.ObjUser.Update(oumodel, MyHs);

                Model.Member bmmember = BLL.Member.GetModelByMID(oamodel.MID);
                //添加样品表
                Model.ObjSample ObjS = new Model.ObjSample();
                ObjS.ObjID       = oamodel.ObjID;
                ObjS.MID         = oamodel.MID;
                ObjS.YangPinCode = "";
                ObjS.CreateDate  = DateTime.Now;
                ObjS.SState      = 0;
                ObjS.SpInt       = oumodel.ID;
                ObjS.Spare       = bmmember.Address;
                ObjS.OID         = Guid.NewGuid().ToString("N");
                ObjS.OjbOID      = oumodel.OID;
                BLL.ObjSample.Add(ObjS, MyHs);

                if (BLL.CommonBase.RunHashtable(MyHs))
                {
                    BLL.OperationRecordBLL.Add(TModel.MID, "报名信息审核成功", "报名编号为:" + oamodel.BaoMingCode);
                    return("审核成功");
                }
                else
                {
                    return("报名审核失败");
                }
            }
        }
Ejemplo n.º 12
0
        protected override void SetPowerZone()
        {
            int oid = Convert.ToInt32(Request.QueryString["xxid"]);

            oaid.Value = oid.ToString();
            objS       = BLL.ObjSample.GetModel(oid);
            objU       = BLL.ObjUser.GetModelOID(objS.OjbOID);
            objA       = BLL.ObjUserApply.GetModelOID(objU.BaoMingOID);
            listChild  = BLL.ObjChild.GetModelList(" ID IN(" + objA.SubID + ") ");
            BMMember   = BLL.Member.GetModelByMID(objA.MID);
            Model.OObject objO = BLL.OObject.GetModel(objS.ObjID);

            listExcel = BLL.ObjExcel.GetModelList(" ObjOID='" + objO.ObjOID + "' ");

            Random rd = new Random();
            int    cc = rd.Next(1000, 9999);

            roam.Value = cc.ToString();
            rdstr      = cc.ToString();
        }
Ejemplo n.º 13
0
        protected override string btnAdd_Click()
        {
            Model.ObjUserApply oua = BLL.ObjUserApply.GetModel(Convert.ToInt32(Request.Form["bmid"]));
            if (oua.SState != 1)
            {
                return("此状态不能修改报名信息");
            }

            Model.OObject obj = BLL.OObject.GetModel(Convert.ToInt32(Request.Form["oid"]));

            if (obj.BMDate < DateTime.Now)
            {
                return("已超出报名时间,不能修改");
            }

            Hashtable MyHs = new Hashtable();

            oua.CreateDate    = DateTime.Now;
            oua.ComDate       = DateTime.MaxValue;
            oua.SubID         = Request.Form["ChildValue"];
            oua.BaoMingImgUrl = Request.Form["uploadurl"];
            oua.FeiYongImgUrl = Request.Form["uploadurl2"];
            oua.SState        = 0;
            oua.ReSpare       = "";
            BLL.ObjUserApply.Update(oua, MyHs);

            Model.ObjUser oumodel = BLL.ObjUser.GetModelBaoMingOID(oua.BaoMingCode);
            oumodel.BState = 0;
            BLL.ObjUser.Update(oumodel, MyHs);
            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                BLL.OperationRecordBLL.Add(TModel.MID, "修改报名信息", "报名编号为:" + oua.BaoMingCode);
                return("报名修改成功");
            }
            else
            {
                return("报名修改失败");
            }
        }
Ejemplo n.º 14
0
        protected override void SetPowerZone()
        {
            int pid = Convert.ToInt32(Request.QueryString["xxid"]);

            OUSER     = BLL.ObjUser.GetModel(pid);
            uid.Value = pid.ToString();         // ObjUser ID
            oid.Value = OUSER.ObjID.ToString(); //OObject ID
            obj       = BLL.OObject.GetModel(OUSER.ObjID);

            Model.ObjUserApply oA = BLL.ObjUserApply.GetModelOID(OUSER.BaoMingOID);
            listExcel = BLL.ObjExcel.GetModelList(" ObjOID='" + obj.ObjOID + "' ");

            OSU           = BLL.ObjSubUser.GetModelList(" MID='" + OUSER.MID + "' AND SpInt=" + obj.ID + " and SState!=3 ").FirstOrDefault();
            osuid.Value   = OSU.ID.ToString();
            FangFa.Value  = OSU.RFangFa;
            YiQi.Value    = OSU.RSheBei;
            YiChang.Value = OSU.RYiChang;

            string[] sublist = OSU.Spare.Split(',');
            string   substr  = "";

            foreach (var item in sublist)
            {
                if (string.IsNullOrEmpty(item))
                {
                    continue;
                }
                substr += "'" + item + "',";
            }

            listChild = BLL.ObjSub.GetModelList(" OID in(" + substr.Substring(0, substr.Length - 1) + ") ");
            Random rd = new Random();
            int    cc = rd.Next(1000, 9999);

            rdstr = cc.ToString();
        }
Ejemplo n.º 15
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1' ";

            //if (!string.IsNullOrEmpty(context.Request["nBMTitle"]))
            //{
            //    strWhere += " and DanWeiName like '%" + HttpUtility.UrlDecode(context.Request["nBMTitle"]) + "%'";
            //}

            if (!string.IsNullOrEmpty(context.Request["HYmid"]))
            {
                strWhere += " and MID like '%" + context.Request["HYmid"] + "%'";
            }

            //if (!string.IsNullOrEmpty(context.Request["IsBMState"]))
            //{
            //    strWhere += " and BState in(" + HttpUtility.UrlDecode(context.Request["IsBMState"]) + ")";
            //}

            //if (!string.IsNullOrEmpty(context.Request["IsYangPin"]))
            //{
            //    strWhere += " and YState in(" + HttpUtility.UrlDecode(context.Request["IsYangPin"]) + ")";
            //}

            if (!string.IsNullOrEmpty(context.Request["SHState"]))
            {
                strWhere += " and SHInt =" + context.Request["SHState"] + " ";
            }

            if (!string.IsNullOrEmpty(context.Request["ObjCode"]))
            {
                strWhere += " and  objOID =  '" + context.Request["ObjCode"].Trim() + "' ";
            }

            if (!string.IsNullOrEmpty(context.Request["Grouping"]))
            {
                strWhere += " and  Grouping =  '" + context.Request["Grouping"].Trim() + "' ";
            }

            if (!string.IsNullOrEmpty(context.Request["ObjName"]))
            {
                strWhere += " and  objID IN(SELECT ID FROM OObject WHERE ObjName like  '%" + context.Request["ObjName"].Trim() + "%') ";
            }

            if (!string.IsNullOrEmpty(context.Request["ObjReMID"]))
            {
                strWhere += " and  objID IN(SELECT ID FROM OObject WHERE ReObjMID =  '" + context.Request["ObjReMID"].Trim() + "') ";
            }

            if (!string.IsNullOrEmpty(context.Request["JGWhere"]) && !string.IsNullOrEmpty(context.Request["JGType"]) && !string.IsNullOrEmpty(context.Request["JGValue"]))
            {
                strWhere += " and " + context.Request["JGWhere"] + context.Request["JGType"] + context.Request["JGValue"] + " ";
            }

            //如果是单位部门的话 能管理自己发布的项目
            if (!TModel.Role.IsAdmin)
            {
                strWhere += " and  objID IN(SELECT ID FROM OObject WHERE ReObjMID='" + TModel.MID + "') ";
            }

            if (!string.IsNullOrEmpty(context.Request["IsSState"]))
            {
                strWhere += " and  objID IN(SELECT ID FROM OObject WHERE SState='" + context.Request["IsSState"] + "') ";
            }

            int count;
            List <Model.ObjSub> ListO = BLL.ObjSub.GetList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListO.Count; i++)
            {
                Model.OObject      obj = BLL.OObject.GetModel(ListO[i].ObjID);
                Model.ObjUserApply oua = BLL.ObjUserApply.GetModel(ListO[i].SpInt);
                Model.ObjUser      ou  = BLL.ObjUser.GetModel(ListO[i].URID);

                //Model.ObjSubUser objsub = BLL.ObjSubUser.GetModelList(" SpInt=" + obj.ID + " and MID='" + TModel.MID + "' ").FirstOrDefault();
                sb.Append(ListO[i].ID + "~");
                sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                sb.Append(obj.ObjOID + "~");
                sb.Append(obj.ObjName + "~");
                sb.Append(oua.DanWeiName + "~");
                sb.Append(oua.CreateDate + "~");
                sb.Append(ListO[i].Spare + "~");
                sb.Append((ou.USState.ToString().Replace("0", "待审核").Replace("2", "打回").Replace("3", "审核通过")) + "~");
                sb.Append((ListO[i].ResultOne) + "~");
                sb.Append((ListO[i].ResultTwo) + "~");
                sb.Append((ListO[i].ResultAvg) + "~");
                sb.Append((ListO[i].Serial) + "~");
                sb.Append((ListO[i].Grouping) + "~");
                sb.Append((ListO[i].ZB) + "~");
                sb.Append((ListO[i].Q1) + "~");
                sb.Append((ListO[i].Q2) + "~");
                sb.Append((ListO[i].IRQ) + "~");
                sb.Append((ListO[i].M) + "~");
                sb.Append((ListO[i].NIRQ) + "~");
                sb.Append((ListO[i].ResultStatus) + "~");

                sb.Append((ListO[i].SHInt.ToString().Replace("0", "待审核").Replace("2", "不合格").Replace("1", "合格")) + "~");
                if (ListO[i].SHInt == 0)
                {
                    sb.Append("<div  class=\"pay btn btn-success\" onclick=\"SHChange('" + ListO[i].ID + "')\">合格</div>");
                    sb.Append("<div  class=\"pay btn btn-warning\" onclick=\"DHChange('" + ListO[i].ID + "')\">不合格</div>");
                }

                sb.Append("<div  class=\"pay btn btn-warning\" onclick=\"subModify('" + ListO[i].ID + "')\">修改</div>");
                sb.Append("≌");
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
Ejemplo n.º 16
0
        protected override string btnAdd_Click()
        {
            if (!TModel.MState)
            {
                return("您的账号未审核,不能报名");
            }
            Model.OObject obj = BLL.OObject.GetModel(Convert.ToInt32(Request.Form["oid"]));

            if (Convert.ToInt32(BLL.CommonBase.GetSingle("select COUNT(*) from ObjUserApply where MID='" + TModel.MID + "' and [OBJID]=" + obj.ID + " and YZState=0;")) > 0)
            {
                return("您已报名该项目,请自行查看进度");
            }
            if (obj.SState == 1)
            {
                return("该项目已结束,不能报名");
            }

            if (obj.BMDate < DateTime.Now)
            {
                return("已超出报名时间,不能报名");
            }

            Hashtable MyHs = new Hashtable();

            Model.ObjUserApply oua = new Model.ObjUserApply();
            oua.ObjID         = obj.ID;
            oua.MID           = TModel.MID;
            oua.BaoMingCode   = Guid.NewGuid().ToString("N");
            oua.DanWeiName    = TModel.MName;
            oua.ZiGeZhengShu  = TModel.FMID.Replace("0", "检测机构证书").Replace("1", "个人身份证").Replace("2", "其他");
            oua.ZhengShuCode  = TModel.NumID;
            oua.CreateDate    = DateTime.Now;
            oua.ComDate       = DateTime.MaxValue;
            oua.SubID         = Request.Form["ChildValue"];
            oua.BaoMingImgUrl = Request.Form["uploadurl"];
            oua.FeiYongImgUrl = Request.Form["uploadurl2"];
            oua.SState        = 0;
            BLL.ObjUserApply.Add(oua, MyHs);


            Model.ObjUser user = new Model.ObjUser();
            user.OID        = Guid.NewGuid().ToString("N");
            user.BaoMingOID = oua.BaoMingCode;
            user.ObjID      = obj.ID;
            user.ObjName    = obj.ObjName;
            user.USState    = 0;
            user.CreateDate = DateTime.Now;
            user.DanWeiName = TModel.MName;
            user.RState     = 0;
            user.BState     = 0;
            user.YState     = 0;
            user.YangPinOID = "";
            user.MID        = TModel.MID;
            BLL.ObjUser.Add(user, MyHs);
            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                BLL.OperationRecordBLL.Add(TModel.MID, "报名成功", "项目名称为:" + obj.ObjName + ",报名编号为:" + oua.BaoMingCode);
                return("报名成功");
            }
            else
            {
                return("报名失败");
            }
        }
Ejemplo n.º 17
0
        protected override string btnAdd_Click()
        {
            Hashtable MyHs = new Hashtable();

            Model.ObjUser OU = BLL.ObjUser.GetModel(Convert.ToInt32(Request.Form["uid"]));

            Model.OObject objxx = BLL.OObject.GetModel(OU.ObjID);

            if (Convert.ToInt32(BLL.CommonBase.GetSingle("select COUNT(*) from ObjSubUser where mid='" + TModel.MID + "' AND SpInt='" + OU.ObjID + "' and SState!=3 and sstate!=0;")) > 0)
            {
                return("您已提交过结果,请等待审核");
            }

            OU.RState      = 1;
            OU.RImgUrl     = Request.Form["uploadurl"];
            OU.RUpLoadDate = DateTime.Now;
            BLL.ObjUser.Update(OU, MyHs);

            Model.ObjUserApply    oA         = BLL.ObjUserApply.GetModelOID(OU.BaoMingOID);
            List <Model.ObjChild> listChild2 = BLL.ObjChild.GetModelList(" ID in(" + oA.SubID + ") ");
            string suboid = "";

            foreach (var item in listChild2)
            {
                string childone = Request.Form["ChildOne" + item.ID.ToString()];
                string childtwo = Request.Form["ChildTwo" + item.ID.ToString()];
                string childavg = Request.Form["ChildAvg" + item.ID.ToString()];

                if (string.IsNullOrEmpty(childone) || string.IsNullOrEmpty(childtwo) || string.IsNullOrEmpty(childavg))
                {
                    return("请填入结果值");
                }
                Model.ObjSub OSub = new Model.ObjSub();
                OSub.MID       = TModel.MID;
                OSub.OID       = Guid.NewGuid().ToString("N");
                OSub.ResultOne = childone;
                OSub.ResultTwo = childtwo;
                OSub.ResultAvg = childavg;
                OSub.Spare     = item.ChildName;
                OSub.CID       = item.ID;
                OSub.ObjID     = objxx.ID;
                OSub.ObjOID    = objxx.ObjOID;
                OSub.URID      = OU.ID;
                OSub.SpInt     = oA.ID;
                BLL.ObjSub.Add(OSub, MyHs);
                suboid += OSub.OID + ",";
            }

            //如果已有提交结果就修改,未提交过就生成
            Model.ObjSubUser reOBJSUB = BLL.ObjSubUser.GetModelList(" mid='" + TModel.MID + "' AND SpInt='" + OU.ObjID + "' and sstate=0;").FirstOrDefault();
            if (reOBJSUB == null)
            {
                Model.ObjSubUser objapply = new Model.ObjSubUser();
                objapply.MID          = TModel.MID;
                objapply.RFangFa      = Request.Form["FangFa"];
                objapply.RSheBei      = Request.Form["YiQi"];
                objapply.RYiChang     = Request.Form["YiChang"];
                objapply.ResultImgUrl = Request.Form["uploadurl"];
                objapply.SpInt        = Convert.ToInt32(Request.Form["oid"]);
                objapply.MID          = TModel.MID;
                objapply.SState       = 0;
                objapply.Spare        = suboid.Substring(0, suboid.Length - 1);
                BLL.ObjSubUser.Add(objapply, MyHs);
            }
            else
            {
                reOBJSUB.MID          = TModel.MID;
                reOBJSUB.RFangFa      = Request.Form["FangFa"];
                reOBJSUB.RSheBei      = Request.Form["YiQi"];
                reOBJSUB.RYiChang     = Request.Form["YiChang"];
                reOBJSUB.ResultImgUrl = Request.Form["uploadurl"];
                reOBJSUB.SpInt        = Convert.ToInt32(Request.Form["oid"]);
                reOBJSUB.MID          = TModel.MID;
                reOBJSUB.SState       = 0;
                reOBJSUB.Spare        = suboid.Substring(0, suboid.Length - 1);
                BLL.ObjSubUser.Update(reOBJSUB, MyHs);
            }


            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                BLL.OperationRecordBLL.Add(TModel.MID, "结果提交", "项目名称为:" + objxx.ObjName);
                return("结果提交成功,请等待审核");
            }
            else
            {
                return("提交失败");
            }
        }