public static int add(ModelSalesCompany model)
        {
            // 先判断有没有重名
            int intId = getIdByName(model.name);

            if (intId > 0)
            {
                return(intId);
            }
            else
            {
                return(DalSalesCompany.add(model));
            }
        }
        // 此方法有二个参数,根据名称查找id,用在添加入库单页面上
        // 如果已经添加了这个公司则直接返回id,如果没加则新建销售公司
        public static int getIdByName(string strCompanyName, int intAdminId)
        {
            int intId = getIdByName(strCompanyName);

            if (intId > 0)
            {
                return(intId);
            }
            ModelSalesCompany model = new ModelSalesCompany();

            model.name     = strCompanyName;
            model.id_admin = intAdminId;
            intId          = DalSalesCompany.add(model);
            if (intId > 0)
            {
                return(intId);
            }
            else
            {
                return(0);
            }
        }