コード例 #1
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                int result = bll.DeleteStatus(id);
                if (result > 0)
                {
                    msg.success = true;
                    //清空用户部门信息
                    string sql = "update Sys_Master set OrganizaId='' where OrganizaId='" + id + "';";
                    bll.ExecuteNonQueryByText(sql);
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #2
0
        public void ChangeUser()
        {
            var msg = new ModJsonResult();

            try
            {
                string UserId           = Request["UserId"].ToString().Trim();    //当前人
                string comResponsibleId = Request["comResponsibleId"].ToString(); //一键变更责任人.

                StringBuilder sb = new StringBuilder();
                //设备信息
                sb.Append("update Sys_Appointed set ResponsibleId='" + comResponsibleId + "' where ResponsibleId='" + UserId + "';");
                sb.AppendLine();
                //巡检记录
                sb.Append("update Sys_AppointCheckNotes set ResponsibleId='" + comResponsibleId + "' where ResponsibleId='" + UserId + "';");
                sb.AppendLine();
                int result = new BllSysMaster().ExecuteNonQueryByText(sb.ToString());
                msg.success = true;
                msg.msg     = "操作成功";
            }
            catch (Exception aa) {
                msg.success = false;
                msg.msg     = "操作失败," + aa.Message;
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #3
0
        public void SaveDeptListData()
        {
            ModJsonResult json            = new ModJsonResult();
            string        NameList        = Request["NameList"].ToString();
            string        CreateCompanyId = Request["CreateCompanyId"].ToString();//单位编号

            string[]      str = NameList.Split(',');
            StringBuilder sb  = new StringBuilder();

            for (int i = 0; i < str.Length; i++)
            {
                sb.Append("insert into Sys_Company(Id,Name,Level,Attribute,Status,CreateCompanyId)");
                sb.Append(" values(");
                sb.Append("'" + Guid.NewGuid().ToString() + "',");
                sb.Append("'" + str[i] + "',");
                sb.Append("'" + 0 + "',");
                sb.Append("'" + (int)CompanyType.部门 + "',");
                sb.Append("'" + (int)StatusEnum.正常 + "',");
                sb.Append("'" + CreateCompanyId + "'");
                sb.Append(")");
                sb.AppendLine();
            }
            int result = bll.ExecuteNonQueryByText(sb.ToString());

            if (result <= 0)
            {
                json.success = false;
                json.msg     = " 保存失败,请稍后再操作!";
            }
            WriteJsonToPage(json.ToString());
        }
コード例 #4
0
        /// <summary>
        /// 用户审核不通过
        /// </summary>
        public void GTPAuditcancel()
        {
            BllSysMaster Bll          = new BllSysMaster();
            string       Introduction = Request["Introduction"].ToString();
            var          msg          = new ModJsonResult();
            string       key          = Request["id"];
            var          model        = Bll.LoadData(key);
            int          result       = Bll.Delete(key);

            if (result > 0)
            {
                msg.success = true;
                //发送短信
                WebService.SDKService msm = new WebService.SDKService();
                string sn      = ConfigurationManager.AppSettings["sn"];
                string pwd     = ConfigurationManager.AppSettings["pwd"];
                string smstext = "您在电梯宝申请的账户信息审核没有通过,原因:【" + Introduction + "】,请麻烦您尽快重新申请.为您审批通过.";
                result = msm.sendSMS(sn.Trim().ToString(), pwd.Trim().ToString(), "", model.LoginName.Split(new char[] { ',' }), smstext, "", "GBK", 3, Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmssfff")));
            }
            else
            {
                msg.success = false;
                msg.msg     = "操作失败";
            }

            WriteJsonToPage(msg.ToString());
        }
コード例 #5
0
        /// <summary>
        /// 禁用状态
        /// </summary>
        public void EnableUse()
        {
            var msg = new ModJsonResult();

            if (CurrentMaster != null)
            {
                if (CurrentMaster.Id == Request["LoginUserId"].ToString())
                {
                    string key    = Request["id"];
                    int    result = new BllAdActive().UpdateStatus(1, key);
                    if (result > 0)
                    {
                        msg.success = true;
                        LogInsert(OperationTypeEnum.操作, "新闻公告", CurrentMaster.UserName + "公告启用操作成功.");
                    }
                    else
                    {
                        msg.success = false;
                        msg.msg     = "操作失败";
                        LogInsert(OperationTypeEnum.异常, "新闻公告", CurrentMaster.UserName + "公告启用操作,操作失败.");
                    }
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "用户信息已失效,请刷新或登陆.";
                }
            }
            else
            {
                msg.success = false;
                msg.msg     = "用户信息已过期,请重新登陆.";
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #6
0
ファイル: FireBoxController.cs プロジェクト: chrgu000/bellali
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                //判断类型是否还在使用
                var mode = new BllSysAppointed().Exists(" Places in(" + id + ")");
                if (mode == true)
                {
                    msg.success = false;
                    msg.msg     = "此地址正在使用,暂不能删除.";
                }
                else
                {
                    if (new BllFireBox().DeleteStatus(id) > 0)
                    {
                        LogInsert(OperationTypeEnum.操作, "设备位置删除", "操作成功.");
                        msg.success = true;
                    }
                    else
                    {
                        msg.success = false;
                        msg.msg     = "操作失败";
                        LogInsert(OperationTypeEnum.操作, "设备位置删除", "操作失败.");
                    }
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
                LogInsert(OperationTypeEnum.异常, "设备位置删除", "操作异常信息:" + ex);
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #7
0
        /// <summary>
        /// 保存上级单位选择的社会单位信息
        /// </summary>
        /// <param name="mod"></param>
        public void SaveParentIndex()
        {
            ModJsonResult json = new ModJsonResult();

            try
            {
                string[] IdList = Request["IdList"].ToString().Split(',');
                if (IdList.Length > 0)
                {
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < IdList.Length; i++)
                    {
                        string FlowId = Guid.NewGuid().ToString();
                        sb.Append(" insert into Sys_CompanyCognate(Id,EmployerId,CId,Status,FlowId,SelectType)");
                        sb.Append(" values(");
                        sb.Append("'" + Guid.NewGuid().ToString() + "',");
                        sb.Append("'" + IdList[i] + "',");         //社会单位编号
                        sb.Append("'" + CurrentMaster.Cid + "',"); //上级单位编号
                        sb.Append("'0',");
                        sb.Append("'" + FlowId + "',");
                        sb.Append("'2'");
                        sb.Append(");");
                        sb.AppendLine();

                        //添加流程审核模块
                        sb.Append("insert into Sys_Flow(Id,Title,FlowType,FlowStatus,Reamrk,ApprovalUser,ApprovalTime,CompanyId,MasterId)");
                        sb.Append(" values(");
                        sb.Append("'" + FlowId + "',");
                        sb.Append("'" + CurrentMaster.Company.Name + "向您提交查看单位信息申请',");
                        sb.Append("'" + 3 + "',");//(1:单位管理员注册时的审核 2:普通用户注册审核  3:用户单位变更审核)
                        sb.Append("'" + 0 + "',");
                        sb.Append("'',");
                        sb.Append("'" + CurrentMaster.Id + "',");
                        sb.Append("'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',");
                        sb.Append("'" + IdList[i] + "',");//审核单位编号
                        sb.Append("'" + CurrentMaster.Id + "'");
                        sb.Append(")");
                        sb.AppendLine();
                    }
                    int result = Bll.ExecuteNonQueryByText(sb.ToString());
                    if (result <= 0)
                    {
                        json.success = false;
                        json.msg     = " 保存失败,请稍后再操作!";
                        LogInsert(OperationTypeEnum.操作, "保存单位关联", "保存失败.");
                    }
                    else
                    {
                        LogInsert(OperationTypeEnum.操作, "保存单位关联", "保存成功.");
                    }
                }
            }
            catch (Exception ex)
            {
                json.msg     = "保存失败!";
                json.success = false;
                LogInsert(OperationTypeEnum.异常, "保存单位关联", "操作异常信息:" + ex);
            }
            WriteJsonToPage(json.ToString());
        }
コード例 #8
0
        /// <summary>
        /// 撤销社会单位申请
        /// </summary>
        public void DeleteIndex(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                StringBuilder sb = new StringBuilder();
                //撤销流程
                sb.Append("delete from Sys_Flow where Id=(select FlowId from Sys_CompanyCognate where Id='" + id + "' );");
                sb.AppendLine();
                sb.Append("delete from Sys_CompanyCognate where Id='" + id + "';");
                int result = Bll.ExecuteNonQueryByText(sb.ToString());
                if (result <= 0)
                {
                    msg.success = false;
                    msg.msg     = " 撤销失败,请稍后再操作!";
                    LogInsert(OperationTypeEnum.操作, "单位申请撤销", "撤销失败.");
                }
                else
                {
                    LogInsert(OperationTypeEnum.操作, "单位申请撤销", "撤销成功.");
                    msg.success = true;
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
                LogInsert(OperationTypeEnum.异常, "单位申请撤销", "操作异常信息:" + ex);
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #9
0
        public void SaveModelData(ModSysModel mod)
        {
            BllSysModel   Bll  = new BllSysModel();
            ModJsonResult json = new ModJsonResult();

            if (!string.IsNullOrEmpty(Request["modify"])) //修改
            {
                ModSysModel modLod = Bll.LoadData(mod.Id);
                modLod.ModelName = mod.ModelName;
                modLod.Sort      = mod.Sort;
                modLod.Remark    = mod.Remark;
                int result = Bll.Update(modLod);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = "修改失败,请稍后再操作!";
                }
            }
            else
            {
                mod.CreateTime = DateTime.Now;
                mod.CompanyId  = CurrentMaster.Cid;
                mod.Id         = Guid.NewGuid().ToString();
                mod.Status     = (int)StatusEnum.正常;
                int result = Bll.Insert(mod);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = "新增失败,请稍后再操作!";
                }
            }
            WriteJsonToPage(json.ToString());
        }
コード例 #10
0
        /// <summary>
        /// 附件下载
        /// </summary>
        /// <param name="mod"></param>
        public ActionResult FileDownInfo()
        {
            var msg = new ModJsonResult();
            //主键
            var Id = (Request["Id"] == null ? "" : Request["Id"]);
            BllSysFileAttach Back = new BllSysFileAttach();
            var Model             = Back.LoadData(Id);

            if (Model != null)
            {
                string filePath = Model.FilePath;
                string fileName = Model.NameOld;
                string extions  = Model.Extension;
                filePath = Server.MapPath(filePath);
                if (System.IO.File.Exists(filePath) == true)
                {
                    FileStream fs    = new FileStream(filePath, FileMode.Open);
                    byte[]     bytes = new byte[(int)fs.Length];
                    fs.Read(bytes, 0, bytes.Length);
                    fs.Close();
                    Response.Charset         = "UTF-8";
                    Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
                    Response.ContentType     = "application/octet-stream";

                    Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode(fileName + extions));
                    Response.BinaryWrite(bytes);
                    Response.Flush();
                    Response.End();
                }
            }
            return(new EmptyResult());
        }
コード例 #11
0
ファイル: HomeController.cs プロジェクト: chrgu000/bellali
        /// <summary>
        /// 获取用户信息
        /// </summary>
        public void GetLoginUser()
        {
            var master = new MasterContext().Master;
            var json   = new ModJsonResult();

            if (master != null)
            {
                ModSysMaster userInfo = master;
                //var userId = Request["userId"] == null ? "" : Request["userId"].ToString(CultureInfo.InvariantCulture);
                //if (userId.Length > 0)
                //{
                //    var masterLogic = new BllSysMaster();
                //    userInfo = masterLogic.LoadData(userId);
                //    masterLogic.LoadMasterPower(userInfo);
                //}
                //else
                //{
                //    userInfo = master;
                //}
                json.success = true;
                json.msg     = JsonHelper.ToJson(userInfo);
            }
            else
            {
                json.errorCode = (int)SystemError.用户过期错误;
                json.success   = false;
                json.msg       = "用户信息已过期,请重新登录!";
            }
            Response.Write(new JavaScriptSerializer().Serialize(json).ToString());
            Response.End();
        }
コード例 #12
0
ファイル: HomeController.cs プロジェクト: chrgu000/bellali
        public void GetTree()
        {
            string childId = Request["id"];
            var    master  = new MasterContext().Master;

            if (master != null)
            {
                //获取菜单访问权限
                if (master.IsMain) //超级管理员,不用控权
                {
                    InitAdminTree(childId, master);
                }
                else
                {
                    InitRoleTree(childId, master);
                }
            }
            else
            {
                var json = new ModJsonResult();
                json.success   = false;
                json.errorCode = (int)SystemError.用户过期错误;
                Response.Write(new JavaScriptSerializer().Serialize(json).ToString());
                Response.End();
            }
        }
コード例 #13
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                BllAdActive Master = new BllAdActive();
                var         Model  = Master.LoadData(id);
                if (Model != null)
                {
                    Model.Status = (int)StatusEnum.除;
                    int result = Master.Update(Model);
                    if (result > 0)
                    {
                        msg.success = true;
                    }
                    else
                    {
                        msg.success = false;
                        msg.msg     = "操作失败";
                    }
                    LogInsert(OperationTypeEnum.操作, "广告删除", "广告删除操作成功.");
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
                LogInsert(OperationTypeEnum.异常, "广告删除", "操作异常信息:" + ex);
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #14
0
        public void SaveDataAll()
        {
            var msg = new ModJsonResult();

            try
            {
                string IdList = Request["IdList"].ToString();                //主键

                string CheckoutType = Request["ComCheckoutType"].ToString(); //结账方式:0未设置 1月结 2日结
                string PaymentType  = Request["ComPaymentType"].ToString();  //付款方式:1支付宝 2工行  3农行
                string AccountName  = Request["AccountName"].ToString();     //名字
                string AccountNum   = Request["AccountNum"].ToString();      //账号

                string sql    = "update Sys_Company set CheckoutType=" + CheckoutType + ",PaymentType=" + PaymentType + ",AccountName='" + AccountName + "',AccountNum='" + AccountNum + "' where Id in (" + IdList + ")";
                int    result = bll.ExecuteNonQueryByText(sql);
                if (result > 0)
                {
                    msg.success = true;
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                }
            }
            catch (Exception)
            {
                json.msg     = "保存失败!";
                json.success = false;
            }
            WriteJsonToPage(json.ToString());
        }
コード例 #15
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                string sql = "update Sys_QRCode set Status=" + (int)StatusEnum.除 + " where Id in(" + id + ")";
                if (new BllSysQRCode().ExecuteNonQueryByText(sql) > 0)
                //int result = new BllSysQRCode().DeleteStatus(id);
                {
                    LogInsert(OperationTypeEnum.操作, "二维码删除", "操作成功.");
                    msg.success = true;
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                    LogInsert(OperationTypeEnum.操作, "二维码删除", "操作失败.");
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
                LogInsert(OperationTypeEnum.异常, "二维码删除", "操作异常信息:" + ex);
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #16
0
        /// <summary>
        /// DisableUse
        /// </summary>
        public void DisableUse()
        {
            var msg = new ModJsonResult();

            try
            {
                string key    = Request["id"];
                int    result = new BllAdActive().UpdateStatus(0, key);
                if (result > 0)
                {
                    msg.success = true;
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                }
                LogInsert(OperationTypeEnum.操作, "广告禁用", "禁用操作成功.");
            }
            catch (Exception ex)
            {
                LogInsert(OperationTypeEnum.异常, "广告禁用", "操作异常信息:" + ex);
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #17
0
ファイル: ChartController.cs プロジェクト: chrgu000/bellali
        /// <summary>
        /// 已过期的数量(红色),异常状态设备数量(黄色),半年内即将过期的数量(蓝色),其他正常数量(绿色)
        /// </summary>
        public void ChartPart()
        {
            BllSysAppointed  Bll  = new BllSysAppointed();
            var              msg  = new ModJsonResult();
            List <Hashtable> info = new List <Hashtable>();

            try
            {
                string  CompanyId = Request["CompanyId"].ToString() == "" ? CurrentMaster.Cid : Request["CompanyId"].ToString();
                DataSet ds        = Bll.ChartAppointed(CompanyId);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        Hashtable table = new Hashtable();
                        table.Add("已过期数量", ds.Tables[0].Rows[i]["Count1"].ToString());
                        table.Add("异常状态设备量", ds.Tables[0].Rows[i]["Count2"].ToString());
                        table.Add("半年内即将过期数量", ds.Tables[0].Rows[i]["Count3"].ToString());
                        table.Add("正常数量", ds.Tables[0].Rows[i]["Count4"].ToString());
                        info.Add(table);
                    }
                }
                msg.data = JsonHelper.ToJson(info);
                LogInsert(OperationTypeEnum.访问, "设备统计模块", "访问页面成功.");
            }
            catch (Exception ex)
            {
                LogInsert(OperationTypeEnum.异常, "设备统计模块", "查询列表错误消息:" + ex.Message.ToString());
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #18
0
        public void SaveData(ModSysBtnValue t)
        {
            BllSysBtn     bll  = new BllSysBtn();
            ModJsonResult json = new ModJsonResult();


            if (!string.IsNullOrEmpty(Request["modify"])) //修改
            {
                var model = bll.LoadData(t.Id);
                model.Name       = t.Name;
                model.NameTip    = t.NameTip;
                model.IConName   = t.IConName;
                model.ActionName = t.ActionName;

                int result = bll.Update(model);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = "修改失败,请稍后再操作!";
                }
            }
            else
            {
                t.Id     = Guid.NewGuid().ToString();
                t.Status = (int)StatusEnum.正常;

                int result = bll.Insert(t);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = " 保存失败,请稍后再操作!";
                }
            }
            WriteJsonToPage(json.ToString());
        }
コード例 #19
0
        /// <summary>
        /// 文件重命名
        /// </summary>
        public void ReName(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                BllSysFileAttach Back = new BllSysFileAttach();
                var Model             = Back.LoadData(id);
                if (Model != null)
                {
                    Model.NameOld = Request["FileName"].ToString();

                    int result = Back.Update(Model);
                    if (result > 0)
                    {
                        msg.success = true;
                    }
                    else
                    {
                        msg.success = false;
                        msg.msg     = "操作失败";
                    }
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #20
0
 /// <summary>
 /// 数据还原 Rollback
 /// </summary>
 public void Rollback(string id)
 {
     var msg = new ModJsonResult();
     try
     {
         BllSysDataBaseBack Bll = new BllSysDataBaseBack();
         var Model = Bll.LoadData(id);
         if (Model != null)
         {
             int result = Bll.Rollback(Model.LinkUrl);
             if (result > 0)
             {
                 msg.success = true;
             }
             else
             {
                 msg.success = false;
                 msg.msg = "操作失败";
             }
         }
     }
     catch (Exception ex)
     {
         msg.msg = "操作失败:" + ex.Message;
     }
     WriteJsonToPage(msg.ToString());
 }
コード例 #21
0
        public void SaveData(ModSysCompanyPaySet t)
        {
            BllSysCompanyPaySet bll  = new BllSysCompanyPaySet();
            ModJsonResult       json = new ModJsonResult();

            t.CompanyID = CurrentMaster.Cid;

            if (!string.IsNullOrEmpty(Request["modify"])) //修改
            {
                var model = bll.LoadData(t.Id);
                if (model != null)
                {
                    t.Status = model.Status;
                }
                int result = bll.Update(t);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = "修改失败,请稍后再操作!";
                }
            }
            else
            {
                t.Status = (int)StatusEnum.正常;
                t.Id     = Guid.NewGuid().ToString();
                int result = bll.Insert(t);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = " 保存失败,请稍后再操作!";
                }
            }
            WriteJsonToPage(json.ToString());
        }
コード例 #22
0
 /// <summary>
 /// 删除
 /// </summary>
 public void DeleteData(string id)
 {
     var msg = new ModJsonResult();
     try
     {
         BllSysDataBaseBack Back = new BllSysDataBaseBack();
         var Model = Back.LoadData(id);
         if (Model != null)
         {
             Model.Status = (int)StatusEnum.删除;
             int result = Back.Update(Model);
             if (result > 0)
             {
                 msg.success = true;
             }
             else
             {
                 msg.success = false;
                 msg.msg = "操作失败";
             }
         }
     }
     catch (Exception ex)
     {
         msg.msg = "操作失败:" + ex.Message;
     }
     WriteJsonToPage(msg.ToString());
 }
コード例 #23
0
        /// <summary>
        /// 用户审核通过
        /// </summary>
        public void GTPAudit()
        {
            BllSysMaster Bll    = new BllSysMaster();
            var          msg    = new ModJsonResult();
            string       key    = Request["id"];
            var          model  = Bll.LoadData(key);
            int          result = Bll.UpdateStatus(1, key);

            if (result > 0)
            {
                msg.success = true;
                //发送短信
                WebService.SDKService msm = new WebService.SDKService();
                string sn      = ConfigurationManager.AppSettings["sn"];
                string pwd     = ConfigurationManager.AppSettings["pwd"];
                string smstext = "亲,恭喜您,您在电梯宝申请的账户信息审核已通过,第一次使用,系统赠送您【" + model.Money.ToString("#0.00") + "】元保证金,赶紧登录电梯宝,体验一下吧.";
                result = msm.sendSMS(sn.Trim().ToString(), pwd.Trim().ToString(), "", model.LoginName.Split(new char[] { ',' }), smstext, "", "GBK", 3, Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmssfff")));
            }
            else
            {
                msg.success = false;
                msg.msg     = "操作失败";
            }

            WriteJsonToPage(msg.ToString());
        }
コード例 #24
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                string sql = "update Sys_Company set Status=" + (int)StatusEnum.除 + " where Id in(" + id + ")";
                if (bll.ExecuteNonQueryByText(sql) > 0)
                {
                    msg.success = true;
                    LogInsert(OperationTypeEnum.操作, "供应商删除", "供应商删除成功.");
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                    LogInsert(OperationTypeEnum.操作, "供应商删除", "供应商删除失败.");
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #25
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                BllOrderUserMoneyRecord User = new BllOrderUserMoneyRecord();
                var Model = User.LoadData(id);
                if (Model != null)
                {
                    Model.Status = (int)StatusEnum.除;
                    int result = User.Update(Model);
                    if (result > 0)
                    {
                        msg.success = true;
                    }
                    else
                    {
                        msg.success = false;
                        msg.msg     = "操作失败";
                    }
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #26
0
ファイル: HomeController.cs プロジェクト: chrgu000/bellali
        public void ReSetPwd()
        {
            var json = new ModJsonResult();

            try
            {
                string id     = Request["id"];
                string pwd    = DESEncrypt.Encrypt("666666");
                int    result = new BllSysMaster().ReSetPwd(id, pwd);
                if (result <= 0)
                {
                    json.success = false;
                    json.msg     = "重置失败!";
                }
                else
                {
                    json.success = true;
                    json.msg     = "重置成功!";
                }
            }
            catch (Exception ex)
            {
                json.success = false;
                json.msg     = "操作失败!" + ex.Message;
            }
            Response.Write(new JavaScriptSerializer().Serialize(json).ToString());
            Response.End();
        }
コード例 #27
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                //判断岗位下是否还存在员工
                var mode = new BllSysMaster().Exists(" OrganizaId=" + id);
                if (mode == true)
                {
                    msg.success = false;
                    msg.msg     = "此岗位下还有员工,暂不能删除.";
                }
                else
                {
                    if (bll.DeleteStatus(id) > 0)
                    {
                        msg.success = true;
                    }
                    else
                    {
                        msg.success = false;
                        msg.msg     = "操作失败";
                    }
                }
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #28
0
        /// <summary>
        /// 删除
        /// </summary>
        public void DeleteData(string id)
        {
            var msg = new ModJsonResult();

            try
            {
                int result = new BllSysRole().DeleteRoleInMaster(id);
                if (result > 0)
                {
                    msg.success = true;
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                }
                LogInsert(OperationTypeEnum.操作, "角色配置", CurrentMaster.UserName + "角色配置删除操作正常.");
            }
            catch (Exception ex)
            {
                msg.msg = "操作失败:" + ex.Message;
                LogInsert(OperationTypeEnum.异常, "角色配置", CurrentMaster.UserName + "角色配置删除操作异常." + msg.msg);
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #29
0
ファイル: FlowController.cs プロジェクト: chrgu000/bellali
        /// <summary>
        /// 单位审核
        /// </summary>
        public void CompanyWaitWork()
        {
            var msg = new ModJsonResult();

            string key          = Request["id"];
            string Introduction = Request["Introduction"].ToString();
            string Attr         = Request["Attribute"].ToString();//类型 1:通过  2:不通过
            var    model        = Bll.LoadData(key);

            try
            {
                BllSysFlow bllsyscompany = new BllSysFlow();

                if (bllsyscompany.WaitWork(CurrentMaster.Id, CurrentMaster.Cid, Introduction, key, int.Parse(Attr)))
                {
                    msg.success = true;
                    //发送短信
                    WebService.SDKService msm = new WebService.SDKService();
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败";
                }
                LogInsert(OperationTypeEnum.访问, "待办任务", "审核操作成功.");
                WriteJsonToPage(msg.ToString());
            }
            catch (Exception ex)
            {
                LogInsert(OperationTypeEnum.异常, "待办任务", "审核操作异常消息:" + ex.Message.ToString());
            }
        }
コード例 #30
0
        /// <summary>
        /// 保存选择
        /// </summary>
        public void SaveSelect()
        {
            var msg = new ModJsonResult();

            try
            {
                string checkid = Request["checkid"].ToString();                                                      //获取选中的Id
                string CId     = Request["CId"].ToString().Trim() == ""?CurrentMaster.Cid:Request["CId"].ToString(); //公司编号

                StringBuilder sb = new StringBuilder();
                sb.Append("delete from Sys_Group where ParentId !='0';");
                sb.AppendLine();
                sb.Append("insert into Sys_Group(Id,Name,ParentId,CompanyId,CreaterId) select newId() as Id,Name,Id  as ParentId,'" + CId + "' as CompanyId,'" + CurrentMaster.Id + "' as CreaterId from Sys_Dirc where Id in(" + checkid + ")");
                int result = new BllSysGroup().ExecuteNonQueryByText(sb.ToString());
                if (result > 0)
                {
                    msg.success = true;
                }
                else
                {
                    msg.success = false;
                    msg.msg     = "操作失败.";
                }
                LogInsert(OperationTypeEnum.操作, "设备分类引用操作", "删除操作成功.");
            }
            catch (Exception ex)
            {
                LogInsert(OperationTypeEnum.异常, "设备分类引用操作", "删除操作异常消息:" + ex.Message.ToString());
            }
            WriteJsonToPage(msg.ToString());
        }
コード例 #31
0
        /// <summary>
        /// 删除
        /// </summary>
        public JsonResult SubmitTest(string id)
        {
            var json = new ModJsonResult();
            try
            {
                int RightNum = Convert.ToInt32(Request["RightNum"] == null ? "" : Request["RightNum"]);
                var lmid = (Request["lmid"] == null ? "" : Request["lmid"]);
                var session = Session["ss"];
                var uu = Session["uu"];
                var gg = Session["gg"];
                /*string url2 = HttpContext.Request.Url.Query;
                url2 = url2.Replace("?", "");
                string[] urlpa = url2.Split('&');
                int co = 0;
                string session = "";
                foreach (string s in urlpa)
                {
                    string[] val = s.Split('=');
                    string co2=val[co];
                    if (co2=="sid"){
                        session = val[co + 1];
                    }
                }*/

                BllTestResult bll = new BllTestResult();
                ModTestResult model = new ModTestResult();
                model.uid = uu.ToString();
                model.qid = lmid;
                model.score = RightNum.ToString();
                model.date = session.ToString();
                float d = (float)RightNum / 100;
                int result = bll.Insert(model);
                String cc2 = "http://adapt2.sis.pitt.edu/cbum/um?app=37&act=" + model.qid + "&sub=" + lmid + "_test" + "&grp=" + gg + "&usr="******"&sid=" + model.date + "&res="+ d +"&svc=" + "m";
               Process ps = new Process();
              Process.Start(cc2);
               // HttpWebResponse rs = (HttpWebResponse)HttpWebRequest.Create(cc2.ToString()).GetResponse();
               // Response.Write("<script language='javascript'>window.open('" + cc2 + "');</script>");
                if (result>0)
                {
                    json.success =true;
                }
                else
                {
                    json.success = false;
                    json.msg = " Failed!";
                }
            }
            catch (Exception ex)
            {
                json.success = false;
                json.msg = "Error:" + ex.Message;
            }
            return Json(json, JsonRequestBehavior.AllowGet);
        }