示例#1
0
        public int upPrintPropertysByPnumber(string[] pId)
        {
            if (pId.Length <= 0)
            {
                return(0);
            }
            string sqlValue        = "";
            string sqlstr          = "";
            string propertyPrintPC = Dns.GetHostName();

            for (int i = 0; i < pId.Length; i++)
            {
                sqlValue = sqlValue + "'" + pId[i].ToString() + "',";
            }
            sqlValue = sqlValue.Substring(0, sqlValue.Length - 1);
            sqlstr   = @"UPDATE propertys set propertyPrintTims = propertyPrintTims+1 ,propertyPrintPC ='" + propertyPrintPC + "' WHERE propertyID in (" + sqlValue + ")";
            int result = 0;

            result = Mysql_SqlHelper.ExecuteNonQuery(sqlstr);

            /*
             * if (MiddleWare == "1")
             * {
             *  result = MyCatfsg_SqlHelper.ExecuteNonQuery(sqlstr);
             * }
             * else
             * {
             *  result = Mysqlfsg_SqlHelper.ExecuteNonQuery(sqlstr);
             * }
             */
            return(result);
        }
示例#2
0
        public int delPropertysByPnumber(List <string> propertyIDs, string delnote)
        {
            if (propertyIDs.Count <= 0)
            {
                return(0);
            }
            string sqlValue        = "";
            string sqlstr          = "";
            string propertyDelPC   = Dns.GetHostName();
            string propertyDelDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            for (int i = 0; i < propertyIDs.Count; i++)
            {
                sqlValue = sqlValue + "'" + propertyIDs[i].ToString() + "',";
            }
            sqlValue = sqlValue.Substring(0, sqlValue.Length - 1);
            sqlstr   = @"UPDATE propertys set propertyIsDel = 1 , propertyDelPC = '" + propertyDelPC + "' , propertyDelNote='" + delnote + "',propertyDelDate ='" + propertyDelDate + "' WHERE propertyID in (" + sqlValue + ")";
            int result = 0;

            result = Mysql_SqlHelper.ExecuteNonQuery(sqlstr);

            /*
             * if (MiddleWare == "1")
             * {
             *  result = MyCatfsg_SqlHelper.ExecuteNonQuery(sqlstr);
             * }
             * else
             * {
             *  result = Mysqlfsg_SqlHelper.ExecuteNonQuery(sqlstr);
             * }
             */
            return(result);
        }
示例#3
0
        public int insertPropertys(DataTable dt)
        {
            if (dt.Rows.Count <= 0)
            {
                return(0);
            }

            //保存前查询是否已有此财编号

            string sqlValue = "";
            string sqlstr   = "";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                //  str=str.Replace("abc","ABC");
                sqlValue = sqlValue + "(\"" +
                           dt.Rows[i]["erpid"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["org"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyID"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyName"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyMode"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyType"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["buyDate"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyDept"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyLocal"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyBuyID"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertySavePerson"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyUnit"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyPrintTims"].ToString().Replace("\"", "'") + "\",\"" +
                           dt.Rows[i]["propertyIsDel"].ToString().Replace("\"", "'") + "\"),";
            }
            sqlValue = sqlValue.Substring(0, sqlValue.Length - 1) + ";";

            sqlstr = @"INSERT INTO propertys (
                                            erpid,
                                            org,
                                            propertyID,
                                            propertyName,
                                            propertyMode,
                                            propertyType,
                                            buyDate,
                                            propertyDept,
                                            propertyLocal,
                                            propertyBuyID,
                                            propertySavePerson,
                                            propertyUnit,
                                            propertyPrintTims,
                                            propertyIsDel
                                            )  VALUES " + sqlValue;

            int result = 0;

            result = Mysql_SqlHelper.ExecuteNonQuery(sqlstr);  //MySqlconnStr MySqlconnStr

            /*
             *
             * if (MiddleWare == "1")
             * {
             *  result = MyCatfsg_SqlHelper.ExecuteNonQuery(sqlstr);
             * }
             * else
             * {
             *  result = Mysqlfsg_SqlHelper.ExecuteNonQuery(sqlstr);
             * }
             */
            return(result);
        }