/// <summary>
    /// 添加
    /// </summary>
    public string Add()
    {
        string Result = "";

        try
        {
            string TestRoomCode = Request["TestRoomCode"].ToString();
            string CompanyType  = Request["CompanyType"].ToString();
            string Name         = "Name".RequestStr();
            string IDCard       = Request["IDCard"].ToString();
            string Job          = Request["Job"].ToString();
            string Deduct       = Request["Deduct"].ToString();
            string Remark       = Request["Remark"].ToString();
            string RType        = Request["RType"].ToString();
            string CreateBy     = Session["UserName"].ToString();
            string Sql          = @"

                INSERT INTO [dbo].[sys_ReditRating]
                           ([SysID]
                           ,[SegmentCode]
                           ,[CompanyCode]
                           ,[TestRoomCode]
                           ,[CompanyType]
                           ,[RType] 
                           ,[Name]
                           ,[IDCard]
                           ,[Job]
                           ,[Deduct]
                           ,[Remark]
                           ,[CreateOn],[CreateBy]
                            ,[ISDeleted])
                     VALUES
                           ('{0}'
                           ,'{1}'
                           ,'{2}'
                           ,'{3}'
                           ,'{4}'
                           ,'{5}'
                           ,'{6}'
                           ,'{7}'
                           ,'{8}'
                           ,'{9}'
                           ,'{10}','{11}','{12}',1)

";

            Sql = string.Format(Sql, Guid.NewGuid().ToString(), TestRoomCode.Substring(0, 8), TestRoomCode.Substring(0, 12), TestRoomCode, CompanyType, RType, Name, IDCard, Job, Deduct, Remark, DateTime.Now.ToString(), CreateBy);

            BLL_Document BLL = new BLL_Document();



            Result = BLL.ExcuteCommand(Sql) > 0 ? "true" : "false";
        }
        catch
        {
            Result = "false";
        }
        return(Result);
    }
예제 #2
0
    public string Del()
    {
        string SysID = "SysID".RequestStr();

        if (SysID.IsNullOrEmpty())
        {
            return("");
        }

        string       Sql = @" UPDATE  [dbo].[sys_ReditRating] SET IsDeleted=0  WHERE  SysID = '" + SysID + "' ";
        BLL_Document BLL = new BLL_Document();

        return(BLL.ExcuteCommand(Sql) > 0 ? "true" : "false");
    }
    /// <summary>
    /// 添加
    /// </summary>
    public string Edit()
    {
        string Result = "";

        try
        {
            string TestRoomCode = Request["TestRoomCode"].ToString();
            string CompanyType  = Request["CompanyType"].ToString();
            string Name         = "Name".RequestStr();
            string IDCard       = Request["IDCard"].ToString();
            string Job          = Request["Job"].ToString();
            string Deduct       = Request["Deduct"].ToString();
            string Remark       = Request["Remark"].ToString();
            string SysID        = Request["SysID"].ToString();
            string RType        = Request["RType"].ToString();
            string CreateBy     = Session["UserName"].ToString();
            string Sql          = @"

                UPDATE [dbo].[sys_ReditRating]
                          SET 
                           [SegmentCode] = '{0}'
                          ,[CompanyCode] = '{1}'
                          ,[TestRoomCode] = '{2}'
                          ,[CompanyType] = '{3}'
                          ,[RType] = '{11}'
                          ,[Name] = '{4}'
                          ,[IDCard] = '{5}'
                          ,[Job] = '{6}'
                          ,[Deduct] = '{7}'
                          ,[Remark] = '{8}'
,[CreateBy] = '{9}'
                   WHERE SysID = '{10}'

";

            Sql = string.Format(Sql, TestRoomCode.Substring(0, 8), TestRoomCode.Substring(0, 12), TestRoomCode, CompanyType, Name, IDCard, Job, Deduct, Remark, CreateBy, SysID, RType);

            BLL_Document BLL = new BLL_Document();



            Result = BLL.ExcuteCommand(Sql) > 0 ? "true" : "false";
        }
        catch
        {
            Result = "false";
        }
        return(Result);
    }
예제 #4
0
    /// <summary>
    /// 添加
    /// </summary>
    public string Edit()
    {
        string Result = "";

        try
        {
            string KMID    = Request["KMID"].ToString();
            string Content = Request["Content"].ToString();
            string Person  = UserName;
            //rolename


            string Sql = @"

                UPDATE [dbo].[sys_KeyModify]
                          SET 
                           [YZUserName] = '{0}'
                          ,[YZContent] = '{1}'
                          ,[YZOPTime] = '{2}'
                          ,Status={4}
                   WHERE KMID = '{3}'

";

            Sql = string.Format(Sql, Person, Content, DateTime.Now.ToString(), KMID, "Type".RequestStr());
            BLL_Document BLL = new BLL_Document();



            Result = BLL.ExcuteCommand(Sql) > 0 ? "true" : "false";

            try
            {
                #region 发短信
                if ("Type".RequestStr() == "2" && Result == "true")
                {
                    sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
                    DataSet  DsTemp      = LineDbHelperSQL.Query("SELECT [SMSState] FROM [sys_line] where ID ='" + sysBaseLine.ID + "'");
                    if (DsTemp.Tables.Count > 0 && DsTemp.Tables[0].Rows.Count > 0 && DsTemp.Tables[0].Rows[0][0].ToString() == "1")
                    {
                        string SMSSql = @"
                                 SELECT sys_module.name,sys_KeyModify.BGBH,sys_KeyModify.ModifyItem,sys_KeyModify.YzUserName,
                        t1.DESCRIPTION +' '+sys_tree.DESCRIPTION as DESCRIPTION,TestRoomCode
                         FROM sys_KeyModify
                        left outer join sys_tree on sys_KeyModify.testroomcode = sys_tree.nodecode
                        left outer join sys_tree as t1 on Left(sys_KeyModify.testroomcode,8) = t1.nodecode
                        left outer join sys_module on sys_module.id = sys_KeyModify.moduleid
                        where sys_KeyModify.KMID = '" + KMID + "'";

                        DataSet Ds = BLL.GetDataSet(SMSSql);

                        string SmsContent = "{0} {1} {2} {3} {4}拒绝";
                        if (Ds.Tables[0] != null && Ds.Tables[0].Rows.Count > 0)
                        {
                            DataRow Dr = Ds.Tables[0].Rows[0];

                            ModifyItem[] Temp = Newtonsoft.Json.JsonConvert.DeserializeObject <ModifyItem[]>(Dr["ModifyItem"].ToString());

                            SmsContent = string.Format(SmsContent
                                                       , Dr["DESCRIPTION"].ToString()
                                                       , Dr["name"].ToString()
                                                       , Dr["BGBH"].ToString()
                                                       , Temp[0].Description + Temp[0].CurrentValue + "修改为" + Temp[0].OriginalValue
                                                       , Dr["YzUserName"].ToString()
                                                       );



                            string CPS = @"  SELECT CellPhone
                        FROM [SYGLDB_ZhengXu].[dbo].[sys_sms_receiver]
                        where TestRoomCode ='" + Ds.Tables[0].Rows[0]["TestRoomCode"].ToString() + "' and CellPhone <>'' ANd CellPhone is not null and IsActive=1";

                            string MS = "";
                            Ds = BLL.GetDataSet(CPS);
                            if (Ds.Tables[0] != null && Ds.Tables[0].Rows.Count > 0)
                            {
                                foreach (DataRow Dr1 in Ds.Tables[0].Rows)
                                {
                                    if (!Dr1[0].ToString().IsNullOrEmpty())
                                    {
                                        MS += MS.IsNullOrEmpty() ? Dr1[0].ToString() : "," + Dr1[0].ToString();
                                    }
                                }
                            }
                            if (!MS.IsNullOrEmpty())
                            {
                                string SMSResult = SendSMS("Mobile=" + MS + "&Content=" + SmsContent + "&Stime=" + DateTime.Now.ToString() + "&Extno=1");
                            }
                        }
                    }
                }
                #endregion
            }
            catch { }
        }
        catch
        {
            Result = "false";
        }
        return(Result);
    }