示例#1
0
        public DataTable QueryRoleMenu(string roleNoStr)
        {
            string sqlStr = string.Format("Select MenuName from BS_RoleMenu where RoleNo='{0}'", roleNoStr);

            return(BaseSQL.GetTableBySql(sqlStr));
        }
示例#2
0
        /// <summary>
        /// 查询全部菜单名称和编号
        /// </summary>
        /// <returns></returns>
        public static DataTable QueryMenuList()
        {
            string sqlStr = "select '' as MenuName, '' as MenuText Union All select MenuName, MenuText from BS_Menu";

            return(BaseSQL.GetTableBySql(sqlStr));
        }
示例#3
0
        ///// <summary>
        ///// 查询Bom子表信息
        ///// </summary>
        //public void QueryBomMateriel(DataTable queryDataTable, int codeIdInt)
        //{
        //    string sqlStr = string.Format("1=1 and pc1.AutoId = {0}", codeIdInt);
        //    sqlStr = string.Format("select bom.*, pc2.AutoId as LevelCodeId, pc2.CodeName as LevelCodeName from BS_BomMateriel as bom left join SW_PartsCode as pc1 on bom.MaterielNo = pc1.CodeFileName left join SW_PartsCode as pc2 on bom.LevelMaterielNo = pc2.CodeFileName where {0} order by bom.AutoId", sqlStr);
        //    BaseSQL.Query(sqlStr, queryDataTable);
        //}

        /// <summary>
        /// 查询Bom的树形基本信息
        /// </summary>
        public DataTable QueryBomTreeList_BaseInfo(string materielNoStr)
        {
            string sqlStr = string.Format("select bom.*, SW_PartsCode.CodeName, SW_PartsCode.AutoId as PCAutoId from F_BomMateriel_TreeRelation('{0}') as bom left join SW_PartsCode on bom.CodeFileName = SW_PartsCode.CodeFileName Order by CodeFileName", materielNoStr);

            return(BaseSQL.Query(sqlStr).Tables[0]);
        }
示例#4
0
 /// <summary>
 /// 初始化往来方主表
 /// </summary>
 public static void InitBussinessBaseInfo(DataSet ds)
 {
     BaseSQL.Query("select * from BS_BussinessBaseInfo", ds.Tables["BussinessBaseInfo"]);
 }
示例#5
0
        public static ArrayList strSqlLlist = new ArrayList();//存储SQL语句

        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="ds"></param>
        public static void InitBussinessCategory(DataSet ds)
        {
            BaseSQL.Query("select * from BS_BussinessCategory", ds.Tables["BussinessCategory"]);
        }
示例#6
0
        /// <summary>
        /// 保存Bom登记信息
        /// </summary>
        public int SaveBomManagement(DataRow bomHeadRow, DataTable bomListTable)
        {
            using (SqlConnection conn = new SqlConnection(BaseSQL.connectionString))
            {
                conn.Open();
                using (SqlTransaction trans = conn.BeginTransaction())
                {
                    try
                    {
                        SqlCommand cmd = new SqlCommand("", conn, trans);

                        DateTime nowTime = BaseSQL.GetServerDateTime();
                        if (bomHeadRow.RowState == DataRowState.Added)//新增
                        {
                            cmd.CommandText = string.Format("select COUNT(*) from BS_BomManagement where MaterielNo = '{0}'", DataTypeConvert.GetString(bomHeadRow["MaterielNo"]));
                            if (DataTypeConvert.GetInt(cmd.ExecuteScalar()) > 0)
                            {
                                //MessageHandler.ShowMessageBox("当前选择的零件名称已经存在Bom信息,不能重复设定,请重新输入。");
                                MessageHandler.ShowMessageBox(f.tsmiDqxzdl.Text);

                                trans.Rollback();
                                return(0);
                            }

                            bomHeadRow["GetTime"] = nowTime;
                            for (int i = 0; i < bomListTable.Rows.Count; i++)
                            {
                                bomListTable.Rows[i]["MaterielNo"] = bomHeadRow["MaterielNo"];
                                bomListTable.Rows[i]["GetTime"]    = nowTime;
                            }
                        }
                        else//修改
                        {
                            for (int i = 0; i < bomListTable.Rows.Count; i++)
                            {
                                if (bomListTable.Rows[i].RowState == DataRowState.Deleted)
                                {
                                    continue;
                                }
                                else if (bomListTable.Rows[i].RowState == DataRowState.Added)
                                {
                                    bomListTable.Rows[i]["MaterielNo"] = bomHeadRow["MaterielNo"];
                                    bomListTable.Rows[i]["GetTime"]    = nowTime;
                                }
                            }
                        }

                        //保存日志到日志表中
                        //string logStr = LogHandler.RecordLog_DataRow(cmd, "Bom登记信息", bomHeadRow, "MaterielNo");
                        string logStr = LogHandler.RecordLog_DataRow(cmd, f.tsmiBomdjx.Text, bomHeadRow, "MaterielNo");

                        cmd.CommandText = "select * from BS_BomManagement where 1=2";
                        SqlDataAdapter adapterHead  = new SqlDataAdapter(cmd);
                        DataTable      tmpHeadTable = new DataTable();
                        adapterHead.Fill(tmpHeadTable);
                        BaseSQL.UpdateDataTable(adapterHead, bomHeadRow.Table);

                        cmd.CommandText = "select * from BS_BomMateriel where 1=2";
                        SqlDataAdapter adapterList  = new SqlDataAdapter(cmd);
                        DataTable      tmpListTable = new DataTable();
                        adapterList.Fill(tmpListTable);
                        BaseSQL.UpdateDataTable(adapterList, bomListTable);

                        trans.Commit();

                        return(1);
                    }
                    catch (Exception ex)
                    {
                        trans.Rollback();
                        bomHeadRow.Table.RejectChanges();
                        bomListTable.RejectChanges();
                        throw ex;
                    }
                    finally
                    {
                        conn.Close();
                    }
                }
            }
        }
示例#7
0
        public string QueryPartsCode_FilePath(string codeFileNameStr)
        {
            string sqlStr = string.Format("select FilePath from SW_PartsCode where CodeFileName = '{0}'", codeFileNameStr);

            return(DataTypeConvert.GetString(BaseSQL.GetSingle(sqlStr)));
        }
示例#8
0
 /// <summary>
 /// 3.执行事务
 /// </summary>
 public static void ExecSqlTran()
 {
     BaseSQL.ExecuteSqlTran(strSqlLlist);
 }
示例#9
0
        /// <summary>
        /// 查询和当前零件编号相同的零件个数
        /// </summary>
        public int QueryPartsCode_CodeFileNameCount(string codeFileNameStr)
        {
            string sqlStr = string.Format("select Count(*) from SW_PartsCode where CodeFileName = '{0}'", codeFileNameStr);

            return(DataTypeConvert.GetInt(BaseSQL.GetSingle(sqlStr)));
        }
示例#10
0
        /// <summary>
        /// 批量更新零件信息
        /// </summary>
        public int QueryPartsCode(string queryWhereSqlStr)
        {
            string sqlStr = string.Format("select Count(*) from SW_PartsCode where {0}", queryWhereSqlStr);

            return(DataTypeConvert.GetInt(BaseSQL.GetSingle(sqlStr)));
        }
示例#11
0
        /// <summary>
        /// 获取菜单数据
        /// </summary>
        public static DataTable GetMenuData()
        {
            string sql = "select MenuName, MenuText, FormName, ParentMenuName from BS_Menu where Visible = 1 order by MenuOrder";

            return(BaseSQL.GetTableBySql(sql));
        }
示例#12
0
        /// <summary>
        /// 查询公司信息表
        /// </summary>
        public void QueryCompanyInfo(DataTable queryDataTable)
        {
            string sqlStr = "select * from BS_CompanyInfo";

            BaseSQL.Query(sqlStr, queryDataTable);
        }
示例#13
0
        /// <summary>
        /// 查询全部菜单表树结构
        /// </summary>
        public static DataTable QueryMenuTree()
        {
            string sqlStr = "select BS_Menu.*, menu.MenuText as ParentMenuText from BS_Menu left join BS_Menu as menu on BS_Menu.ParentMenuName = menu.MenuName order by BS_Menu.MenuOrder, BS_Menu.AutoId";

            return(BaseSQL.GetTableBySql(sqlStr));
        }
示例#14
0
        /// <summary>
        /// 查询项目状态信息的默认编号
        /// </summary>
        public int GetProjectStatus_DefaultAutoId()
        {
            string sqlStr = "select AutoId from BS_ProjectStatus where IsDefault = 1";

            return(DataTypeConvert.GetInt(BaseSQL.GetSingle(sqlStr)));
        }
示例#15
0
        /// <summary>
        /// 批量更新零件信息
        /// </summary>
        public void UpdatePartsCode(string setSqlStr, string queryWhereSqlStr)
        {
            string sqlStr = string.Format("Update SW_PartsCode set {0} where {1}", setSqlStr, queryWhereSqlStr);

            BaseSQL.ExecuteSql(sqlStr);
        }
示例#16
0
        /// <summary>
        /// 查询付款类型信息
        /// </summary>
        public void QueryCollectionTypeList(DataTable queryDataTable, string collectionTypeNoStr)
        {
            string sqlStr = string.Format("select * from BS_CollectionTypeList where CollectionTypeNo='{0}'", collectionTypeNoStr);

            BaseSQL.Query(sqlStr, queryDataTable);
        }
示例#17
0
        /// <summary>
        /// 得到查询零件信息的条件SQL
        /// </summary>
        public string GetQueryWhereSql(string codeFileNameStr, string codeNoStr, string codeNameStr, string codeSpecStr, string materialVersionStr, string designerStr, string catgNameStr, int materialInt, string unitStr, string brandStr, int machiningLevelInt, int finishInt, int isPreferredInt, int isLongPeriodInt, int isPreciousInt, int isPreprocessingInt, int isBuyInt, string getTimeBeginStr, string getTimeEndStr, string commonStr)
        {
            string sqlStr = " 1=1";

            if (codeFileNameStr != "")
            {
                sqlStr += string.Format(" and CodeFileName like '%{0}%'", codeFileNameStr);
            }

            if (codeNoStr != "")
            {
                sqlStr += string.Format(" and CodeNo like '%{0}%'", codeNoStr);
            }

            if (codeNameStr != "")
            {
                sqlStr += string.Format(" and CodeName like '%{0}%'", codeNameStr);
            }

            if (codeSpecStr != "")
            {
                sqlStr += string.Format(" and CodeSpec like '%{0}%'", codeSpecStr);
            }

            if (materialVersionStr != "")
            {
                sqlStr += string.Format(" and MaterialVersion like '%{0}%'", materialVersionStr);
            }

            if (designerStr != "")
            {
                sqlStr += string.Format(" and Designer like '%{0}%'", designerStr);
            }

            if (catgNameStr != "")
            {
                sqlStr += string.Format(" and CatgName='{0}'", catgNameStr);
            }

            if (materialInt != 0)
            {
                sqlStr += string.Format(" and Material={0}", materialInt);
            }

            if (unitStr != "")
            {
                sqlStr += string.Format(" and Unit='{0}'", unitStr);
            }

            if (brandStr != "")
            {
                sqlStr += string.Format(" and Brand='{0}'", brandStr);
            }

            if (machiningLevelInt != 0)
            {
                sqlStr += string.Format(" and MachiningLevel={0}", machiningLevelInt);
            }

            if (finishInt != 0)
            {
                sqlStr += string.Format(" and Finish={0}", finishInt);
            }

            if (isPreferredInt != -1)
            {
                sqlStr += string.Format(" and IsPreferred={0}", isPreferredInt);
            }

            if (isLongPeriodInt != -1)
            {
                sqlStr += string.Format(" and IsLongPeriod={0}", isLongPeriodInt);
            }

            if (isPreciousInt != -1)
            {
                sqlStr += string.Format(" and IsPrecious={0}", isPreciousInt);
            }

            if (isPreprocessingInt != -1)
            {
                sqlStr += string.Format(" and IsPreprocessing={0}", isPreprocessingInt);
            }

            if (isBuyInt != -1)
            {
                sqlStr += string.Format(" and IsNull(IsBuy,0)={0}", isBuyInt);
            }

            if (getTimeBeginStr != "")
            {
                sqlStr += BaseSQL.GetDateRegion_SingleColumn_WhereSql("GetTime", getTimeBeginStr, getTimeEndStr);
            }

            if (commonStr != "")
            {
                sqlStr += string.Format(" and (CodeNo like '%{0}%' or CodeFileName like '%{0}%' or CodeName like '%{0}%' or FilePath like '%{0}%' or CatgName like '%{0}%' or CodeSpec like '%{0}%' or Brand like '%{0}%' or Unit like '%{0}%' or Designer like '%{0}%' or Tel like '%{0}%')", commonStr);
            }

            return(sqlStr);
        }
示例#18
0
        /// <summary>
        /// 执行存储过程
        /// </summary>
        /// <param name="strQuerySqlId">查询ID</param>
        /// <param name="strControlTmp">控件列表变量</param>
        /// <returns></returns>
        public static DataSet ExecUserProcedure(string strQuerySqlId, string[,] strControlTmp)
        {
            DataSet   ds = new DataSet();
            DataTable dt = new DataTable();

            dt = GetUserQueryInfo(strQuerySqlId);
            if (!string.IsNullOrEmpty(dt.Rows[0].ItemArray[6].ToString().Trim()))
            {
                int intRowCount             = dt.Rows.Count;
                IDataParameter[] parameters = new System.Data.IDataParameter[intRowCount];//实例化参数对象
                for (int i = 0; i < intRowCount; i++)
                {
                    //string reval = string.Empty;
                    string strParaName = dt.Rows[i].ItemArray[6].ToString();
                    switch (strControlTmp[i, 2].ToLower())
                    {
                    case "int":
                        //reval = "Int32";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Int);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToInt32(strControlTmp[i, 1]);
                        break;

                    case "text":
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Text);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;

                    case "bigint":
                        //reval = "Int64";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.BigInt);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToInt64(strControlTmp[i, 1]);
                        break;

                    case "binary":
                        //reval = "System.Byte[]";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Binary);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToByte(strControlTmp[i, 1]);
                        break;

                    case "bit":
                        //reval = "Boolean";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Bit);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToBoolean(strControlTmp[i, 1]);
                        break;

                    case "char":
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Char);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;

                    case "datetime":
                        //reval = "System.DateTime";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.DateTime);//参数对象赋值
                        parameters[i].Value = Convert.ToDateTime(strControlTmp[i, 1]);
                        break;

                    case "decimal":
                        //reval = "System.Decimal";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Decimal);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToDecimal(strControlTmp[i, 1]);
                        break;

                    case "float":
                        //reval = "System.Double";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Float);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToDouble(strControlTmp[i, 1]);
                        break;

                    case "image":
                        //reval = "System.Byte[]";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Image);//参数对象赋值
                        parameters[i].Value = Convert.ToByte(strControlTmp[i, 1]);
                        break;

                    case "money":
                        //reval = "System.Decimal";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Money);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToDecimal(strControlTmp[i, 1]);
                        break;

                    case "nchar":
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.NChar);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;

                    case "ntext":
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.NText);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;

                    case "numeric":
                        //reval = "System.Decimal";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Decimal);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToDecimal(strControlTmp[i, 1]);
                        break;

                    case "nvarchar":
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.NVarChar);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;

                    case "real":
                        //reval = "System.Single";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Real);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToSingle(strControlTmp[i, 1]);
                        break;

                    case "smalldatetime":
                        //reval = "System.DateTime";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.SmallDateTime);//参数对象赋值
                        parameters[i].Value = Convert.ToDateTime(strControlTmp[i, 1]);
                        break;

                    case "smallint":
                        //reval = "Int16";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.SmallInt);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToInt16(strControlTmp[i, 1]);
                        break;

                    case "smallmoney":
                        //reval = "System.Decimal";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.SmallMoney);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToDecimal(strControlTmp[i, 1]);
                        break;

                    case "timestamp":
                        //reval = "System.DateTime";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Timestamp);//参数对象赋值
                        parameters[i].Value = Convert.ToDateTime(strControlTmp[i, 1]);
                        break;

                    case "tinyint":
                        //reval = "System.Byte";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.TinyInt);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToByte(strControlTmp[i, 1]);
                        break;

                    case "varbinary":
                        //reval = "System.Byte[]";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.VarBinary);//参数对象赋值
                        parameters[i].Value = string.IsNullOrEmpty(strControlTmp[i, 1]) ? null : (object)Convert.ToByte(strControlTmp[i, 1]);
                        break;

                    case "varchar":
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.VarChar);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;

                    case "Variant":
                        //reval = "Object";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.Variant);//参数对象赋值
                        parameters[i].Value = (object)(strControlTmp[i, 1]);
                        break;

                    default:
                        //reval = "String";
                        parameters[i]       = new SqlParameter(strParaName, SqlDbType.VarChar);//参数对象赋值
                        parameters[i].Value = Convert.ToString(strControlTmp[i, 1]);
                        break;
                    }
                }
                ds = BaseSQL.RunProcedure(Convert.ToString(dt.Rows[0].ItemArray[3]).Trim(), parameters, "dd");//执行存储过程
                return(ds);
            }
            return(null);
        }
示例#19
0
        /// <summary>
        /// 刷新所有的系统参数
        /// </summary>
        public void RefreshAllSystemParameter()
        {
            DataTable sysParameterTable = new DataTable();

            QuerySystemParameter(sysParameterTable);

            #region 常规

            string tmpStr = GetValue(sysParameterTable, "Common", "PageRowCount");
            if (tmpStr != "")
            {
                SystemInfo.OrderQueryGrid_PageRowCount = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Common", "DateIntervalDays");
            if (tmpStr != "")
            {
                SystemInfo.OrderQueryDate_DateIntervalDays = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Common", "FormDragDropMaxRecordCount");
            if (tmpStr != "")
            {
                SystemInfo.FormDragDropMaxRecordCount = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Common", "LeftDockWidth");
            if (tmpStr != "")
            {
                SystemInfo.DragForm_LeftDock_Width = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Common", "EnableWorkFlowMessage");
            if (tmpStr != "")
            {
                SystemInfo.EnableWorkFlowMessage = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Common", "ApproveAfterPrint");
            if (tmpStr != "")
            {
                SystemInfo.ApproveAfterPrint = tmpStr == "1";
            }

            #endregion

            #region 销售

            tmpStr = GetValue(sysParameterTable, "Sale", "QuotationDefaultTax");
            if (tmpStr != "")
            {
                SystemInfo.Quotation_DefaultTax = DataTypeConvert.GetDouble(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Sale", "SalesOrderDefaultTax");
            if (tmpStr != "")
            {
                SystemInfo.SalesOrder_DefaultTax = DataTypeConvert.GetDouble(tmpStr);
            }

            #endregion

            #region 项目

            tmpStr = GetValue(sysParameterTable, "Project", "GanttResourcesPerPage");
            if (tmpStr != "")
            {
                SystemInfo.Gantt_ResourcesPerPage = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Project", "GanttSchedulerBarHeight");
            if (tmpStr != "")
            {
                SystemInfo.Gantt_SchedulerBarHeight = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Project", "GanttSchedulerBarColor");
            if (tmpStr != "")
            {
                SystemInfo.Gantt_SchedulerBarColor = System.Drawing.ColorTranslator.FromHtml(tmpStr);
            }

            #endregion

            #region 采购

            tmpStr = GetValue(sysParameterTable, "Purchase", "PrReqIsAlterPSBomAutoId");
            if (tmpStr != "")
            {
                SystemInfo.PrReqIsAlter_PSBomAutoId = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "OrderListDefaultTax");
            if (tmpStr != "")
            {
                SystemInfo.OrderList_DefaultTax = DataTypeConvert.GetDouble(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "SettlementDefaultTax");
            if (tmpStr != "")
            {
                SystemInfo.Settlement_DefaultTax = DataTypeConvert.GetDouble(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "OrderNoWarehousingDays");
            if (tmpStr != "")
            {
                SystemInfo.OrderNoWarehousing_Days = DataTypeConvert.GetInt(tmpStr);
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "PrReqApplyBeyondCountIsSave");
            if (tmpStr != "")
            {
                SystemInfo.PrReqApplyBeyondCountIsSave = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "WWApplyBeyondCountIsSave");
            if (tmpStr != "")
            {
                SystemInfo.WarehouseWarrantApplyBeyondCountIsSave = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "PrListDistributionMessage");
            if (tmpStr != "")
            {
                SystemInfo.PrListDistributionMessage = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Purchase", "PrListDistributionAllHandle");
            if (tmpStr != "")
            {
                SystemInfo.PrListDistributionAllHandle = tmpStr == "1";
            }

            #endregion

            #region 库存

            tmpStr = GetValue(sysParameterTable, "Warehouse", "OrderApplyBeyondCountIsSave");
            if (tmpStr != "")
            {
                SystemInfo.OrderApplyBeyondCountIsSave = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Warehouse", "WWIsAlterDate");
            if (tmpStr != "")
            {
                SystemInfo.WarehouseWarrantIsAlterDate = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Warehouse", "PPApplyBeyondCountIsSave");
            if (tmpStr != "")
            {
                SystemInfo.PPApplyBeyondCountIsSave = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Warehouse", "WRIsAlterDate");
            if (tmpStr != "")
            {
                SystemInfo.WarehouseReceiptIsAlterDate = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Warehouse", "DisableProjectNo");
            if (tmpStr != "")
            {
                SystemInfo.DisableProjectNo = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Warehouse", "DisableShelfInfo");
            if (tmpStr != "")
            {
                SystemInfo.DisableShelfInfo = tmpStr == "1";
            }

            SystemInfo.DisableShelfInfo_Default_ShelfId = DataTypeConvert.GetInt(BaseSQL.GetSingle(string.Format("select AutoId from BS_ShelfInfo where ShelfNo = '{0}' and RepertoryInfoId is null and RepertoryLocationId is null", defaultShelfNo)));

            tmpStr = GetValue(sysParameterTable, "Warehouse", "EnableNegativeInventory");
            if (tmpStr != "")
            {
                SystemInfo.EnableNegativeInventory = tmpStr == "1";
            }

            tmpStr = GetValue(sysParameterTable, "Warehouse", "InventorySaveApproval");
            if (tmpStr != "")
            {
                SystemInfo.InventorySaveApproval = tmpStr == "1";
            }

            #endregion

            #region 生产



            #endregion

            #region 人事



            #endregion

            #region 会计



            #endregion
        }
示例#20
0
        /// <summary>
        /// 更改部门编号时,同步更改以此编号为父部门编码的数据
        /// </summary>
        /// <param name="strDepartmentNo"></param>
        /// <param name="strNewDepartmentNo"></param>
        public static void UpdateDeptmentNoCorrelationData(string strDepartmentNo, string strNewDepartmentNo)
        {
            string sql = @"update BS_Department set ParentDepartmentNo = '" + strNewDepartmentNo + "' where ParentDepartmentNo like '" + strDepartmentNo + "'";

            BaseSQL.ExecuteSql(sql);
        }
示例#21
0
        /// <summary>
        /// 查询系统参数表
        /// </summary>
        public void QuerySystemParameter(DataTable queryDataTable)
        {
            string sqlStr = "select * from BS_SysParameter";

            BaseSQL.Query(sqlStr, queryDataTable);
        }
示例#22
0
        /// <summary>
        /// 查询和当前零件编号相同的Bom信息数量
        /// </summary>
        public int QueryBom_CodeFileNameCount(string codeFileNameStr)
        {
            string sqlStr = string.Format("select Count(*) from BS_BomManagement where MaterielNo = '{0}'", codeFileNameStr);

            return(DataTypeConvert.GetInt(BaseSQL.GetSingle(sqlStr)));
        }
示例#23
0
        /// <summary>
        /// 删除全部系统参数
        /// </summary>
        public void DeleteSystemParameter()
        {
            string sqlStr = "Delete from BS_SysParameter";

            BaseSQL.ExecuteSql(sqlStr);
        }
示例#24
0
        /// <summary>
        /// 查询Bom的树形更多信息
        /// </summary>
        public DataTable QueryBomTreeList_MoreInfo(string materielNoStr)
        {
            string sqlStr = string.Format("select bom.*, SW_PartsCode.CodeName, SW_PartsCode.AutoId as PCAutoId, SW_PartsCode.FilePath, SW_PartsCode.Brand, SW_PartsCode.CatgName, SW_PartsCode.CodeSpec, SW_PartsCode.Unit, BS_BomMaterieState.MaterieStateText from F_BomMateriel_TreeRelation('{0}') as bom left join SW_PartsCode on bom.CodeFileName = SW_PartsCode.CodeFileName left join BS_BomManagement on bom.CodeFileName = BS_BomManagement.MaterielNo left join BS_BomMaterieState on BS_BomMaterieState.MaterieStateId = BS_BomManagement.MaterieStateId Order by CodeFileName", materielNoStr);

            return(BaseSQL.Query(sqlStr).Tables[0]);
        }
示例#25
0
        /// <summary>
        /// 查询单个系统参数值
        /// </summary>
        public static object QuerySystemParameter_Single(string moduleCateStr, string keyStr)
        {
            string sqlStr = string.Format("select ParameterValue from BS_SysParameter where ModuleCate = '{0}' and ParameterKey = '{1}'", moduleCateStr, keyStr);

            return(BaseSQL.GetSingle(sqlStr));
        }
示例#26
0
        /// <summary>
        /// 查询往来方金融信息
        /// </summary>
        public void QueryBussinessFinancialInfo(DataTable queryDataTable, string bussinessBaseNoStr)
        {
            string sqlStr = string.Format("select * from BS_BussinessFinancialInfo where BussinessBaseNo = '{0}'", bussinessBaseNoStr);

            BaseSQL.Query(sqlStr, queryDataTable);
        }
示例#27
0
        /// <summary>
        /// 查询项目状态信息的默认数量
        /// </summary>
        public int GetProjectStatus_DefaultCount(int autoIdInt)
        {
            string sqlStr = string.Format("select Count(*) from BS_ProjectStatus where IsDefault = 1 and AutoId != {0}", autoIdInt);

            return(DataTypeConvert.GetInt(BaseSQL.GetSingle(sqlStr)));
        }
示例#28
0
        public DataTable QueryPersonalMenu(string personalNoStr)
        {
            string sqlStr = string.Format("select b.MenuName from BS_UserMenuButton a inner join BS_MenuButton b on a.MenuButtonId=b.AutoId where b.buttonName like 'menuItemFlag' and a.UserNo = '{0}'", personalNoStr);

            return(BaseSQL.GetTableBySql(sqlStr));
        }
示例#29
0
        public DataTable GetButtonPersonal(string userNoStr)
        {
            string sqlStr = string.Format("select a.UserNo,b.* from BS_UserMenuButton a left join BS_MenuButton b on a.MenuButtonId = b.AutoId where b.ButtonName <> 'menuItemFlag' and a.UserNo like '%{0}%'", userNoStr);

            return(BaseSQL.GetTableBySql(sqlStr));
        }